Hexadecimal, binary and decimal: a guide to understanding them

If you program or study computing, sooner or later you meet numbers in binary or hexadecimal. Here is what they are and how to move between them.

Why different systems exist

The decimal system (base 10) is the one we use daily. Computers work in binary (base 2: only 0 and 1) because their circuits have two states. Hexadecimal (base 16) is a compact way to write binary: each hex digit equals 4 bits.

How counting works in each base

DecimalBinaryHexadecimal
101010A
151111F
161000010
25511111111FF

Converting step by step

To go from decimal to binary, divide by 2 repeatedly and read the remainders bottom-up. To go from binary to hexadecimal, group the bits in fours from the right and translate each group. For example, 11111111 → 1111 1111 → FF.

Convert between hexadecimal, binary, octal and decimal instantly.

Hex-binary converter →