Binary to Hex Converter

BinaryDecimalHex
000000000111
001022001133
010044010155
011066011177
100088100199
101010A101111B
110012C110113D
111014E111115F
Hex and binary are both radix views of the same integer, and JavaScript speaks every radix natively: the MDN toString(radix) reference shows one method covering hex (16), binary (2), octal (8) and decimal (10) in both directions - 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.
The table is the whole algorithm: one hex digit = exactly four bits (a nibble), so a byte is always two digits - 11111111 splits into 1111|1111 = FF. Programmers read memory dumps in hex for this reason: half the characters, same information. The 0x prefix (0x48) is C-language convention for "hex follows"; the same digits style your phone color as #RRGGBB and Unicode code points as U+1D400.
Each binary group converts to one hex digit pair. Max 8 bits per group; invalid groups are flagged, not guessed.

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

  1. Paste binary in the first box — space-separated groups of up to 8 bits.
  2. Read the hexadecimal in the second box, one or two hex digits per group.
  3. 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.

Related tools