Hex to Binary Converter

Expand hexadecimal digits into readable four-bit binary groups, with a reverse mode for rebuilding hex from grouped binary.

Last updated: August 2026 | By Workshelve Team

Converted output will appear here...

How Hexadecimal Expands into Binary

Hexadecimal uses sixteen digit values: 0 through 9 followed by A through F. Because one hex character represents four bits, reading hex as binary is an expansion rather than a whole-number calculation: each source digit can be replaced independently by its four-bit pattern.

This page keeps those nibble boundaries visible by inserting spaces between the four-bit groups. For example, C0DE becomes 1100 0000 1101 1110. The spaces are for readability and are not part of the binary number.

Leading zero hex digits are deliberately preserved. That means 0F is shown as 0000 1111, which keeps the width encoded by the two input digits. The converter also accepts lowercase hex, whitespace, and one optional leading 0x prefix; other characters are rejected rather than silently removed.

Hex to Binary: Step by Step

1. Normalize the input

Remove one leading 0x marker and whitespace. Keep every hexadecimal digit, including leading zeros.

2. Expand each digit

Replace each hex digit with its four-bit equivalent. C becomes 1100, 0 becomes 0000, and F becomes 1111.

3. Keep the groups aligned

Write the four-bit groups in the same left-to-right order so the binary output mirrors the structure of the source hex.

Hex to Binary Examples

2A7₁₆
0010 1010 0111

Three hex digits expand to three 4-bit groups.

C0DE₁₆
1100 0000 1101 1110

Each source digit keeps its own nibble boundary.

00FF₁₆
0000 0000 1111 1111

Leading zero hex digits remain visible as 0000 groups.

9B4₁₆
1001 1011 0100

Letters A-F represent values ten through fifteen.

Worked Example: 3E9₁₆

3
0011
E
1110
9
1001
Keep the groups in the original digit order:
3E9₁₆ = 0011 1110 1001₂

Hex to Binary FAQs

Why does the binary output contain spaces?

The spaces separate the four-bit group produced by each hexadecimal digit. They are display separators only and do not change the binary value.

Why does 0F become 0000 1111 instead of just 1111?

This converter preserves the width implied by the hexadecimal input. Each hex digit expands to exactly four bits, so the leading 0 becomes a visible 0000 group.

What do A, B, C, D, E, and F mean in hexadecimal?

They are the six digits after 9 in base 16: A=10, B=11, C=12, D=13, E=14, and F=15.

Is 0x part of the hexadecimal value?

No. 0x is a common programming-language prefix that marks a following integer literal as hexadecimal. This tool accepts one optional 0x prefix at the start and removes it before conversion.

Can I paste lowercase hexadecimal?

Yes. Hex digits A-F are case-insensitive here, so c0de and C0DE produce the same binary groups.

Can I paste a CSS value such as #FF5733?

Not with the # marker. This calculator accepts hexadecimal digits, whitespace, and an optional leading 0x prefix. Remove # first if you only want to inspect the underlying hex digits as bits.

Why is a hex digit always shown as four binary bits?

Base 16 has 16 possible digit values, and four bits also have 16 possible patterns from 0000 through 1111. Preserving four bits per digit keeps the mapping one-to-one.

What does the Binary to Hex mode do with an incomplete four-bit group?

It pads the left side with zeros until the binary length is a multiple of four, then maps each group to one hex digit. Whitespace between binary groups is allowed.

Related Tools