Skip to the tool
Binary Translator Free tools

Binary to hex converter

Type binary to get hexadecimal. Every four bits become one hex digit.

Updated · Written and checked by Murugan Vellaichamy

Waiting for input

Prefixes 0b, 0o, 0x and spaces or underscores between digits are fine. A point starts the fraction.

Result
Try:

How to convert binary to hex

Split the bits into groups of four, starting from the right, and pad the leftmost group with zeros if it’s short. Each group of four (a nibble) is exactly one hex digit, so swap each group using the table below.

1101 0110 → D 6 → D6. No division needed, because 16 is 24.

Binary to hex chart

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

Common mistakes

Grouping from the left

101011 grouped as 1010 11 gives A3, which is wrong

Instead: Group from the right: 10 1011, padded to 0010 1011, gives 2B

Writing 10 to 15 as two digits

Writing 1100 as 12 instead of C

Instead: Each group is one hex digit: 10 to 15 are A to F

Mixing up B and D

1011 is B (11) and 1101 is D (13)

Instead: Add the place values 8, 4, 2, 1 rather than guessing from the shape

Where binary turns into hex

Programmers write bit patterns in hex because it’s four times shorter. A web colour is the clearest example: in CSS, #FF8000 is three bytes, red, green and blue. In binary that’s 11111111 10000000 00000000, and grouping it by four gives FF 80 00 again.

Sources and method

Conversions use exact whole-number arithmetic (JavaScript BigInt), so long numbers keep every digit. Fractions are kept as exact ratios; when the digits repeat, the repeating block is found and marked instead of rounded.

Questions

What is a nibble?

Four bits, half a byte. One nibble is one hex digit, so a byte is always exactly two hex digits.

What if the number of bits isn't a multiple of 4?

Add zeros on the left. 101 becomes 0101, which is 5 in hex. Leading zeros don’t change the value.

How do I convert binary to octal instead?

Group the bits in threes, because 8 is 23. The base converter on this site does both.

More converters

Copied