Why Hex Maps Cleanly to Binary
One hexadecimal digit represents exactly four bits because 16 = 2⁴. That makes conversion mechanical: preserve each hex digit and replace it with its 4-bit nibble.
| Hex | Binary | Hex | Binary |
|---|---|---|---|
0 |
0000 |
8 |
1000 |
1 |
0001 |
9 |
1001 |
2 |
0010 |
A |
1010 |
3 |
0011 |
B |
1011 |
4 |
0100 |
C |
1100 |
5 |
0101 |
D |
1101 |
6 |
0110 |
E |
1110 |
7 |
0111 |
F |
1111 |
Worked Example: 2A to Binary
Convert one digit at a time: 2 → 0010 and A → 1010. Joining the nibbles gives 2A₁₆ = 00101010₂.
Leading zeros matter when hex is being used as a fixed-width byte representation. For example, 0A maps to 00001010; dropping the first four zeros changes the displayed width even though the numeric value stays 10.
Input Rules and Byte Order
The converter accepts hexadecimal digits 0-9, A-F, or a-f, with whitespace allowed. Do not include a 0x prefix. Each input hex digit always produces four output bits.
This operation converts the written hex pattern; it does not reinterpret byte order. If a memory dump contains bytes 12 34, the output follows that order. Endianness only matters when those bytes are later interpreted as a multi-byte number.
For the reverse direction use Binary to Hex. For decimal comparisons and common masks, see the binary, decimal, and hex cheat sheet.