Binary to Hexadecimal Converter

This free online binary to hexadecimal converter instantly translates any binary (base-2) number into its hexadecimal (base-16) equivalent. Enter a binary value below to see the converted result right away.


How to Use the Binary to Hexadecimal Converter

  1. Type a binary number (only digits 0 and 1) into the "Binary Number" field.
  2. Click "Convert" to see the equivalent hexadecimal value.
  3. If you enter an invalid character, correct the input and convert again.

The Group-of-Four Method

Sixteen is 2 to the power 4, so every hexadecimal digit stands for exactly four binary digits (a nibble). That makes conversion by hand a matter of regrouping rather than arithmetic:

  1. Starting from the right, split the binary number into groups of four bits.
  2. If the leftmost group has fewer than four bits, pad it with zeros on the left.
  3. Replace each group with its hex digit from the table below.

The converter reaches the same answer a different way: it reads the whole input as a base-2 number, then writes that value in base 16 using capital letters A to F.

Worked Example: 1101011110

The number has ten bits. Grouping from the right gives 11 0101 1110. Pad the first group to 0011, so the groups are 0011, 0101 and 1110. These map to 3, 5 and E, giving 35E. As a check, 35E in hex is 3 × 256 + 5 × 16 + 14 = 862, the same as the decimal value of 1101011110.

A common mistake is grouping from the left. That would split the number as 1101 0111 10 and give a wrong answer, so always start at the rightmost bit.

Nibble to Hex Lookup Table

BinaryHexBinaryHex
0000010008
0001110019
001021010A
001131011B
010041100C
010151101D
011061110E
011171111F

Where Hex Replaces Binary

Hex is a compact way to write bit patterns that people need to read. One byte of eight bits is always exactly two hex digits, so a 32-bit value fits in eight characters instead of thirty-two.

  • Web colours: the bytes 11111111, 00000000 and 10101010 for red, green and blue become FF00AA, written as #FF00AA in CSS.
  • Network hardware: MAC addresses are six bytes shown as pairs of hex digits, and IPv6 addresses are written in groups of four hex digits.
  • Programming and electronics: register values, bit masks and memory addresses in debuggers and datasheets are almost always given in hex.

What the Output Does Not Show

  • Leading zeros are dropped. 00001111 converts to F, not 0F. Add zeros back yourself if you need a fixed width such as two digits per byte.
  • No 0x prefix is added. In code, write the result as 0x35E or, for CSS colours, with a # in front.
  • Inputs longer than 53 bits may come out slightly wrong in the last digits, because the value passes through a standard JavaScript number. For longer patterns, the group-of-four method by hand is exact.

Frequently Asked Questions

The tool parses your binary input as a base-2 number, then formats that value in base-16, using digits 0-9 and letters A-F for values 10 through 15.

Binary 101010 equals decimal 42, which is 2A in hexadecimal. Try it yourself by entering 101010 above.

Because 16 equals 2 × 2 × 2 × 2. Four bits can hold exactly 16 different patterns, from 0000 to 1111, which match the 16 hex digits 0 to F one to one. Octal uses groups of three for the same reason, since 8 is 2 × 2 × 2.

The converter outputs the numeric value, and leading zeros do not change a number. When you need a fixed width, for example two hex digits per byte in a colour code or MAC address, pad the result with zeros on the left.

Remove the spaces first, since only 0 and 1 are accepted between the first and last digit. Keep in mind that results are exact only up to 53 bits. For longer data, convert one byte or a few bytes at a time and join the hex results, padding each byte to two digits.
No ratings yet — be the first!
Rate this calculator:
Was this tool helpful?