BitLab

Learn the secret language of computers

Bits are tiny light switches

A computer only understands two things: ON and OFF. One switch is called a bit. Eight bits together make a byte — and a byte can store a number. Try it: click the switches!

Decimal
0
Hex
00
ASCII
NUL
Flip some switches to make a number…

It works just like decimal — but doubling instead of ×10

You already know place-value columns from normal numbers: units, tens, hundreds. Each column is worth 10× more. Binary is the same idea, but each column is worth more: units, twos, fours, eights…

These tables show your lightbulb number from above — flip the switches and watch both sides follow!

Decimal — powers of 10

10²10¹10⁰
hundredstensunits
000

0 = 0×100 + 0×10 + 0×1

Binary — powers of 2

2⁷2⁶2⁵2⁴2⁰
128s64s32s16seightsfourstwosunits
00000000

00000000 = 0

Hex — powers of 16

Same trick a third time — each column is worth 16× more. A whole byte fits in just two hex digits!

16¹16⁰
sixteensunits
00

00 = 0×16 + 0×1 = 0

💡 Reading trick: write the column values above the bits (128, 64, 32, 16, 8, 4, 2, 1), then just add up the columns where the bit is 1.

Powers of 2 — worth memorising!

These numbers appear everywhere in computers (ever noticed games and phones use 256, 512, 1024…?). Hover over a number to see it as a square of dots!

2⁰2⁴2⁵2⁶2⁷2⁸2⁹2¹⁰
12481632641282565121024

With 8 bits you can make every number from 0 (all OFF) to 255 (all ON). That's why so many computer things stop at 255!