Number Bases: Binary, Hex & Decimal

Learn to convert between binary (base-2), hexadecimal (base-16), and decimal (base-10).

intermediatebinaryhexadecimalbase-conversionnumber-basescomputer-sciencehigh-schoolUpdated 2026-02-20

What is a Number Base?

A number base (or radix) tells you how many digits the system uses and what each position is worth.

BaseNameDigits Used
10Decimal0–9
2Binary0, 1
16Hexadecimal0–9, A–F

Decimal (Base 10)

You already know this one! Each position is a power of 10:

4 3 2
─────
4×10² + 3×10¹ + 2×10⁰
= 400 + 30 + 2
= 432

Binary (Base 2)

Each position is a power of 2:

Positions:  2³  2²  2¹  2⁰
Values:      8   4   2   1

Converting binary → decimal:

Example: 1011₂

1×8 + 0×4 + 1×2 + 1×1
=  8 +  0 +  2 +  1
= 11

Example: 1101₂

1×8 + 1×4 + 0×2 + 1×1
=  8 +  4 +  0 +  1
= 13

Quick reference — 4-bit patterns:

0000 = 0    0100 = 4    1000 = 8    1100 = 12
0001 = 1    0101 = 5    1001 = 9    1101 = 13
0010 = 2    0110 = 6    1010 = 10   1110 = 14
0011 = 3    0111 = 7    1011 = 11   1111 = 15

Hexadecimal (Base 16)

Uses digits 0–9 and letters A–F:

A = 10,  B = 11,  C = 12,  D = 13,  E = 14,  F = 15

Each position is a power of 16:

Example: 2F₁₆

2×16¹ + F×16⁰
= 2×16 + 15×1
= 32 + 15
= 47

Example: 1B₁₆

1×16 + 11×1
= 16 + 11
= 27

Binary ↔ Hex Shortcut

Every hex digit = exactly 4 binary bits:

Hex  Binary
 0   0000
 1   0001
 ...
 A   1010
 B   1011
 F   1111

Example: 3C₁₆ = 0011 1100₂

Adding in Binary

Use the same column addition as decimal, but carry when you reach 2:

  1 0 1 1   (11)
+ 0 1 1 0   ( 6)
─────────
  1 0 0 0 1  (17)

Rules: 0+0=0, 0+1=1, 1+1=10 (write 0 carry 1), 1+1+1=11 (write 1 carry 1)

Practice

What is 1010₂ in decimal?

What is 1111₂ in decimal?

What is 1F₁₆ in decimal?

What is 11001₂ in decimal?