How to use the prime number generator
- Choose Generate Primes.
- Select By Count to generate a chosen number of primes starting from a particular value.
- Select By Range to find every prime between two numbers.
- Use Check a Number when you only want to test one number.
What is a prime number?
A prime number is a whole number greater than 1 with exactly two divisors: 1 and itself. 7 is prime because nothing besides 1 and 7 divides into it evenly. 8 isn't, because 2 and 4 divide into it too. 1 is a special case — it's neither prime nor composite, since it only has one divisor rather than two.
Prime Numbers Below 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, 97
Prime Numbers vs. Composite Numbers
While a prime number has only two factors (1 and itself), a composite number has more than two factors. For example:
- 11 is Prime: Factors are only 1 and 11.
- 12 is Composite: Factors are 1, 2, 3, 4, 6, and 12.
- 0 and 1 are Special Cases: Neither 0 nor 1 are considered prime or composite.
How to Check if a Number is Prime (Trial Division)
To determine whether a number N is prime, you do not need to test
every number up to N. It is enough to test divisibility by prime
numbers up to the square root of N.
-
Find the square root of the number. For example,
√67 ≈ 8.18. -
List the prime numbers less than or equal to that square root:
2, 3, 5, 7. -
Test whether
67is divisible by any of those primes. Since67is not divisible by2,3,5, or7, 67 is prime.
Why Are Prime Numbers Important?
Prime numbers are the fundamental building blocks of arithmetic—every integer greater than 1 is either a prime or can be factored into a unique product of primes (the Fundamental Theorem of Arithmetic). In modern technology, large prime numbers play an important role in public-key cryptography. RSA, for example, relies on the difficulty of factoring the product of two large prime numbers, helping secure online communications and transactions.
How this calculator works
Generating primes: by count or by range
"By Count" finds a specific number of primes starting from wherever you choose — the first 20 primes starting from 2 gives you 2 through 71; starting from 50 and asking for 10 gives you the first 10 primes at or above 50. "By Range" finds every prime between two values, such as every prime between 100 and 200. The range can go up to 1,000,000, and you can optionally limit how many primes are included in the generated list. The page displays at most 1,000 primes at once.
Checking a single number
The second tab tells you directly whether a number is prime. If it isn't, it shows the smallest number that divides into it evenly, so you can see exactly why it doesn't qualify rather than just taking the yes-or-no answer on faith.
Frequently asked questions
Is 0 a prime number?
No. 0 is not prime. Every nonzero integer divides 0 evenly, so 0 does not have exactly two positive divisors.
Is 1 a prime number?
No. By definition a prime number needs exactly two distinct divisors, and 1 only has one (itself). Mathematicians treat 1 as its own special case — neither prime nor composite.
Is 2 the only even prime number?
Yes. Every even number greater than 2 is divisible by 2 in addition to 1 and itself, which means it has at least three divisors — disqualifying it from being prime. 2 is the only exception, and the only even prime.
What's the largest number I can check?
1,000,000,000,000 (one trillion) on the Check a Number tab. Generating primes by count or range is capped lower — up to 10,000 primes at a time, or any range up to 1,000,000 — to keep results fast and the page readable.
Are all odd numbers prime?
No. While all primes greater than 2 are odd, not all odd numbers are prime. For example, 9, 15, 21, and 25 are odd numbers, but they are composite because they have factors other than 1 and themselves.