Binary to Hex Converter With Steps
Enter binary and get hex, with the four bit groups shown.
How it works
Hexadecimal exists to make binary readable. One hex digit stands for exactly four bits, so a byte that takes eight digits in binary takes only two in hex.
To convert, split the binary number into groups of four, starting from the right. If the leftmost group is short, pad it with zeros. Then replace each group with its hex digit. The values 0 to 9 keep their digits, and 10 to 15 become the letters A to F.
With a little practice you can read the sixteen patterns on sight. The ones worth knowing first are 0000 = 0, 1000 = 8, 1010 = A, 1100 = C and 1111 = F.
Worked example
11010110 splits into 1101 and 0110. 1101 is 13, which is D. 0110 is 6. Answer: D6.
Decimal, binary, octal and hex from 0 to 15
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
Common questions
Why group in fours?
Sixteen is 2 to the 4th power, so four bits have exactly sixteen possible values, one for each hex digit.
What does 0x mean in front of a hex number?
It is a label programmers use to show that the number is hexadecimal. 0xD6 and D6 are the same value.