>_

Hex to Binary

Type a hexadecimal number below to get the binary 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

Each hex digit maps to exactly 4 bits, so replace digit by digit:
3 → 0011
F → 1111
→ 111111

Reference table

Hex → Binary

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

In code

JavaScript

parseInt('3F', 16).toString(2) // '111111'

Python

format(int('3F', 16), 'b')  # '111111'

More examples

Open the full Number Base Converter →