How to convert binary to hexadecimal
To convert binary to hexadecimal, split the bits into groups of 4 from the right, then write one hex digit for each group. This works because one hex digit is exactly 4 bits.
Steps
- Starting from the right, split the bits into groups of 4.
- If the leftmost group has fewer than 4 bits, add leading zeros.
- Replace each group with its hex digit (see the table in number systems explained).
Example 1: 11010110
Groups: 1101 and 0110. 1101 is D and 0110 is 6. The answer is D6.
Example 2: 1011101
Groups from the right: 1101 and 101. Add a leading zero to the left group: 0101. 0101 is 5 and 1101 is D. The answer is 5D.
Example 3: 11111111
Groups: 1111 and 1111. Each is F. The answer is FF.
Quick reference
| Bits | Hex | Bits | 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 |
Practise it
In Binary Practice, open Training and choose binary to hexadecimal.
Reverse direction: hexadecimal to binary.