Binary to Hex Converter
| Binary | Decimal | Hex | |||
|---|---|---|---|---|---|
| 0000 | 0 | 0 | 0001 | 1 | 1 |
| 0010 | 2 | 2 | 0011 | 3 | 3 |
| 0100 | 4 | 4 | 0101 | 5 | 5 |
| 0110 | 6 | 6 | 0111 | 7 | 7 |
| 1000 | 8 | 8 | 1001 | 9 | 9 |
| 1010 | 10 | A | 1011 | 11 | B |
| 1100 | 12 | C | 1101 | 13 | D |
| 1110 | 14 | E | 1111 | 15 | F |
n.toString(16) renders, parseInt(s, 16) reads back. The field arithmetic never changes, only the digit alphabet: hex packs four binary digits per character, which is why one hex digit is exactly a nibble.Paste binary code (space-separated bytes like 01001000 01101001) and get clean hexadecimal — 48 69 — or paste hex and get the binary. The conversion works in groups of four bits: each binary nibble maps to exactly one hex digit, which is why programmers write memory dumps in hex.
Both directions update live and strict validation rejects malformed groups instead of guessing. It pairs with the text-to-binary converter for the full journey from human text to machine notation.
How to use
- Paste binary in the first box — space-separated groups of up to 8 bits.
- Read the hexadecimal in the second box, one or two hex digits per group.
- Paste hex (like 48 69) in the second box to convert back to binary.
Frequently asked questions
How do you convert binary to hex?
Group the bits in fours from the right, then convert each group: 0100 = 4, 1001 = 9, so 01001001 = 49 in hex. Four bits (a nibble) cover exactly 0–15, the range of one hex digit.
Why do programmers use hexadecimal?
It is readable shorthand for binary: every byte is exactly two hex digits instead of eight bits. Memory dumps, color codes and MAC addresses all use hex for this reason.
What is 11111111 in hex?
FF — the maximum value of one byte, 255 in decimal. Eight 1-bits map to two F digits, one per nibble.
Does the converter handle values longer than a byte?
Yes — groups are converted independently, so 16-bit, 32-bit and arbitrary-length binary strings all work. Keep the groups separated with spaces for reliable parsing.
Why do programmers use hex instead of binary?
Density with alignment: one hex digit encodes exactly four bits, so a 32-bit value is 8 hex characters instead of 32 - half the characters of decimal, and the digit boundaries match byte boundaries, which decimal destroys. Memory dumps, MAC addresses, color codes (#RRGGBB) and Unicode escapes (U+1D400) all lean on hex for the same reason: it is binary you can actually read.