Binary to Hex Converter With Steps

Enter binary and get hex, with the four bit groups shown.

Hexadecimal

How it works

Hexadecimal exists to make binary readable. One hex digit stands for exactly four bits, so a byte that takes eight digits in binary takes only two in hex.

To convert, split the binary number into groups of four, starting from the right. If the leftmost group is short, pad it with zeros. Then replace each group with its hex digit. The values 0 to 9 keep their digits, and 10 to 15 become the letters A to F.

With a little practice you can read the sixteen patterns on sight. The ones worth knowing first are 0000 = 0, 1000 = 8, 1010 = A, 1100 = C and 1111 = F.

Worked example

11010110 splits into 1101 and 0110. 1101 is 13, which is D. 0110 is 6. Answer: D6.

Decimal, binary, octal and hex from 0 to 15

DecimalBinaryOctalHex
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F

Common questions

Why group in fours?

Sixteen is 2 to the 4th power, so four bits have exactly sixteen possible values, one for each hex digit.

What does 0x mean in front of a hex number?

It is a label programmers use to show that the number is hexadecimal. 0xD6 and D6 are the same value.

Related tools