20 min read
Binary and Hexadecimal
One hex digit is exactly four bits. Group in fours from the right to convert — the most useful conversion in computing.
Why Groups of Four?
16 = 2⁴. So every hex digit (0–F) is exactly four bits — one nibble. Two hex digits make one byte. That is why programmers love hex: a long binary number becomes four times shorter and much easier to read.
| Hex digits as 4-bit groups | |||||
|---|---|---|---|---|---|
Binary to Hexadecimal
- Split the bits into groups of four, starting from the right.
- If the left-most group is short, pad it with leading zeros.
- Change each group into one hex digit (use 8-4-2-1 inside each group).
Hexadecimal to Binary
Write each hex digit as exactly four bits, then join the groups.
Number base converter
FromNumberTo
Binary (2)
1110011011
Octal (8)
1633
Decimal (10)
923
Hex (16)
39B
Working: multiply each digit by its place value, then add
| Digit | Place value | Digit × place value |
|---|---|---|
| 1 | 29 = 512 | 1 × 512 = 512 |
| 1 | 28 = 256 | 1 × 256 = 256 |
| 1 | 27 = 128 | 1 × 128 = 128 |
| 0 | 26 = 64 | 0 × 64 = 0 |
| 0 | 25 = 32 | 0 × 32 = 0 |
| 1 | 24 = 16 | 1 × 16 = 16 |
| 1 | 23 = 8 | 1 × 8 = 8 |
| 0 | 22 = 4 | 0 × 4 = 0 |
| 1 | 21 = 2 | 1 × 2 = 2 |
| 1 | 20 = 1 | 1 × 1 = 1 |
512 + 256 + 128 + 0 + 0 + 16 + 8 + 0 + 2 + 1 = 923
Answer: 11100110112 = 92310
Try it: Set To to Hex to see the groups of four. Then try From Hex → Binary with A7E.
Practice
What is C8₁₆ in binary?
More lessons in Number Systems · Next: Octal and Hexadecimal — and Choosing a Route · Previous: Binary and Octal
