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.

Try:

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

Hexadecimal digits and their decimal and binary values
HexDecimalBinary
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

Common hex values in binary

Single-nibble masks and round byte values, the ones you will see in flags, permissions and register dumps:

HexBinaryDecimal
0x0F111115
0x100001 000016
0x3F0011 111163
0x400100 000064
0x500101 000080
0x7F0111 1111127
0x801000 0000128
0xA01010 0000160
0xF01111 0000240
0xF81111 1000248
0xFF1111 1111255
0x1000001 0000 0000256
0xFFFF1111 1111 1111 111165 535

See the full 0x00–0xFF table

Related tools and guides