Binary to hex converter

Type or paste a binary number of any length and get its hexadecimal and decimal value instantly, with a nibble table to check the conversion by hand.

Runs in your browser. Nothing you enter is uploaded.

Nibble table

How to use the binary to hex converter

  1. Type or paste a binary number into the Binary box; spaces, underscores and a 0b prefix are fine.
  2. Read the hexadecimal and decimal results below as you type.
  3. Tick Uppercase, 0x prefix or Group bytes to format the hex output the way you need.
  4. Click Copy next to a result to put it on your clipboard.

How do you convert binary to hex by hand?

Split the binary number into groups of four bits, starting from the right, and pad the leftmost group with zeros if it has fewer than four. Each group of four bits, called a nibble, maps to exactly one hex digit, from 0000 = 0 to 1111 = F, as shown in the nibble table. For example, 1101 1110 1010 1101 becomes D E A D, so the result is DEAD, which is 57005 in decimal.

Because the mapping is digit by digit, no arithmetic is needed, and it works for numbers of any length. The converter keeps every nibble you type, so 00001010 becomes 0A and not just A, which matters when the leading zeros are part of a fixed-width value such as a byte.

Why do programmers use hexadecimal?

Hex is a compact way to write binary. One byte, eight bits, is always exactly two hex digits, so 11111111 is simply FF and a 32-bit value fits in eight characters. That is why hex shows up in colour codes like #FF8800, memory addresses, MAC addresses, file signatures and network dumps: it stays readable while still showing the underlying bits clearly.

Frequently asked questions

How long can the binary number be?

There is no practical limit. The hex conversion works nibble by nibble and the decimal value is calculated with JavaScript's BigInt, so even a 64-bit or 256-bit binary number converts exactly, without rounding.

What does Group bytes do?

It splits the hex result into pairs of digits, one pair per byte, counting from the right, and pads the first pair with a zero if needed. 111110000 becomes 01 F0, which is easier to compare with byte-oriented output such as a hex dump.

Can I paste binary with spaces or a 0b prefix?

Yes. Spaces, line breaks and underscores are ignored, and a leading 0b is removed, so 0b1111_0000 and 1111 0000 both give F0. Any other character shows an error that names the character, and the last valid result stays visible.

Does it handle negative numbers?

The input is treated as an unsigned number: every bit counts towards a positive value. If your binary is a signed two's complement value, the hex digits are still correct, but the decimal shown is the unsigned value, so 11111111 shows 255 rather than -1.

Related tools