Searching for something, seeing a post you like on social media, getting a complicated task done with AI — an algorithm is working in every one of those. The word turns up constantly, usually as a complaint, and often with no agreed meaning attached.
The definition
An algorithm is the complete set of step-by-step instructions given to a computer to complete a specific task. It decides how a computer will analyse information, by what rules it will calculate, and how it will arrive at a solution.
The usual comparison is a recipe. A recipe lists ingredients and the steps in order; an algorithm lists the information needed and the rules for processing it to get a particular result.
What makes one valid
Not every set of instructions qualifies. An effective algorithm has to meet three conditions:
- Each instruction must be specific and unambiguous — no room for interpretation.
- The instructions must be things a computer can actually carry out.
- It must terminate. It cannot run indefinitely; after a finite number of steps it has to produce the result or stop.

That third condition is less obvious than it sounds and is the source of a great deal of real-world trouble: a procedure that never finishes is not a slow algorithm, it is not an algorithm at all.
The three stages
Every algorithm runs through input, processing and output. Information is taken in, it is processed, and the desired result comes out. That is the whole shape, from a two-line script to a model with a trillion parameters.
The families you will meet
Algorithms are classified by the kind of problem they solve. Four are used constantly in computer science:
- Sorting algorithms — putting things in order
- Search algorithms — finding one thing among many
- Recursive algorithms — solving a problem by solving smaller copies of itself
- AI and machine learning algorithms — deriving the rules from data rather than being given them
That last family is the one that broke the old intuition. A sorting algorithm does what its author wrote. A machine learning algorithm does what its training data implies, which is not something anyone wrote down and not always something anyone can read back.
Why the word matters
As technology use grows, so does the reach: product recommendations in e-commerce, route-finding in Google Maps, healthcare, finance — algorithms are working behind the screen in all of them.
Which is why "the algorithm decided" deserves a follow-up question. Someone chose the inputs, someone chose what counts as a good outcome, and someone can change both. The vagueness of the word is useful to whoever is using it.
Two words people mix up
An algorithm is not a program, and it is not a model. The distinction is small but it clears up most of the confused arguments.
An algorithm is the method — the steps, written in any language or none. A program is one implementation of a method in code that a particular machine will run. A model, in the machine learning sense, is the set of numbers produced by running a training algorithm over data; the algorithm is how it was made, the model is what came out.
So "the algorithm showed me this" is usually wrong even as a description. What showed you something was a ranking model, built by an algorithm, trained on data chosen by a company, optimising for a target that same company picked. Each of those four is a different place to put a question — and only the first one sounds like nobody is responsible.




