Binary & Hexadecimal

Understand number systems — convert between binary, decimal, and hexadecimal with interactive tools.

Category: Math · v1.0.0
Step 1 of 4

Step 1: Number Systems

Computers store everything as binary (base 2) — just 0s and 1s. Developers also use hexadecimal (base 16) as a compact way to represent binary data.

Decimal (Base 10) — what you already know

Each digit is a power of 10:

Place 103 102 101 100
Value 1000 100 10 1
Example 1 3 5 7

1357 = (1 × 1000) + (3 × 100) + (5 × 10) + (7 × 1)

Binary (Base 2) — how computers think

Each digit (called a bit) is a power of 2. Only two digits: 0 and 1.

Place 27 26 25 24 23 22 21 20
Value 128 64 32 16 8 4 2 1
Example 1 0 1 0 1 0 1 0

10101010 = 128 + 32 + 8 + 2 = 170 in decimal

Hexadecimal (Base 16) — compact binary

Uses digits 0-9 and letters A-F (where A=10, B=11, C=12, D=13, E=14, F=15). Each hex digit represents exactly 4 bits.

Place 163 162 161 160
Value 4096 256 16 1
Example 1 A 3 F

0x1A3F = (1 × 4096) + (10 × 256) + (3 × 16) + (15 × 1) = 6719 in decimal

About This Lab

Computers think in binary (base 2), but developers often work with hexadecimal (base 16) too. In this lab, you'll learn how these number systems work, practice converting between them, and build intuition for how data is represented at the lowest level.

How It Works

  1. Read each step's explanation of number systems
  2. Use the interactive converter to experiment
  3. Practice bit manipulation visually
  4. Complete the quiz to test your understanding