PM & AI Chronicles

From Product Thinking to Prompt Engineering – One Tool at a Time

Binary to Hexadecimal Made Easy

Ever Wondered How Computers Store Colors

Think about this: when you design a website and use a color code like #FF5733, or when you read about memory addresses like 0x1A3F in programming — how does the computer actually make sense of these?

We humans are comfortable with decimal numbers (0–9), and computers are comfortable with binary numbers (0s and 1s). However, binary numbers become very long very quickly and are difficult for humans to read. That’s where hexadecimal comes in.

Hexadecimal (or hex) is a shorthand language that bridges the gap between binary and decimal. It’s compact enough for humans to read, but still close enough to binary that computers can use it easily. Think of it like this: we have different human languages in the world, but the idea is the same — people are communicating.

Decimal, binary, and hexadecimal are like three different languages for numbers:

  • Decimal is for everyday human use (0–9).
  • Binary is for computers (just 0s and 1s).
  • Hexadecimal is a convenient middle ground (0–9 and A–F).

Just as we can translate between languages, we can also translate between binary and hexadecimal. That’s what this post is all about:

  • What hexadecimal really means.
  • How to convert binary into hexadecimal.
  • How to convert hexadecimal into binary.

By the end, you’ll not only understand hexadecimal but also be able to do the conversions yourself — and trust me, it’s way simpler than it looks 🙂.

What is Hexadecimal ?:

Hexadecimal is simply a way of representing numbers — but instead of stopping at 9 like decimal does, it keeps going by adding letters A to F. This gives us 16 symbols in total (0–9 and A–F), which is why we call it base 16. Just like decimal is built on powers of 10 and binary is built on powers of 2, hexadecimal is built on powers of 16

  • Numbers 0–9 (same as decimal).
  • Letters A–F to represent values 10–15.

Each hexadecimal digit can be stored in the computer as a 4-bit binary value. That means one hex digit directly represents a group of 4 binary digits. When programmers or designers work with data, hexadecimal provides a shorter, more readable form of binary. Instead of long strings of 0s and 1s, hexadecimal lets us write the same values with far fewer symbols. Here’s how numbers are mapped:

  • Decimal 0–9 → Hex 0–9
  • Decimal 10 → Hex A
  • Decimal 11 → Hex B
  • Decimal 12 → Hex C
  • Decimal 13 → Hex D
  • Decimal 14 → Hex E
  • Decimal 15 → Hex F

👉 So every 4 binary digits (bits) can be neatly written as a single hexadecimal digit. For example, binary 1111 = decimal 15 = hex F

When you look at something like a color code #FF5733 or a memory address 0x1A3F, what you’re really seeing is binary data represented in hexadecimal — compact for humans, but still easy for computers to translate back into binary.

What is Binary (Base 2)

Binary is the language of computers. It’s built on only two digits: 0 and 1, which is why it’s called Base 2. 👉 Think of it like a light switch: Instead of counting with 0–9 like us, computers count only with ONs and OFFs

  • 1 = ON
  • 0 = OFF

How to Read a Binary Number (Step by Step): The trick with binary is simple:
👉 Start from the rightmost digit.
👉 Each place represents a power of 2.

  • The rightmost digit is always 20 = 1.
  • The next digit to the left is 21 = 2.
  • Then 22 =4.
  • Then 23=8.
  • And so on… doubling each time as you move left.

So, every digit in binary is like a “switch” controlling one of these powers of 2:

  • If the digit is 1, that power is counted.
  • If the digit is 0, that power is ignored.

Converting Binary to Hexadecimal

The easiest way to convert binary to hexadecimal is:

  • Always start from the right and group the binary digits into sets of 4 bits.
  • Convert each group into decimal.
  • Convert decimal values 10–15 into their hexadecimal equivalents (A–F).
  • Put the hex digits together

Example: Convert 10110110 (binary) to Hexadecimal

Step 1: Starting from the right, group the binary number into 4 bits:
👉 If the leftmost group has fewer than 4 bits, add leading 0s to make it 4

  • Binary: 1011 0110

Step 2: Convert each 4-bit group into decimal:

  • 1011 = 11
  • 0110 = 6

👉(If you’re not sure how to do this, check out my earlier article on Binary to Decimal Conversion Made Easy

Step 3: Convert decimal values 10–15 into their hexadecimal equivalents (A–F) (refer to the conversion above):

  • 11 → B
  • 6 → 6

Step 4: Write the hex digits in the same left-to-right order as the grouped binary digits.
👉 First group (left) becomes the first hex digit, second group (right) becomes the second hex digit, and so on.

  • Binary groups: 1011 0110
  • Hex digits: B 6

✅So, 10110110 (binary) = B6 (hexadecimal)

💡 Quick Note: The grouping always starts from the right, but once grouped, you read and write the hex digits from left to right in the same order as the binary

Converting Hexadecimal to Binary

Let us convert 3F (hexadecimal) to Binary.

Step 1: Take each hex digit separately.

  • Hex: 3 F

Step 2: Convert each hex digit into its decimal value.
👉 (Refer to the Hexadecimal Values section above for the mapping.)

  • 3 = 3
  • F = 15

Step 3: Write each decimal value in 4-bit binary form:

  • 3 → 0011
  • 15 → 1111

👉(If you’re not sure how to do this, check out my earlier article on Binary to Decimal Conversion Made Easy

Step 4: Put the binary groups together in the same left-to-right order as the hex digits:

  • 0011 1111

So, 3F (hexadecimal) = 00111111 (binary).

💡 Quick Note: Each hex digit always translates into exactly 4 binary bits. That’s why hexadecimal is such a neat shorthand for binary — it makes long binary numbers much easier to read.

👉 Interested to know how text can be converted into binary? Check out my post Binary to Text Made Easy