What Is a Prime Number? A Clear Guide With Examples
By Shihab Mia July 6, 2026 7 min read
Quick answer
A prime number is a whole number greater than 1 that has exactly two distinct positive divisors: 1 and itself. The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29. To check any number, try dividing it by every whole number from 2 up to its square root. If nothing divides it evenly, it is prime.
Prime numbers sound like an abstract math-class topic, but they are one of the most practical ideas in all of mathematics. They are the atoms of the number system: every whole number above 1 is either prime itself or can be built by multiplying primes together. That single fact is why primes matter for everything from splitting a bill evenly to the encryption that protects your online banking.
This guide gives you the exact definition, shows you the primes you need to know, and walks through a reliable step-by-step method for testing any number by hand. If you just want an instant answer for a specific number, the prime number calculator near the end does the checking for you.
What is a prime number, exactly?
A prime number is a whole number greater than 1 whose only positive divisors are 1 and the number itself. In other words, it cannot be evenly divided by any other whole number without leaving a remainder. Because of this, a prime has exactly two factors, no more and no fewer.
Take 7 as an example. The only whole numbers that divide 7 evenly are 1 and 7. Nothing else fits, so 7 is prime. Now look at 8: it can be divided by 1, 2, 4 and 8. Because it has factors beyond just 1 and itself, 8 is not prime.
The word "divisor" and the word "factor" mean the same thing here: a whole number that divides evenly with no remainder. A prime has precisely two of them.
The first prime numbers you should know
Memorizing the first handful of primes makes mental math faster. Here are the primes below 30, followed by the reason a few nearby numbers are excluded.
- Primes under 30: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29
- 2 is the only even prime. Every other even number is divisible by 2, so it automatically has a third factor.
- Numbers like 4, 6, 8, 9 and 10 are composite, meaning they have more than two factors.
A quick pattern to notice: apart from 2 and 5, every prime ends in 1, 3, 7 or 9. That is because any number ending in 0, 2, 4, 6 or 8 is divisible by 2, and any number ending in 0 or 5 is divisible by 5.
Prime vs composite: a quick reference
| Number | Divisors | Prime or composite? |
|---|---|---|
| 1 | 1 | Neither (only one divisor) |
| 2 | 1, 2 | Prime (the only even prime) |
| 3 | 1, 3 | Prime |
| 4 | 1, 2, 4 | Composite |
| 9 | 1, 3, 9 | Composite |
| 11 | 1, 11 | Prime |
| 15 | 1, 3, 5, 15 | Composite |
| 17 | 1, 17 | Prime |
Why is 1 not a prime number?
The number 1 is not prime because it has only one divisor, itself, while a prime must have exactly two distinct divisors. Since 1 fails that two-divisor test, mathematicians classify it as neither prime nor composite.
There is also a deeper reason. Every whole number above 1 has a single, unique way of being written as a product of primes, a result called the fundamental theorem of arithmetic. If 1 counted as prime, that uniqueness would break, because you could keep multiplying by 1 forever (6 = 2 x 3 = 2 x 3 x 1 x 1...). Excluding 1 keeps the whole system tidy.
Prime vs composite numbers
Every whole number greater than 1 falls into exactly one of two camps. A prime has exactly two factors. A composite number has three or more factors, meaning it can be broken down into smaller whole-number pieces. The number 1 sits outside both groups.
Composite numbers can always be expressed as a product of primes. For example, 12 = 2 x 2 x 3, and 45 = 3 x 3 x 5. Breaking a number down this way is called prime factorization, and if you need it for larger numbers you can use a prime factorization calculator or work out shared factors with a GCD calculator.
How to check if a number is prime
To test whether a number is prime, divide it by every whole number from 2 up to the square root of that number. If none of them divide evenly, the number is prime. You stop at the square root because if a number had a factor larger than its square root, it would also have a matching factor smaller than the square root, which you would already have found.
Here is the method applied to 97, worked out step by step.
- Find the square root of 97. It is about 9.8, so you only need to test divisors from 2 up to 9.
- Divide by 2: 97 is odd, so no.
- Divide by 3: the digits 9 + 7 = 16, which is not divisible by 3, so no.
- Divide by 5: 97 does not end in 0 or 5, so no.
- Divide by 7: 7 x 13 = 91 and 7 x 14 = 98, so 97 is not a multiple of 7.
- You can skip 4, 6, 8 and 9 because they are covered by 2 and 3. Nothing divided evenly, so 97 is prime.
A time-saving shortcut: after checking 2, you only ever need to test odd divisors, because any even divisor would mean the number was already divisible by 2. This roughly halves your work. For a quick refresher on square roots, our guide on how to find the greatest common factor covers the same factor-hunting logic from a different angle.
Are there infinitely many primes?
Yes. There are infinitely many prime numbers, a fact proved by the ancient Greek mathematician Euclid around 300 BCE. No matter how large a prime you find, there is always a bigger one waiting.
Euclid's argument is elegant: suppose you had a complete list of all primes. Multiply them all together and add 1. This new number is not divisible by any prime on your list (there is always a remainder of 1), so either it is a brand-new prime or it has a prime factor you missed. Either way, your "complete" list was not complete, which proves the primes never run out.
Primes thin out as numbers get larger, but they never stop appearing. This endless supply is exactly what makes them so useful in cryptography, where the security of systems like RSA relies on the difficulty of factoring the product of two very large primes.
Common mistakes and good to know
A few misconceptions trip people up again and again. Watch for these.
- Calling 1 prime. It has only one divisor, so it is neither prime nor composite.
- Thinking all odd numbers are prime. 9, 15, 21 and 25 are all odd but composite.
- Forgetting that 2 is prime. It is the smallest prime and the only even one.
- Testing divisors past the square root. It wastes time; once you pass the square root you have already found every possible factor.
- Assuming primes follow a simple formula. There is no known simple formula that generates all primes, which is part of why they remain a rich research topic.
Good to know: prime numbers show up well beyond the classroom. They power secure messaging and online payments, they help generate the pseudo-random numbers behind strong passwords, and they underpin error-checking codes used in barcodes and data storage. Understanding the basics here is the first step toward all of it.
If you enjoy this kind of number reasoning, you might also like our explainer on what is a logarithm, which unpacks another idea that looks intimidating but rests on a simple definition.
P Try the free tool Prime Number Calculator Free prime number calculator. Check if a number is prime, see its factorization and divisors, find the next and previous prime, or list every prime in a range.Prime numbers are simple to define but endlessly deep. Remember the core rule: a whole number greater than 1 is prime when its only divisors are 1 and itself. Keep the first ten primes handy, use the square-root trick to test by hand, and lean on the calculator above whenever you need a fast, certain answer.