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: .
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
- Listing: the sieve of Eratosthenes crosses out all multiples of 2, then of 3, 5, 7 and so on. What remains are the primes. It works up to 10 million and counts twin primes and the largest gap on the way.
- Checking: a number n is prime if no prime up to √n divides it. For numbers up to 10 to the power 15 this test is enough, and the working names the smallest divisor or the factorization.
- Nth prime: the 100th prime is 541, the 1,000th is 7,919 and the 10,000th is 104,729.
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
- Wikipedia – Prime number (Definition, Primzahlsatz, Zwillingsprimzahlen)
- Wikipedia – Sieve of Eratosthenes
- OEIS A006880 – number of primes below 10^n (check values)
As of: · Editorial policy
Related tools
- Prime Factorization CalculatorPrime factorization calculator with steps: factor any number up to one trillion into primes, see the factor tree, test for primality and count divisors.
- GCF and LCM CalculatorGCF and LCM calculator for two or more numbers: greatest common factor, least common multiple, prime factorization, Euclidean algorithm and all common factors.
- Sequence CalculatorSequence calculator: enter numbers, find the rule (arithmetic, geometric, Fibonacci, quadratic), get the next terms, the nth term and the sum of n terms.
- Number base converter with stepsConvert between binary, octal, decimal, hex and any base from 2 to 36 – with full working, fractions, repeating digits and two’s complement (8–64 bit).
- Online CalculatorCalculator online, free and instant: type or tap and see the answer as you go – order of operations, brackets, percent, square root, steps and a history list.
- Pi digitsPi digits up to 10,000 decimal places: show any number of digits, look up the digit at a position or search a sequence such as your birthday in π.
- Power Set CalculatorPower set calculator: lists all subsets of a finite set ordered by size, gives the count 2ⁿ and the number of subsets per size, with the working shown.
- Bearing life calculator: basic rating life L10 and L10h from load and speedBearing life calculator: basic rating life L10 in million revolutions and L10h in hours from load rating C, load P and speed, with reliability factor a1.
- Clock Angle CalculatorClock angle calculator: the angle between the hour and minute hand for any time, with the formula |30h − 5.5m|, the smaller and larger angle and every step.