Binary code
Writing everything, numbers, text, images, with only two symbols: 0 and 1.
Binary code is a way of representing information using only two symbols, 0 and 1. Computers use it because their hardware is built from billions of tiny switches, transistors, that are either on or off. Two states are easy to tell apart reliably, even when electrical signals are a bit noisy, so everything a computer stores or processes ends up as long strings of zeros and ones.
Binary numbers work like the decimal numbers you already know, just with two digits instead of ten. In decimal, each position is worth ten times the one to its right: ones, tens, hundreds. In binary, each position is worth twice as much: 1, 2, 4, 8, 16 and so on. So 1101 means one 8, one 4, no 2 and one 1, which adds up to 13.
Anything else is a matter of agreeing on a code. Text uses tables like ASCII or Unicode, where the capital letter A is the number 65, or 01000001. An image is a grid of pixels, each with numbers for its red, green and blue. A song is thousands of sound measurements per second. Even the programs themselves are binary: the instructions a CPU runs are patterns of bits that tell it what to do next.
Keep in mind
- Uses only two symbols, 0 and 1, matching switches that are off or on.
- Each binary position is worth double the one to its right: 1, 2, 4, 8…
- Text, images, sound and programs are all stored as binary.
- Codes like ASCII and Unicode decide which number means which character.