Hex to Binary Converter

16

Digits 0–9 and A–F; a 0x prefix, spaces and underscores are ignored. Calculated exactly in your browser.

Binary result
0011 1111 2
One hex digit = one nibble

Each hexadecimal digit stands for exactly four bits, so conversion is a lookup: replace every digit with its 4-bit pattern.

One hex digit is exactly four bits

Because 16 = 2⁴, each hexadecimal digit maps to one 4-bit group (a nibble), with no arithmetic needed:

HexBitsHexBits
0000081000
1000191001
20010A1010
30011B1011
40100C1100
50101D1101
60110E1110
70111F1111

Example: A5 → A = 1010, 5 = 0101 → 1010 0101. Going back is the same lookup in reverse; the binary to hex converter groups bits from the right in fours.

For a fixed-width field, keep all the bit groups the field calls for. A full byte in a register or packet uses two hex digits, so the mask 0x0F becomes 0000 1111.

Related guides

FAQ

Frequently Asked Questions

How do you convert hex to binary?
Replace each hex digit with its 4-bit binary pattern: 0=0000 … 9=1001, A=1010, B=1011, C=1100, D=1101, E=1110, F=1111. 3F → 0011 1111.
Why does one hex digit equal four bits?
16 = 2⁴, so the 16 possible hex digits match the 16 possible patterns of four bits exactly.
Are leading zeros kept?
The result pads each group to four bits, so 3F displays as 0011 1111. A leading zero digit can be dropped when it contributes a whole group of zeros. For example, 0F displays as 1111.
Copied to clipboard!