Everything Is Bits
At the very bottom, a computer is millions of tiny switches that are either on or off. Everything else โ numbers, text, photos, this page โ is built from those two states.
Computers can feel like magic, but underneath they're astonishingly simple: millions of tiny switches, each either on or off. That's it. Every number, word, photo, song and program is ultimately a pattern of these on/off states. This session starts at the very bottom - the bit - and shows how two states are enough to build everything.
One switch, two states
A bit is a single switch: on or off, which we write as 1 or 0. One bit isn't much - but line several up and the combinations multiply fast.
| Bits | Different patterns | Can represent |
|---|---|---|
| 1 bit | 2 | on/off, yes/no |
| 2 bits | 4 | 0-3 |
| 8 bits (a byte) | 256 | 0-255, or one character |
| 32 bits | ~4 billion | big numbers, colours |
Each bit you add doubles the possibilities. Eight bits - a byte - gives 256 combinations, enough for a number 0-255 or a single letter. This doubling is why computers count in powers of two (256, 1024, ...).
Why binary, and how it counts
Computers use binary (base 2) because a switch has two states - on and off are easy to build reliably out of electronics. Counting works just like our everyday numbers, but with only two digits.
101010 in binary is 32 + 8 + 2 = 42. That's the whole trick - and the stack's larzbase shows this place-value breakdown for any number, while larzbits lets you see bits being flipped.The foundation of everything
- A bit is one switch - on (1) or off (0).
- More bits = more combinations, doubling with each bit added.
- Binary is counting with two digits; each place is worth double the last.
- Everything - numbers, text, images - is built from these bits.
๐งฉ Do it with LarzOS
Turn this lesson into action with the exact free tools and AI workflows for the job:
๐ฏ Key takeaways
- At the bottom, a computer is millions of switches, each on (1) or off (0) - a bit.
- Each bit added doubles the combinations; 8 bits (a byte) give 256, enough for a character.
- Binary is just counting with two digits - each place worth double the one to its right.
- Everything a computer handles is ultimately a pattern of these bits.
Frequently asked
Why do computers use binary instead of our normal base-10 numbers?
It comes down to what's easy and reliable to build physically. A computer is made of electronic components, and it's far simpler and more dependable to make a component that's clearly in one of two states - like a switch that's on or off, or a voltage that's high or low - than one that reliably distinguishes ten different levels. Two states are easy to tell apart even with electrical noise and manufacturing variation, so they're robust. Since the hardware naturally has two states, it makes sense to represent everything with two digits (0 and 1), which is binary. Base 10 feels natural to us because we have ten fingers, but there's nothing special about it for a machine - and building reliable ten-state electronics would be much harder and more error-prone. So binary isn't a limitation the designers were stuck with; it's the sweet spot of simple, reliable and fast.
If it's all just 1s and 0s, how can a computer show a photo or play music?
The key idea is that bits don't mean anything on their own - meaning comes from how we agree to interpret them. The same byte 01000001 might be the number 65, the letter 'A', or part of a colour, depending on the context the program treats it as. For a photo, we agree that the image is a grid of tiny dots (pixels), and each pixel's colour is stored as numbers (how much red, green and blue), which are stored as bits. For music, we measure the sound wave's height thousands of times a second and store each measurement as a number, again as bits. So a photo is millions of colour-numbers and a song is thousands of height-numbers, all encoded in binary. The magic isn't in the bits themselves - it's in the shared conventions (formats) that say 'these bits mean a red pixel' or 'this number is the sound level right now'. The next session goes deeper into how different kinds of data get encoded.
Related lessons
How Data Is Stored
Numbers, text, images, sound โ all of it becomes bits by agreeing on a code. Understandingโฆ
How Computers WorkWhat a CPU Actually Does
The CPU is the computer's engine โ and what it does is surprisingly humble: fetch a tiny iโฆ
Data Structures & AlgorithmsWhy Data Structures Matter
How you store data decides how easy - and how fast - everything else becomes. Choosing theโฆ