What Is an Algorithm? A Plain-English Guide
A calm, beginner-friendly guide to what an algorithm really is: a step-by-step recipe for solving a problem, from cooking to computers to your feed.

This morning I made tea. I filled the kettle, switched it on, dropped a teabag in a cup, waited for the water to boil, poured it over, let it sit for two minutes, took the bag out, and added a splash of milk. I didn't think of any of that as remarkable. But I had just followed an algorithm.
That word gets thrown around like it belongs only to engineers and tech companies. It doesn't. An algorithm is one of the plainest ideas in the world, dressed up in an intimidating costume. By the end of this article, I promise you'll see them everywhere, and you'll stop feeling shut out of conversations about "the algorithm."
The simplest possible definition
An algorithm is a precise, step-by-step set of instructions for accomplishing a task or solving a problem.
That's it. A recipe is an algorithm. So is the route your sat-nav reads out, the instructions for assembling flat-pack furniture, and the little dance you do every morning to get dressed. Each one is a sequence of steps that takes you from a starting point to a finished result.
The key word is precise. A good algorithm doesn't leave you guessing. "Make it nice" is not an algorithm. "Boil the water for three minutes, then pour" is. The steps have to be clear enough that someone, or something, can follow them without having to improvise.
I find it helpful to think about getting dressed. You put on underclothes, then a shirt, then trousers, then socks, then shoes. The order matters. You can't put your shoes on before your socks and expect a good outcome. An algorithm cares about what you do and in what order you do it.
Why computers love them
Here's the thing about computers: they are astonishingly fast and astonishingly literal. A computer will do exactly what you tell it, millions of times a second, and not one thing more. It has no common sense to fall back on. So if you want a computer to do something, you have to hand it an algorithm — a list of steps so exact that there's no room for "you know what I mean."
Two tasks come up so often that they're worth seeing up close, because they show you what algorithms actually do behind the screen.
Searching: finding a name in a list
Imagine a phone book with a million names, and you're looking for "Mallya." One algorithm is to start at the first page and check every single name until you hit yours. That works, but it could take a million checks.
A smarter algorithm uses the fact that the names are already sorted alphabetically. You open to the middle. Is "Mallya" before or after the name you landed on? If it's after, you ignore the entire first half and open to the middle of what's left. You repeat that, throwing away half the remaining names each time. A million names collapses to about twenty checks. Same problem, wildly different effort, just because of a cleverer set of steps.
Sorting: putting things in order
Sorting is the other workhorse. Putting names alphabetically, prices low to high, emails newest first. There are dozens of sorting algorithms, and one of the most intuitive is how many people sort a hand of playing cards: pick up the cards one at a time and slot each new card into its correct place among the ones you're already holding. Computers do versions of exactly this, billions of times a day, so that the search trick above can even work.
The same problem, a better recipe
Notice what happened in the phone-book example. Both approaches solved the problem. Both would find Mallya. But one took a million steps and the other took twenty. That gap is the whole reason computer scientists obsess over algorithms.
This is what people mean when they say one algorithm is "faster" or "more efficient." It's not about a faster computer. It's about a smarter sequence of steps that gets to the same answer with far less work. Run a clumsy algorithm on a powerful machine and it can still crawl; run an elegant one on a modest machine and it can fly.
Think of two routes to the same destination. Both get you there. But one weaves through every side street and traffic light, and the other takes the bypass. Same start, same finish, very different journey. With a handful of items, the difference doesn't matter. With a million items, the clumsy route might take hours and the clever one a heartbeat. As the pile of data grows, the choice of algorithm is often the difference between "instant" and "never finishes."
"The algorithm" that decides what you see
Now for the version of this word that probably brought you here. When people complain about "the algorithm" on social media, they're talking about something more involved, but it's built from the same idea.
Every time you open an app like a video platform or a social feed, there is far more content than you could ever look at. So the app runs an algorithm to decide, in a fraction of a second, what to put in front of you. It looks at signals: what you watched before, what you lingered on, what you liked, what people similar to you enjoyed, how long others stayed on a given post. Then it ranks everything and shows you what it predicts will hold your attention.
That's worth sitting with for a moment. The feed you see is not neutral, and it's not the whole world. It's a selection, ordered by a set of instructions someone designed to meet a goal. And that goal is usually to keep you watching, because more watching tends to mean more advertising revenue. None of that is sinister by itself. But "keep you here longer" is not the same goal as "show you what's true," or "show you what makes your life better." Knowing that a recipe is running quietly behind your feed is the first step to not being run by it.
How algorithms connect to AI
There's one more piece, because algorithms are also where artificial intelligence comes in, and the distinction is genuinely useful.
Everything I've described so far is a hand-written algorithm. A human sat down, thought hard about the problem, and wrote out the steps: do this, then this, then if that happens, do the other. The cleverness lives in the human who wrote the recipe.
Machine learning flips that around. Instead of a person writing every step, you show the system mountains of examples and let it work out its own rules from the patterns it finds. You don't tell it how to recognise a cat in a photo; you show it a million photos labelled "cat" and "not cat," and it figures out a recipe of its own. The result is still, deep down, an algorithm — a set of steps that turns an input into an output. The difference is who wrote the steps: a human, or the machine itself, learning from data. If you want the longer version, I wrote a whole piece on it: What Is Machine Learning?
Frequently asked questions
- Is an algorithm the same thing as a computer program?
- Not quite. An algorithm is the idea — the sequence of steps to solve a problem. A program is that idea written down in a specific programming language so a computer can run it. The same algorithm can be written as a program in many different languages, just as one recipe can be written in English, Swahili, or French.
- Do algorithms always involve maths?
- No. Many do, but the core idea is just ordered steps. Your morning routine and a recipe are algorithms with no maths at all. Maths shows up when the steps involve calculation or when we measure how efficient an algorithm is, but it isn't part of the definition.
- Why do people say one algorithm is 'faster' than another?
- Because two different sets of steps can solve the very same problem with wildly different amounts of work. Checking a million names one by one versus halving the list each time both find your name, but one takes a million steps and the other about twenty. 'Faster' usually means 'fewer steps as the data grows,' not 'runs on a quicker machine.'
- Can I change or escape the social media algorithm?
- You can't turn it off, but you can influence it. What you watch, search, follow, and skip are all signals it learns from, so deliberate choices reshape your feed over time. The bigger win is awareness: remembering that the feed is a curated selection built to hold your attention, not a neutral window onto the world.
- How is an algorithm different from AI?
- An algorithm is the broad idea of step-by-step instructions. Traditional algorithms have every step written by a human. AI, and specifically machine learning, is a kind of algorithm where the machine learns its own steps from examples instead of being told them. So AI is a special case of algorithms, not a separate thing.
Once the costume comes off, an algorithm is just a recipe — a clear set of steps to get something done. Some are written by people, some are learned by machines, and some are quietly deciding what shows up on your screen. The more you can name them, the less mysterious technology becomes, and the more agency you have inside it.
Further reading on this site
- What Is Machine Learning? — how machines learn their own rules instead of being handed them.
- How APIs Actually Work — the messengers that let software talk to software.
- Browse Education — more plain-English explainers like this one.
If these explainers help, subscribe to the newsletter and I'll send the next one straight to your inbox.
The Newsletter
Liked this essay?
Get the next one in your inbox. One thoughtful email a week, nothing more.
Keep reading
Related articles

What Is Machine Learning? A Plain-English Guide
A calm, beginner-friendly guide to machine learning: how computers learn from examples instead of rules, the three main types, and honest limits.
May 26, 2026 · 11 min read

What Is Cloud Computing? A Plain-English Guide
A calm, beginner-friendly guide to cloud computing: what the cloud really is, the everyday apps you already use, IaaS/PaaS/SaaS, and the honest tradeoffs.
April 30, 2026 · 10 min read

What Is Open Source Software? A Plain-English Guide
A calm, beginner-friendly guide to open source software: what it means, the free software you already use, licenses, and why it matters for your career.
April 14, 2026 · 10 min read