Converter
Type a value, pick a direction, and watch the nibbles line up. Click any bit in the grid to flip it.
Hexadecimal result
Nibble breakdown — click bits to flip them
Show your work
Worked examples
Three conversions solved the long way — the same steps the converter shows above.
11111111₂ → FF₁₆
- 8 bits is already a multiple of 4 — no padding.
- Split:
1111|1111. 1111₂ = 8+4+2+1 = 15 = F₁₆.1111₂ = 15 = F₁₆. Read left to right: FF (255₁₀).
101101₂ → 2D₁₆
- 6 bits is not a multiple of 4 — pad 2 zeros on the left:
00101101. - Split:
0010|1101. 0010₂ = 0+0+2+0 = 2 = 2₁₆.1101₂ = 8+4+0+1 = 13 = D₁₆. Result: 2D (45₁₀).
1F₁₆ → 00011111₂
- Each hex digit expands to exactly 4 bits.
1₁₆ = 1 =0001₂.F₁₆ = 15 = 8+4+2+1 =1111₂.- Join: 00011111 (31₁₀). Leading zeros are kept.
Binary to hex reference table
All 16 nibbles — the complete binary-to-hexadecimal chart the converter applies.
| Binary | Hex | Decimal | Binary | Hex | Decimal |
|---|---|---|---|---|---|
| 0000 | 0 | 0 | 1000 | 8 | 8 |
| 0001 | 1 | 1 | 1001 | 9 | 9 |
| 0010 | 2 | 2 | 1010 | A | 10 |
| 0011 | 3 | 3 | 1011 | B | 11 |
| 0100 | 4 | 4 | 1100 | C | 12 |
| 0101 | 5 | 5 | 1101 | D | 13 |
| 0110 | 6 | 6 | 1110 | E | 14 |
| 0111 | 7 | 7 | 1111 | F | 15 |
Methodology: how nibble grouping works
Binary → hex: group, weight, read
Hexadecimal is base 16, and 16 = 2⁴. That single fact is the whole method: every block of exactly 4 binary digits (a nibble) corresponds to exactly one hex digit, with no division and no remainders. The procedure is:
- Pad left with zeros until the length is a multiple of 4. Leading zeros never change a value.
- Split into 4-bit groups from the right.
- Weigh each group with 8-4-2-1: a 1-bit contributes its weight, a 0-bit contributes nothing.
- Read each sum 0–15 as a hex digit (10→A, 11→B, 12→C, 13→D, 14→E, 15→F).
Hex → binary: expand, join
The reverse is even simpler and always exact: strip an optional 0x prefix, expand each hex digit to its 4-bit pattern (keeping leading zeros), and concatenate. Because the mapping is one-to-one, a round trip (binary → hex → binary) restores the original bits exactly.
Limits and precision
This tool accepts up to 4,096 bits (1,024 hex digits) and computes the decimal reference with arbitrary-precision integers, so long values stay exact. All computation happens locally in your browser — nothing is uploaded, logged, or sent anywhere.
Not the converter you need?
This page is the dedicated binary ↔ hexadecimal converter with a nibble visualizer and step-by-step working. Nearby tools cover different jobs:
- Binary converter (generalist) — translates binary to text/ASCII and back. Use it for encoding messages, not for nibble math.
- Base converter — converts between any bases from 2 to 36. Use it when you need octal, base-32, or other bases; use this page when you want the deepest binary ↔ hex treatment.
- Binary to decimal — binary ↔ decimal with place-value steps. Different target base, different method.
- Hex to binary (classic) — a plain one-line hex ↔ binary converter. This page is its deep version: nibble grid, show-your-work steps, formatting options, and honest validation.
- Decimal to hex — decimal ↔ hexadecimal. A different base pair entirely.
- Hexadecimal chart — static reference tables. Use it for lookup; use this page for live conversion.
Frequently asked questions
How do I convert binary to hex?
Group the binary digits into sets of 4 bits (called nibbles), starting from the right. If the leftmost group is short, pad it with leading zeros. Then read each 4-bit group as one hexadecimal digit using the weights 8-4-2-1. Example: 1010 1100 becomes A (8+0+2+0=10) and C (8+4+0+0=12), so 10101100 in binary equals AC in hex. This page does the grouping for you and shows every step.
Why do we group binary into 4 bits to get hex?
Because 16 equals 2 to the power of 4, so every group of exactly 4 binary digits maps to exactly one hexadecimal digit (0000=0 through 1111=F). That one-to-one mapping is what makes binary-to-hex conversion mechanical: no division or remainders, just grouping. It also works in reverse — each hex digit always expands to exactly 4 bits.
What is 11111111 in hexadecimal?
11111111 in binary equals FF in hexadecimal. Split into two nibbles: 1111 = 8+4+2+1 = 15 = F, and 1111 = 15 = F. Eight 1-bits is also the largest value one byte can hold: 255 in decimal.
What is 1010 in hex?
1010 in binary equals A in hexadecimal. One nibble: 1×8 + 0×4 + 1×2 + 0×1 = 8 + 0 + 2 + 0 = 10, and 10 in hex is written as the digit A.
How do I convert hex to binary?
Expand every hex digit into exactly 4 bits, keeping leading zeros, then join the groups. Example: 1F becomes 1 → 0001 and F → 1111, giving 00011111. Use the Hex → Binary tab above and the tool shows each digit’s expansion step by step.
What is 1F in binary?
1F in hexadecimal equals 00011111 in binary. The digit 1 expands to 0001 and F (15 = 8+4+2+1) expands to 1111. Joined: 00011111, which is 31 in decimal.
What is FF in binary?
FF in hexadecimal equals 11111111 in binary. Each F is 15, which is 8+4+2+1, so each becomes 1111. Joined: 11111111 — one full byte, 255 in decimal.
Do I need to pad binary with leading zeros before converting to hex?
Yes — pad zeros on the LEFT until the length is a multiple of 4. Leading zeros never change a number’s value (0010 is still 2), and the padding keeps every nibble complete so each maps to exactly one hex digit. Example: 101101 (6 bits) pads to 00101101, which groups as 0010=2 and 1101=D, giving 2D. The converter above pads automatically and shows the padded form in its steps.
What does the 0x prefix mean in hex?
The 0x prefix is just a marker that says “the digits that follow are hexadecimal” — it is not part of the value, so 0xFF and FF are the same number (255). It comes from C programming and is now the universal convention. You can paste values with or without the prefix into the Hex → Binary tab; the tool strips it and tells you it did so in the steps.
Why is hexadecimal used instead of binary?
Compactness. One hex digit replaces 4 binary digits, so a byte that needs 8 bits (11111111) fits in 2 hex digits (FF). Addresses, color codes (#FF5733), and machine code are far easier to read, compare, and dictate in hex, while staying trivially convertible back to exact binary — unlike decimal, which needs division to convert.
How many bits are in one hexadecimal digit?
Exactly 4 bits — half a byte, called a nibble. That fixed 4-bit width is why the hex digits run 0–9 then A–F (16 values = 2⁴): each digit covers every possible 4-bit pattern from 0000 to 1111.
What happens if I type a digit that isn’t valid, like 2 in binary?
The converter refuses to guess. It shows an honest error naming the exact character and its position — for example, “Invalid binary digit ‘2’ at position 3 — binary uses only 0 and 1.” The same applies to hex: characters outside 0–9 and A–F are reported with their position. Fix or remove the character and the result updates.
Should I convert binary to hex or binary to decimal?
Use hex when you work with bytes, addresses, color codes, or machine-level data — hex maps to binary nibble-for-nibble with zero math. Use decimal when humans need to read a magnitude (file sizes, counts, money). If you need binary ↔ decimal with place-value steps, use our dedicated binary-to-decimal converter; for any base from 2 to 36, use the general base converter.
Can I convert very long binary numbers to hex?
Yes — this tool accepts up to 4,096 bits (1,024 hex digits) and computes the decimal reference with arbitrary-precision integers, so long values stay exact instead of degrading into floating-point rounding. Everything runs locally in your browser; long inputs never leave your device.