How to use the prime number checker
- Select the mode: Check if prime, Prime factorization, or List primes up to N.
- Enter the number you want to test, or the upper limit for generating a list.
- The result updates instantly as you type.
- For factorization, read the output as base and exponent pairs, such as
2^3 x 3^2.
How the primality test works
A prime number is a whole number greater than 1 that has no positive divisors other than 1 and itself. To check if a number n is prime, the algorithm tests divisibility by every integer from 2 up to the square root of n. If none divide evenly, the number is prime.
For example, to test 97: the square root of 97 is about 9.85, so we check divisors 2, 3, 4, 5, 6, 7, 8, and 9. None of these divide 97 without a remainder, confirming it is prime. Testing only up to the square root makes this prime number checker fast even for values in the millions.
What is a prime number?
A prime number is a whole number greater than 1 whose only positive divisors are 1 and itself. The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23 and 29. A whole number greater than 1 that is not prime is called composite, because it can be split into smaller factors: 12 = 3 x 4, for example.
Two details trip people up. The number 2 is prime (and the only even prime), and the number 1 is neither prime nor composite. The number 0 is not prime either: it is divisible by every nonzero integer, so it has far more than two divisors.
Worked examples: is 91 prime?
The quick answer for 91 is no: 91 = 7 x 13. It looks prime because it is not divisible by 2, 3 or 5, which is why it is a classic trick question. Using the square-root rule, the square root of 91 is about 9.54, so you only need to test 2, 3, 5 and 7, and 7 divides it exactly.
These numbers are often guessed wrongly. Each result below comes from this checker's factorize mode:
| Number | Prime factorization | Answer |
|---|---|---|
| 91 | 7 x 13 | Not prime |
| 51 | 3 x 17 | Not prime |
| 87 | 3 x 29 | Not prime |
| 119 | 7 x 17 | Not prime |
| 143 | 11 x 13 | Not prime |
| 221 | 13 x 17 | Not prime |
| 1001 | 7 x 11 x 13 | Not prime |
| 97 | 97 | Prime (no divisor from 2 to 9) |
Quick divisibility checks save time: a number is divisible by 3 when its digit sum is divisible by 3 (5 + 1 = 6, so 51 = 3 x 17), by 5 when it ends in 0 or 5, and by 11 when the alternating digit sum is a multiple of 11 (1 - 4 + 3 = 0, so 143 = 11 x 13).
Understanding prime factorization
Every integer greater than 1 can be expressed as a product of prime numbers. This is called prime factorization, and the Fundamental Theorem of Arithmetic guarantees that the factorization is unique regardless of the order of the factors.
To factorize 360, repeatedly divide by the smallest possible prime:
- 360 / 2 = 180
- 180 / 2 = 90
- 90 / 2 = 45
- 45 / 3 = 15
- 15 / 3 = 5
- 5 / 5 = 1
The result is three 2s, two 3s, and one 5, written as 2^3 x 3^2 x 5. When you use the factorize mode, the tool performs exactly this trial division process.
Reference table of small primes
Memorizing the first few primes helps with mental math and quick checks. Here are the prime numbers up to 100:
| Range | Prime numbers |
|---|---|
| 1 to 20 | 2, 3, 5, 7, 11, 13, 17, 19 |
| 21 to 50 | 23, 29, 31, 37, 41, 43, 47 |
| 51 to 100 | 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 |
Notice that 2 is the only even prime. Every other even number is divisible by 2, so no even number above 2 can be prime. After 5, all primes end in 1, 3, 7, or 9.
Prime numbers from 1 to 100 by decade
There are 25 prime numbers below 100. Grouped by decade, with the count in each group:
| Range | Primes | Count |
|---|---|---|
| 1 to 9 | 2, 3, 5, 7 | 4 |
| 10 to 19 | 11, 13, 17, 19 | 4 |
| 20 to 29 | 23, 29 | 2 |
| 30 to 39 | 31, 37 | 2 |
| 40 to 49 | 41, 43, 47 | 3 |
| 50 to 59 | 53, 59 | 2 |
| 60 to 69 | 61, 67 | 2 |
| 70 to 79 | 71, 73, 79 | 3 |
| 80 to 89 | 83, 89 | 2 |
| 90 to 99 | 97 | 1 |
The first 50 primes, which end at 229, are: 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, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229. For longer lists, switch the tool to list mode, or open the prime numbers list tool.
Generating a prime numbers list
When you need a full list of primes up to a certain limit, the tool uses the Sieve of Eratosthenes. This ancient algorithm starts by assuming every number from 2 to N is prime, then iteratively marks the multiples of each discovered prime as composite.
For N = 30, the sieve crosses out multiples of 2 (4, 6, 8...), then multiples of 3 (9, 15, 21...), then 5 (25). What remains is the complete prime numbers list: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29. The sieve is far more efficient than testing each number individually when generating large lists.
How many primes are there below 10, 100, 1,000 and more?
Primes thin out slowly as numbers grow. The counts below are exact values of the prime counting function, often written pi(N):
| Up to N | Number of primes | Share of numbers that are prime |
|---|---|---|
| 10 | 4 | 40.00% |
| 100 | 25 | 25.00% |
| 1,000 | 168 | 16.80% |
| 10,000 | 1,229 | 12.29% |
| 100,000 | 9,592 | 9.59% |
| 1,000,000 | 78,498 | 7.85% |
| 10,000,000 | 664,579 | 6.65% |
The last row matches this tool's checking limit of 10,000,000: about one number in fifteen up to that limit is prime.
Common mistakes and edge cases
Several misconceptions trip people up when working with primes:
- 1 is not prime. By definition, a prime must have exactly two distinct divisors. The number 1 has only one divisor, so it is excluded.
- 0 and negative numbers are not prime. Primality applies only to integers greater than 1.
- Large gaps exist. Primes become less frequent as numbers grow. Between 113 and 127 there are no primes at all, a gap of 14.
- Not all odd numbers are prime. Numbers like 9, 15, 21, and 25 are odd but composite.
This prime number checker handles all these edge cases correctly, returning clear results whether you ask "is it prime" for 1, 0, or a large composite number.
Why primes matter
Prime numbers are the building blocks of arithmetic, but their importance extends well beyond the classroom. Modern cryptography relies on the difficulty of factoring the product of two very large primes. Protocols like RSA secure web traffic, banking transactions, and digital signatures by using keys derived from prime factorization.
In computer science, hash tables often use prime-sized arrays to distribute keys evenly and reduce collisions. Random number generators also incorporate primes to ensure long periods before sequences repeat. Whether you are studying number theory or debugging software, knowing how to quickly determine if a number is prime is a practical skill.
Worked examples
| Example | Input | Result |
|---|---|---|
| Is 97 prime? | Mode: check; Number: 97 | Is it prime?: Yes; Number: 97; Divisible by: Only 1 and itself |
| Factorize 360 | Mode: factorize; Number: 360 | Prime factorization: 2^3 x 3^2 x 5; Number: 360; Is it prime?: No |
| Primes up to 50 | Mode: list; Upper limit (N): 50 | Count: 15; Smallest prime: 2; Largest prime: 47; Upper limit (N): 50 |
| Is 1 prime? | Mode: check; Number: 1 | Is it prime?: No; Number: 1; Divisible by: Only 1 |
FAQ
Is 1 a prime number?
No. A prime number must have exactly two distinct positive divisors: 1 and itself. Since 1 only has one divisor, it is classified as neither prime nor composite.
What is the largest known prime?
As of late 2024, the largest known prime is the Mersenne prime 2^136,279,841 - 1, which has 41,024,320 decimal digits (found in October 2024). This tool limits inputs to 10,000,000 for checking and 100,000 for listing so results stay instant.
How do I read the prime factorization output?
The output uses caret notation for exponents. For example, 2^3 x 5 means 2 multiplied by itself 3 times (which is 8), then multiplied by 5, giving 40.
Can negative numbers be prime?
No. The standard definition of prime numbers applies only to positive integers greater than 1. Negative numbers, zero, and fractions are not considered prime.
Why does the list mode have a limit of 100,000?
Generating a prime numbers list requires memory proportional to the limit. Capping at 100,000 ensures the tool stays fast and responsive in any browser without freezing the page.
Is 2 the only even prime number?
Yes. Every other even number is divisible by 2, meaning they have at least three divisors (1, 2, and themselves), which disqualifies them from being prime.
Is 91 a prime number?
No. 91 = 7 x 13, so it has divisors other than 1 and itself. It is a common mistake because 91 is odd and not divisible by 3 or 5.
Is 0 a prime number?
No. Prime numbers are whole numbers greater than 1. Zero is divisible by every nonzero integer, so it does not have exactly two divisors.
What is a prime number in simple words?
A prime number is a whole number above 1 that can only be divided evenly by 1 and by itself. 7 is prime because nothing except 1 and 7 divides it; 8 is not, because 2 and 4 divide it.
How many prime numbers are there between 1 and 100?
There are 25: 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.
What are the first 10 prime numbers?
The first ten primes are 2, 3, 5, 7, 11, 13, 17, 19, 23 and 29.
Is 51 prime?
No. 51 = 3 x 17. The digits 5 and 1 add up to 6, which is divisible by 3, so 51 is divisible by 3.