Prime Number Calculator

This prime number calculator works in three ways: it lists all primes in a range (for example up to 100), checks a single number and shows its factors, or finds the nth prime. The result appears at once, along with twin primes, the largest gap and the working.

Example: Task: List the primes in a range · From 1 · To 100 → Result: 25 primes from 1 to 100. Source: Wikipedia – Prime number (Definition, Primzahlsatz, Zwillingsprimzahlen). Updated: .

Lower limit, inclusive
Upper limit, inclusive (at most 10,000,000)
My ToolboxYour inputs are saved in this browser only.

Result

Result
25 primes from 1 to 100
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
Notable facts
  • Twin primes (difference 2): 8 pairs, for example (3, 5) (5, 7) (11, 13) (17, 19) (29, 31) (41, 43)
  • Largest gap: 8, between 89 and 97
  • Share of primes in the range: 25%

How it is calculated

A prime number is a natural number greater than 1 whose only divisors are 1 and itself. The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23 and 29. The number 2 is the only even prime, and 1 is not counted as a prime. There are 25 primes up to 100, 168 up to 1,000 and 78,498 up to one million.

How the tool works

Twins, gaps and distribution

Twin primes are pairs such as (11, 13) or (41, 43) with a difference of 2. Whether there are infinitely many is still unknown. Gaps between primes grow on average: by the prime number theorem the density is about 1 divided by ln n. To break one number completely into factors, use the prime factorization calculator; for the greatest common divisor and least common multiple, the GCF and LCM calculator.

Frequently asked questions

What is a prime number?

A natural number greater than 1 with exactly two divisors: 1 and itself. Examples are 2, 3, 5, 7 and 11. Numbers with more divisors are called composite.

Is 1 a prime number?

No. The number 1 has only one divisor and by definition is not prime. This keeps the prime factorization of every number unique.

How many primes are there up to 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.

How do you check whether a number is prime?

Divide it by all primes up to its square root. If none divides without a remainder, the number is prime. For 97 it is enough to test 2, 3, 5 and 7.

Are there infinitely many primes?

Yes, Euclid proved this over 2,000 years ago. There is no largest prime, and this tool stops at 10 million only because of computing time.

Sources and legal basis

As of: · Editorial policy

Related tools