>_

Binary to Hex

Type a binary number below to get the hexadecimal value — other bases are shown too. The manual method is explained further down.

Try it

Custom base

Two’s complement

How to convert by hand

Group the bits in fours from the right (pad with zeros); each group is one hex digit:
1101 → D
0110 → 6
→ D6

Reference table

Binary → Hex

0 0
1 1
10 2
11 3
100 4
101 5
110 6
111 7
1000 8
1001 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F
10000 10
100000 20
1000000 40
1100100 64
1111111 7F
10000000 80
11111111 FF
100000000 100
1111101000 3E8
10000000000 400
1000000000000 1000
1111111111111111 FFFF

In code

JavaScript

parseInt('11010110', 2).toString(16).toUpperCase() // 'D6'

Python

format(int('11010110', 2), 'X')  # 'D6'

More examples

Open the full Number Base Converter →