- Home
- Technology
- How a computer works
How a computer works
What is going on inside a laptop or phone, from a click to a result on the screen.
The short version
A computer follows instructions very quickly. Its processor runs billions of clock cycles a second, though a cycle is not the same as one instruction. Memory holds current work; storage keeps files when the power is off. Software tells the machine what to do.
I always assumed a computer understood what I asked it to do.
It understands nothing. It follows tiny steps, very quickly, without ever knowing why.
Fast enough to look like understanding.
Hardware and software
Hardware is the parts you could drop on your foot: the processor, memory, storage, screen, keyboard. Software is the instructions: the programs, the apps and the operating system that manages them.
Neither is useful alone. A laptop with no software is a pile of parts, and software with nothing to run on is only text.
The parts that matter

At the centre is the processor, which does the work. It takes instructions and data from memory, which is fast but forgets everything when the power goes off. Longer-term files live on storage, which is slower but keeps them. Screens, keyboards and the rest let you talk to the machine.
Your phone is the same design in a smaller box, with a screen that is also the keyboard.
What happens when you click
You click a button. The operating system notices and tells the program that you did. The program runs some instructions, which may fetch data from storage into memory, work on it, and send some of it to the screen. The screen updates.
All of that takes a few thousandths of a second. A useful simplified model is that the processor fetches an instruction, decodes it and executes it. Modern processors run billions of clock cycles a second, but can complete multiple instructions in one cycle or take several cycles for one instruction. What a processor does looks at it more closely, and memory and storage explains why there are two kinds.
Everything is numbers
Inside the machine, everything is stored as numbers: text, photos, music, even the programs. And each number is stored as patterns of on and off, which is called binary. A photo is a very long list of numbers saying how bright each dot is. The same machine can play music and run a spreadsheet because it only ever shuffles numbers; what the numbers mean is decided by the program.
Billions
The number of tiny switches, called transistors, in a modern processor. Each is only a few billionths of a metre across.
A computer with a faster processor is always faster to use.
Speed also depends on memory, storage, and what you ask it to do. A slow disk or too little memory can hold back a very fast processor.
The operating system is itself software, but it starts early and manages the other programs. It handles the shared hardware so apps do not each need their own controls for every screen or disk.
What an operating system does
An operating system, such as Windows, macOS, Android or iOS, is the software that runs first. It shares out the processor's time between the programs, gives each its own part of memory, keeps them from interfering with each other, and handles the screen, keyboard, files and network on their behalf.
Without it, every program would have to know how to talk to every kind of screen and disk. With it, a program asks for a file, and the operating system works out how.
Key takeaways
- A computer follows instructions very quickly.
- The processor works; memory holds; storage keeps.
- Software is the instructions.
- Everything inside is numbers.
- Speed depends on the whole machine.
Now you know.
A computer follows tiny instructions.
It does so billions of times a second.
Everything it handles is numbers.
Last reviewed 3 Nov 2026
Where next?
Explained further by
-
Read
Technology
Binary
What binary is, how ones and zeros can store numbers, text and pictures, and why computers use two digits…
-
Read
Technology
Memory vs storage
The difference between a computer's memory (RAM) and its storage: speed, size, what happens when the power…
-
Read
Technology
What a processor does
What a processor does: it fetches instructions, works out what they mean and carries them out billions of…
More in Technology
-
Read
Technology
Artificial intelligence
What AI means today: software that learns patterns from examples instead of following written rules, and…
-
Read
Technology
Fingerprint and face unlock
How fingerprint and face unlock work: a scan becomes a pattern of numbers kept on the phone and compared each…
-
Read
Technology
Bluetooth
How Bluetooth uses short-range radio to connect headphones, keyboards and speakers, why pairing is needed…