How to Convert Binary to Hex (Step by Step, With Worked Examples)

Computers work in binary — strings of 1s and 0s. But long binary numbers are hard for humans to read: is 11011011 easy to remember? Not really. That is why programmers use hexadecimal, or “hex” for short: it squeezes every four binary digits into a single character, so the same value becomes much shorter and easier to read.

Converting binary to hex takes one simple trick — grouping the bits in fours. This guide teaches it step by step, with four worked examples you can check.

What Is Hexadecimal?

Hexadecimal is base 16. It uses sixteen symbols:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

The first ten symbols are the digits you already know. The last six are letters, standing for the values 10 to 15:

  • A = 10
  • B = 11
  • C = 12
  • D = 13
  • E = 14
  • F = 15

The key fact that makes the whole conversion work is this: one hex digit is exactly four binary digits. A four-bit group can hold sixteen different values (0000 to 1111), and hex has exactly sixteen symbols.

The Binary to Hex Method in 3 Steps

Step 1: Split the binary number into groups of four digits, starting from the right. The rightmost group is the first one. If the leftmost group has fewer than four digits, pad it with zeros on the left.

Step 2: Convert each group of four into one hex digit. Memorise the table below — or work it out as a small binary-to-decimal sum (the place values are 8, 4, 2, 1).

Step 3: Write the hex digits out in order. That is your answer.

Here is the table you need — the sixteen four-bit groups and the hex digit each one becomes:

Binary Hex Binary Hex
0000 0 1000 8
0001 1 1001 9
0010 2 1010 A
0011 3 1011 B
0100 4 1100 C
0101 5 1101 D
0110 6 1110 E
0111 7 1111 F

Worked Example 1: Convert 1010 to Hex

Only four digits, so there is just one group: 1010.

The place values are 8, 4, 2, 1, so 1010 = 8 + 0 + 2 + 0 = 10. And 10 in hex is A.

So 1010 in binary equals A in hex.

Worked Example 2: Convert 1111 to Hex

Again one group: 1111 = 8 + 4 + 2 + 1 = 15. And 15 in hex is F.

So 1111 in binary equals F in hex.

Worked Example 3: Convert 101010 to Hex

Six digits this time, so split from the right into groups of four: 10 1010. The left group has only two digits, so pad it with zeros on the left: 0010 1010.

Now convert each group:

  • 0010 = 2
  • 1010 = 10 = A

So 101010 in binary equals 2A in hex. Check it in decimal: 2A in hex is 2 × 16 + 10 = 42, and 101010 in binary is 32 + 8 + 2 = 42. The two answers match, so the conversion is right.

Worked Example 4: Convert 11011011 to Hex

Eight digits, so two full groups: 1101 1011.

  • 1101 = 8 + 4 + 0 + 1 = 13 = D
  • 1011 = 8 + 0 + 2 + 1 = 11 = B

So 11011011 in binary equals DB in hex. Check it in decimal: DB in hex is 13 × 16 + 11 = 208 + 11 = 219, and 11011011 in binary is 128 + 64 + 16 + 8 + 2 + 1 = 219. Match again.

Going the Other Way: Hex to Binary

The method runs backwards just as easily, and it is worth knowing because you will often need both directions:

1. Take each hex digit and write it as four binary digits. Use the same table, reading it right to left.

2. Join the groups together. That is your binary number.

Two examples:

  • 1F in hex → 1 is 0001, F is 1111, so the answer is 00011111 in binary (31 in decimal).
  • A5 in hex → A is 1010, 5 is 0101, so the answer is 10100101 in binary (165 in decimal — check it: 128 + 32 + 4 + 1 = 165).

Common Mistakes When Converting Binary to Hex

1. Grouping from the left instead of the right. This is the mistake almost everyone makes once. Take 110110: grouped from the left, you get 1101 10 — which is wrong. Grouped from the right, you get 11 0110, padded to 0011 0110, which is 36 in hex (54 in decimal — check it: 3 × 16 + 6 = 54). Always start grouping from the rightmost digit.

2. Forgetting to pad the leftmost group. 101 is not 101 in hex — it is 0101, which is 5. Without the padding zero you cannot read the group from the table.

3. Mixing up the letters. In hex, A is 10, not 1, and F is 15, not 16. The letters start where the digits run out, so A follows 9, not 0.

Frequently Asked Questions

How do I convert binary to hex?

Split the binary number into groups of four digits, starting from the right and padding the leftmost group with zeros if needed, then turn each group into one hex digit (0000 = 0 … 1111 = F). Write the digits out in order. For the other direction, see our guide on how to convert binary to decimal.

What is 1010 in hex?

1010 in binary is A in hex: 8 + 2 = 10, and 10 is A.

Why do programmers use hex instead of binary?

Because it is shorter and easier to read. One hex digit replaces four binary digits, so a byte (8 bits) becomes just two characters — FF instead of 11111111.

Try It Yourself

Pick any binary number, group it in fours from the right, and convert it — then check your answer instantly with our free Binary Translator. Try 1010 first (you already know it should come out as A), then try a longer one like 10110110 (answer: B6).

For the reverse direction, see our step-by-step guide on how to convert hex to binary.