How to convert hex to binary
- Enter a hex number such as
3For0xDEAD. You can also paste a list with one number per line. - The binary result appears immediately. Tick Group digits to split it into nibbles, or Signed to pad it to 8, 16, 32 or 64 bits.
- Follow the step-by-step mapping of each hex digit to its 4 bits, then copy the binary value.
Hex to binary conversion table
Each hex digit corresponds to one 4-bit group, called a nibble. Memorise or bookmark this table and you can convert any hex number to binary by hand.
| Hex | Binary | Decimal |
|---|---|---|
0 | 0000 | 0 |
1 | 0001 | 1 |
2 | 0010 | 2 |
3 | 0011 | 3 |
4 | 0100 | 4 |
5 | 0101 | 5 |
6 | 0110 | 6 |
7 | 0111 | 7 |
8 | 1000 | 8 |
9 | 1001 | 9 |
A | 1010 | 10 |
B | 1011 | 11 |
C | 1100 | 12 |
D | 1101 | 13 |
E | 1110 | 14 |
F | 1111 | 15 |
How to convert hexadecimal to binary
Because 16 = 2⁴, one hex digit always stands for exactly four bits, and two hex digits for one byte. To convert, replace every digit with its 4-bit pattern from the table and write the groups next to each other:
2F9 → 2 = 0010, F = 1111, 9 = 1001 → 0010 1111 1001
The leading zeros can be dropped, giving 1011111001 (761 in decimal). Zeros inside the number must stay: C3 is 1100 0011, not 11 0011.
In code: Python format(int('2F9', 16), 'b'), JavaScript parseInt('2F9', 16).toString(2) (or BigInt('0x' + hex).toString(2) for long values). Excel's =HEX2BIN("1A", 8) gives 00011010 but only works up to 1FF.
Frequently asked questions
Why does each hex digit equal 4 bits?
Because 16 = 2⁴. Four bits have exactly 16 combinations, 0000 to 1111, one for each hex digit from 0 to F. That makes hex a compact way to write binary: two hex digits describe one byte.
What is FF in binary?
FF is 1111 1111 in binary – eight ones, the largest value of one byte (255 in decimal).
Should I keep the leading zeros?
Leading zeros do not change the value: 0001 1010 and 11010 are both 26. Keep them when you need a fixed width such as a full byte or a register; tick Group digits or Signed to pad the result.
Can I convert hex numbers with a fractional part?
Yes. Digits after the point also map to 4 bits each, so 1A.8 = 0001 1010.1000 = 11010.1 in binary, which is 26.5 in decimal.