Binary to hex
Group bits by four from the right and read each group as one hex digit.
Result
Settings
Result
Settings
Result
Settings
Result
Recent
To turn binary into hex, cut the bits into groups of four starting from the right and replace each group with one hex digit. Paste a bit string such as 11010110 and the hex value appears, ready to copy with or without 0x. There is nothing to install or sign up for.
How to do it by hand
- Start at the right end and cut the bits into groups of four.
- If the leftmost group is short, fill it with zeros on the left.
- Read each group with the weights 8, 4, 2 and 1, and write the total as 0 to F.
- Put the digits together in the same order.
Worked examples
11010110
1101 = D, 0110 = 6
D6
1011111
0101 = 5, 1111 = F
5F
100100011
0001 = 1, 0010 = 2, 0011 = 3
123
Common mistakes
- Grouping from the left. Cutting 1011111 into 1011 and 111 gives a wrong answer; start from the right.
- Writing a group like 1010 as 10. It is a single hex digit, A.
- Dropping a zero inside a group, which shifts every digit after it.
Byte patterns you see often
| Binary (8 bits) | Hex | Decimal |
|---|---|---|
| 0000 0000 | 00 | 0 |
| 0000 0001 | 01 | 1 |
| 0000 1010 | 0A | 10 |
| 0000 1111 | 0F | 15 |
| 0001 0000 | 10 | 16 |
| 0010 0000 | 20 | 32 |
| 0100 0000 | 40 | 64 |
| 0101 0101 | 55 | 85 |
| 0111 1111 | 7F | 127 |
| 1000 0000 | 80 | 128 |
| 1010 1010 | AA | 170 |
| 1100 0000 | C0 | 192 |
| 1111 0000 | F0 | 240 |
| 1111 1110 | FE | 254 |
| 1111 1111 | FF | 255 |
Questions people ask
Does the bit count have to be a multiple of four?
No. The tool pads the left side with zeros for you, and that does not change the value.
Can I get 0x in front of the result?
Yes. Turn on the prefix option and the result shows as 0x5F instead of 5F.
Can I see the bytes in reverse order?
Yes. The byte order section swaps big endian and little endian, so 12 34 becomes 34 12.