Hex to Binary Converter

Expand hexadecimal values into full binary bit strings

Convert hexadecimal (base-16) values into binary (base-2) bit strings by expanding each hex digit to its four-bit nibble. Shows trimmed and nibble-aligned views plus a decimal cross-check. Runs entirely in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

How does hexadecimal convert to binary?

Because 16 is 2 to the fourth power, each hexadecimal digit corresponds to exactly four binary digits (a nibble). You expand every hex digit independently and concatenate the four-bit groups.

Expanding hexadecimal to binary is the reverse of grouping bits into hex digits, and it is essential when you need to inspect individual bits, set bitmask flags or read register layouts. This converter turns any hex value into its full binary bit string by expanding each digit into a four-bit nibble.

How it works

Hexadecimal is base 16 and binary is base 2, and 16 equals 2 to the fourth power. That power-of-two relationship means each hex digit maps to a unique group of exactly four binary digits. The conversion is therefore a simple per-digit lookup: A becomes 1010, F becomes 1111, 5 becomes 0101, and the results are joined together in order.

No decimal intermediate is needed. The tool reads each hex character, looks up its four-bit pattern in a fixed table, and concatenates. It then offers a trimmed view with leading zeros removed (the true numeric value) and a nibble-aligned view that keeps every group of four bits intact.

Example

Convert AF. The digit A expands to 1010 and F expands to 1111. Concatenated, that is 10101111, which equals 175 in decimal. The nibble-aligned view displays it as 1010 1111 so the correspondence with the two original hex digits is obvious.

The complete hex-to-nibble lookup table

Each of the 16 hex symbols maps to exactly one 4-bit pattern:

HexBinaryDecimal
000000
100011
200102
300113
401004
501015
601106
701117
810008
910019
A101010
B101111
C110012
D110113
E111014
F111115

Memorising the 8, 4, C, and F patterns (1000, 0100, 1100, 1111) gives you anchor points to work out any other nibble mentally.

When you need this conversion

Reading CPU and microcontroller registers: Embedded and systems documentation typically expresses register values and bit fields in hex. To understand which bits are set in a flag register or control word, you expand each hex digit into its four bits and read the individual positions. For example, a status register value of 0x35 expands to 0011 0101, letting you immediately see which of the eight flag bits are active.

Bitmask operations: Designing or debugging bitmask logic — setting, clearing, and testing individual bit flags — is easier in binary than in hex. Writing out the binary expansion confirms that a mask like 0xF0 affects only the upper nibble (1111 0000) and 0x0F only the lower nibble (0000 1111).

Network and protocol work: IPv4 subnet masks like 255.255.255.0 are often expressed in hex as FFFFFF00. Expanding each byte to binary shows the contiguous block of network bits clearly: 11111111 11111111 11111111 00000000.

Colour values: CSS hex colours like #FF8C00 split into three bytes — red FF = 11111111, green 8C = 10001100, blue 00 = 00000000 — which reveals the exact bit weights contributing to each channel.

Tips

You can include spaces, underscores or a leading 0x for readability; all are stripped before conversion. The nibble-aligned view is especially helpful when mapping hex register dumps back to individual control bits. Everything is processed locally in your browser, so no data leaves your device.