Some numbers can be split into smaller equal groups. A few stubborn ones simply refuse. Those are the primes β and every other number is built from them. Let's hunt them down together.
Let's goTake a number like 7. Try to split 7 things into smaller equal groups β 2s, 3s, 4s β and you always end up with an awkward leftover. The only way that comes out perfectly even is 1 group of 7, or 7 groups of 1. That's it. Because 7 can be divided cleanly by only two numbers β itself and 1 β we call it prime.
Now try 8. You can split it: 2 groups of 4, or 4 groups of 2. So 8 has extra ways to break apart, which means it is not prime. That single difference β exactly two factors, or more than two β is the whole game. By the end of this page you'll be able to look at any number and feel, almost instantly, whether it's one of the indivisible ones.
A factor of a number is a whole number that divides into it perfectly, with nothing left over. So 3 is a factor of 12, because 12 Γ· 3 = 4 exactly. (The flip side: 12 is a multiple of 3 β it's what you land on when you skip-count 3, 6, 9, 12.) Here's the lovely part: factors are really about rectangles. If you have a pile of square tiles, the ways you can arrange them into a neat rectangle are exactly its factor pairs. Drag the slider and watch which rectangles each number can make.
A number with lots of rectangles has lots of factors. A prime can only ever be laid out as one long single-row strip β a 1 Γ n line β because there's no other way to split it evenly. Try 12, then try 13, then 17. Watch the rectangles vanish.
Did you spot it? Numbers like 12, 16, and 24 are generous β they fold into several different rectangles, so they have several factors. But 13, 17, 19, and 23 are mean about it: the only rectangle they'll allow is the boring 1-across strip. That stubbornness is the visual signature of a prime. When a number refuses to make any rectangle except 1 Γ itself, it has exactly two factors, and that is precisely what makes it prime.
Now we can say it precisely. A prime number is a whole number bigger than 1 that has exactly two factors: 1 and itself. A number with more than two factors is called composite β "composite" just means "made of parts," because you can compose it by multiplying smaller numbers together. So 7 is prime (factors: 1, 7) and 8 is composite (factors: 1, 2, 4, 8). Pick a number below and the machine will hunt down every factor pair and count them for you.
Slide all the way up and try the sneaky ones. Is 91 prime? It looks like it should be β it's odd and ends in 1 β but the machine finds 7 Γ 13 hiding inside. That's why we need a reliable method, not just a hunch. Which brings us to the most famous prime-hunting trick of all time.
More than 2,000 years ago, a Greek thinker named Eratosthenes invented a beautifully simple way to catch every prime at once β like sifting flour to leave only the lumps behind. The idea: the smallest number that's still glowing must be prime, so you keep it, then cross out all of its multiples, because each of those is divisible by it and so can't be prime. Repeat with the next glowing number, and again, and again. When you're done, only the primes are left shining.
Play it yourself: click the smallest glowing number (it's ringed for you) to keep it as a prime and grey out its multiples β or press the buttons to step through. Watch the composites fall away.
Notice the rhythm: you only ever have to sift with the small primes. Once you've crossed the multiples of 2, 3, 5, and 7, everything still glowing up to 100 is automatically prime β there's no smaller number left that could divide it. There are exactly 25 primes between 1 and 100. Count the survivors!
Why does crossing out multiples work so perfectly? Because a multiple of 2 (like 6) can be split into 2 equal groups, so 2 is a factor of it β which means it already has more than two factors and can't be prime. The same is true for every multiple of every prime. By sweeping away all the multiples, you sweep away every composite number, and the only things that can possibly survive the sieve are numbers with no smaller factors at all. That's a prime, by definition. Eratosthenes turned a vague hunt into a guaranteed machine.
This one trips up almost everyone, so let's be careful. Remember the rule: a prime needs exactly two factors, 1 and itself. Now look at the number 1. Its only factor isβ¦ 1. That's itself and 1 rolled into the same single number β so 1 has only one factor, not two. It fails the test. The number 1 isn't a prime, and it isn't composite either; it sits in a category all its own, sometimes called the unit.
That might feel like a fussy technicality, but there's a real reason mathematicians are strict about it, and it connects to the big idea of this whole page. We're about to see that every number is built from primes in exactly one way. If 1 were allowed to be prime, that would fall apart: you could write 6 as 2 Γ 3, or 1 Γ 2 Γ 3, or 1 Γ 1 Γ 2 Γ 3, and on forever, because multiplying by 1 changes nothing. Each number would have endless different "recipes." By keeping 1 out of the prime club, every number gets one clean, unique recipe. So 1 isn't being punished β it's being kept out of the way so the building blocks stay tidy.
1 has only one factor, so it can't have exactly two. It's the unit β the thing you build with, not a building block itself.
Here's a fact that sounds like a riddle: out of the infinitely many even numbers, exactly one of them is prime, and it's the very first one β 2. Every other even number (4, 6, 8, 10, 100, a millionβ¦) can be split into 2 equal groups, which means 2 is a factor of it. And if 2 is a factor as well as 1 and itself, that's already three or more factors, so it can't be prime. Being even is, quite literally, a guarantee of having a spare factor.
So why does 2 itself escape the trap? Because when you split 2 into 2 equal groups, you get 1 in each group β and the "2" doing the dividing is the number itself. Its factors are just 1 and 2: exactly two of them. So 2 squeaks through. It's the lonely even number in an endless crowd of odd primes, which is why mathematicians fondly call 2 "the oddest prime of all." After 2, every single prime β 3, 5, 7, 11, 13, 17 β is odd, because any even candidate is instantly disqualified by that sneaky factor of 2.
Here's the reason primes matter so much. Take any composite number and keep breaking it into smaller factors. Break 12 into 2 Γ 6, then break the 6 into 2 Γ 3. Now you're stuck β 2 and 3 are primes, so they can't break any further. You've hit bedrock: 12 = 2 Γ 2 Γ 3. Every composite number works this way. It can be written as a multiplication of primes, and β this is the magic β there's only one way to do it (apart from the order). Mathematicians call those primes its prime factors. Pick a number and watch it crumble into its blocks.
Think of primes like the chemical elements and composite numbers like molecules. Just as water is always exactly two hydrogens and one oxygen, the number 60 is always exactly 2 Γ 2 Γ 3 Γ 5 β no other combination of primes will ever make it. This "one number, one recipe" rule is so important it has a grand name: the Fundamental Theorem of Arithmetic. It's why primes deserve to be called the atoms of the number world.
Notice what happens when you slide the machine to a prime, like 23 or 29. It can't break down at all β it just reports itself, because it is already a building block. That's the deepest way to understand a prime: it's a number that can't be made by multiplying smaller numbers together. It's a starting piece. Everything else in the entire number system is just primes, stacked and combined in different amounts, the way every object around you is built from a handful of elements.
No matter how far you count, you will never run out of primes. There is always another one waiting further along the number line.
This isn't a guess β it was proven over 2,000 years ago by a Greek mathematician named Euclid, with an argument so clean it's still taught today. So the list 2, 3, 5, 7, 11, 13, 17, 19, 23β¦ simply never stops. There is no biggest prime, and there never will be.
But here's the twist that makes them fascinating: even though primes never end, they get rarer and rarer the higher you climb. Among the first 10 numbers there are 4 primes. Among the first 100, there are 25. Among the first 1,000, only 168. They spread out and grow lonelier as numbers get bigger β yet they never thin all the way to nothing. They keep appearing, scattered and unpredictable, forever. Mathematicians have searched for a simple pattern that says exactly where the next prime will land, and after thousands of years, nobody has found one. The primes stay just a little bit wild.
You might think such pure, abstract numbers would stay locked inside maths books. They don't. The wildness of primes turns out to be enormously useful β especially for keeping secrets. The codes that protect your messages, passwords, and payments online lean on a simple lopsided fact about primes: multiplying two of them together is easy, but tearing the answer back apart is fiendishly hard.
When the numbers are tiny, like 91, you can crack it in a few seconds with the factor machine above. But pick two gigantic primes β each hundreds of digits long β and multiply them, and the result is a number so colossal that even the fastest computers on Earth would need longer than the age of the universe to find the two primes hiding inside. Anyone who knows the original primes can unlock the message instantly; anyone who doesn't is stuck. So the "one number, one recipe" rule you played with becomes a lock and key. Every time you see a little padlock in your browser, primes are quietly standing guard.
Big primes multiplied together make locks that are easy to close but almost impossible to pick.
Some insects emerge every 13 or 17 years β prime numbers β which helps them dodge predators' cycles.
Primes are the atoms of arithmetic, so they sit at the heart of some of maths' oldest unsolved riddles.
This is the single most common mix-up about primes, and it's an easy one to fall into β because the first few odd numbers (3, 5, 7) really are prime, so it feels like a rule. It isn't. Here's why, plus its mirror-image mistake.
Being odd just means a number isn't divisible by 2 β it says nothing about being divisible by 3, or 5, or 7. The very next odd number after 7 breaks the spell: 9 = 3 Γ 3, so 9 is odd but composite. So are 15 = 3 Γ 5, 21 = 3 Γ 7, 25 = 5 Γ 5, and the sneaky 91 = 7 Γ 13. Plenty of odd numbers have a hidden factor lurking in them. Odd is necessary for a prime bigger than 2, but it is nowhere near enough. Run any of these through the test machine above and watch the extra factors appear.
So close β but there's one exception, and you've already met it: 2. It's even, and it's prime. Every other prime is odd, because any bigger even number has 2 as a spare factor. So the honest version of the rule is: "all primes except 2 are odd." The lonely little 2 is the one that keeps every neat statement about primes honest.
For 1, "itself" is 1 β they're the same number β so it has only one factor in total, not the two a prime needs. That's why 1 is the unit, not a prime. Keeping it out is what lets every number have a single, tidy prime recipe.
A prime divides cleanly by only 1 and itself β so 7 is prime, 8 isn't. Just one rectangle: 1 Γ n.
Every other number is made by multiplying primes, in exactly one way. Primes are the atoms of arithmetic.
They never run out, they thin out as you climb, and they follow no simple pattern β which makes them powerful.