What Is a Prime Number? A Clear Guide With Examples
By Shihab Mia July 6, 2026 8 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.
Every whole number above 1 is either prime itself or can be built by multiplying primes together, which is why primes are called the atoms of the number system. That single property is what makes them useful 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.
How do you find every prime number up to 100?
The fastest hand method is the Sieve of Eratosthenes: write out every number from 2 to 100, then cross out the multiples of each unmarked number, starting with 2. Whatever numbers survive uncrossed are prime. Using this method, there are exactly 25 primes between 1 and 100.
The sieve is named after the ancient Greek mathematician Eratosthenes and works by elimination instead of division. Rather than testing each number one at a time, you remove every multiple of each prime as you go, so whatever is left over must be prime.
- Write out every whole number from 2 to 100.
- Circle 2, the first prime, then cross out every multiple of 2: 4, 6, 8, 10 and so on.
- Move to the next number that is not crossed out, which is 3. Circle it, then cross out all its multiples: 6, 9, 12, 15 and so on.
- Repeat with 5, then with 7. Once you pass 10, the square root of 100, every remaining uncrossed number is automatically prime, so you can stop checking.
- Whatever numbers are left uncrossed are your primes.
Following those steps between 2 and 100 leaves exactly these 25 primes: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97.
The sieve is far faster than testing each number individually once you need every prime in a range rather than a single answer. For checking one specific number, the square-root division method above or the prime number calculator is simpler. For generating a full list, the sieve wins, and it is the same basic idea computers use to build large prime tables before running heavier tests on bigger numbers.
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.
Frequently asked questions
Is 2 a prime number?
Yes. 2 is prime because its only divisors are 1 and 2. It is also special as the only even prime number. Every other even number can be divided by 2, which gives it a third factor and makes it composite. So 2 is the smallest and the only even prime.
What is the smallest prime number?
The smallest prime number is 2. Although 1 is smaller, it is not prime because it has only one divisor. 2 is the first number to have exactly two distinct divisors, 1 and itself, which satisfies the definition of a prime. It is also the only even prime.
Is 1 a prime number?
No. The number 1 is not prime because a prime must have exactly two distinct divisors, and 1 has only one (itself). It is also not composite. Mathematicians classify 1 as a unit, sitting outside both categories, which keeps prime factorization unique for every other whole number.
What is the difference between prime and composite numbers?
A prime number has exactly two divisors: 1 and itself. A composite number has three or more divisors, meaning it can be broken into smaller whole-number factors. For example, 7 is prime while 8 is composite because 8 divides by 1, 2, 4 and 8. The number 1 is neither.
How do you quickly test if a large number is prime?
Divide the number by every whole number from 2 up to its square root. After checking 2, you only need to test odd divisors. If none divide evenly, the number is prime. For very large numbers this gets slow by hand, so an online prime number calculator is the fastest reliable option.
Why are prime numbers important?
Prime numbers are the building blocks of every whole number and cannot be broken down further. This makes them essential in cryptography, where the security of online banking and messaging depends on the difficulty of factoring large primes. They also appear in coding theory, random number generation and many areas of mathematics.
How many prime numbers are there between 1 and 100?
There are exactly 25 prime numbers between 1 and 100: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89 and 97. You can find them by hand with the Sieve of Eratosthenes, crossing out multiples of each prime starting with 2.
What is the largest known prime number?
As of the most recent widely reported record, the largest known prime is 2 raised to the power 136,279,841, minus 1, a Mersenne prime with over 41 million digits, found in October 2024 by the Great Internet Mersenne Prime Search (GIMPS) project. Because primes are infinite, a bigger one is always waiting to be found.