Using the converter
Type a binary number, like 11010110, and the hex appears straight away, with the groups of bits shown underneath. A number grouped the way programmers write it, as 1101_0110, reads as one number, and a space starts a new number, so a row of bytes is converted byte by byte. Choose capital or lowercase letters for the hex in the settings.
Press swap to turn hex back into binary, or use the menus to go to decimal or octal instead.
How to convert binary to hex
Starting from the right, split the bits into groups of four. If the last group on the left is short, pad it with zeros. Then turn each group into one hex digit, where 0000 is 0, 1001 is 9, 1010 is A and 1111 is F.
For 11010110, the groups are 1101 and 0110. 1101 is 8 + 4 + 1 = 13, which is D, and 0110 is 4 + 2 = 6. So the answer is D6, which is 214 in decimal. Grouping from the right matters, because that's where the ones place is. Grouping from the left would give a different number whenever the length isn't a multiple of four.
Binary, hex and bytes
A byte is eight bits, so it's always exactly two hex digits, from 00 to FF. That's why hex dumps, colour codes like #D6D6D6 and network addresses are written in hex. Each pair of digits is one byte, and each digit is one half of it, called a nibble.
Questions
What is 1010 in hex?
A. 1010 is 8 + 2 = 10, and the hex digit for 10 is A.
What is 11111111 in hex?
FF. Both groups of four are 1111, which is F.
Do I need to convert to decimal first?
No. Going straight from groups of four bits is quicker and avoids the long division. Decimal is only needed if you want the value as an ordinary number.
What if my binary is text, like 01001000 01101001?
Then each group of eight is a character. The binary translator reads it as text, and this page will give the hex of each byte.
Decimal, binary, octal and hex from 0 to 32
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 3 | 11 | 3 | 3 |
| 4 | 100 | 4 | 4 |
| 5 | 101 | 5 | 5 |
| 6 | 110 | 6 | 6 |
| 7 | 111 | 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 |
| 16 | 10000 | 20 | 10 |
| 17 | 10001 | 21 | 11 |
| 18 | 10010 | 22 | 12 |
| 19 | 10011 | 23 | 13 |
| 20 | 10100 | 24 | 14 |
| 21 | 10101 | 25 | 15 |
| 22 | 10110 | 26 | 16 |
| 23 | 10111 | 27 | 17 |
| 24 | 11000 | 30 | 18 |
| 25 | 11001 | 31 | 19 |
| 26 | 11010 | 32 | 1A |
| 27 | 11011 | 33 | 1B |
| 28 | 11100 | 34 | 1C |
| 29 | 11101 | 35 | 1D |
| 30 | 11110 | 36 | 1E |
| 31 | 11111 | 37 | 1F |
| 32 | 100000 | 40 | 20 |
Decimal, binary, octal and hex from 0 to 32stringmash.com/binary-to-hex
Sources
Added and reviewed . What's new






