Hex to binary converter
Hexadecimal and binary are two spellings of the same thing: every hex digit is
exactly four bits (a nibble). Type in either field and watch the mapping,
digit by digit. 0x and 0b prefixes are accepted.
Digit-by-digit mapping
Type a number above to see the conversion worked out step by step.
Why hex and binary convert so cleanly
16 is 2⁴, so one hexadecimal digit always corresponds to exactly four binary digits. That makes conversion mechanical: replace each hex digit with its 4-bit pattern and you're done — no arithmetic required.
2F₁₆ → 2 = 0010, F = 1111 → 0010 1111₂
Binary to hex is the same trick in reverse: group the bits in fours from the right,
then replace each group with its hex digit. This is why programmers write bit masks
in hex — 0xFF is much easier to read than 11111111,
and grouping in nibbles keeps long values legible.
Nibble reference table
| Hex | Decimal | Binary |
|---|---|---|
| 0 | 0 | 0000 |
| 1 | 1 | 0001 |
| 2 | 2 | 0010 |
| 3 | 3 | 0011 |
| 4 | 4 | 0100 |
| 5 | 5 | 0101 |
| 6 | 6 | 0110 |
| 7 | 7 | 0111 |
| 8 | 8 | 1000 |
| 9 | 9 | 1001 |
| A | 10 | 1010 |
| B | 11 | 1011 |
| C | 12 | 1100 |
| D | 13 | 1101 |
| E | 14 | 1110 |
| F | 15 | 1111 |
Related tools and guides
- Binary ↔ decimal converter — powers of two, spelled out.
- Bitwise operations explained — AND, OR, XOR and shifts on those bits.
- Two's complement calculator — how negative numbers look in binary.