PRIME NUMBER CHECKER & GENERATOR
Check whether a number is prime, or generate every prime up to a limit or the first N primes.
In short
Check whether a number is prime and see its smallest factor if not, or generate every prime up to a limit or the first N primes. Runs entirely in your browser.
97 is prime
Prime numbers from 1 to 100
There are 25 prime numbers below 100. 2 is the only even one; 1 is not prime.
- 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
How to check or generate primes
- 1
Switch between "Check a number" and "Generate primes" mode.
- 2
In check mode, type any whole number — it's tested by trial division up to its square root.
- 3
In generate mode, pick either "primes up to N" (using a sieve) or "first N primes", and read the full list.
Questions
- What are the prime numbers from 1 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. 2 is the only even prime, and 1 is not prime.
- Why check for factors only up to the square root of the number?
- If a number n has a factor larger than its square root, it must also have a corresponding factor smaller than the square root (since their product equals n) — so checking up to √n is guaranteed to catch any factor pair without wasted work. This is the standard trial-division shortcut, not an approximation.
- What is the Sieve of Eratosthenes?
- It's an ancient, highly efficient algorithm for finding every prime up to a limit: start by assuming all numbers are prime, then starting from 2, mark every multiple of each prime as composite. Whatever's left unmarked is prime. It's dramatically faster than testing each number individually, which is why "primes up to N" mode uses it here.
- Why are the generator limits capped?
- Generating primes up to 1,000,000 or the first 10,000 primes already takes a noticeable moment in a browser tab — capping keeps the tool responsive. For research-scale prime generation, a dedicated offline tool or library is a better fit than a browser-based utility.
- Is 1 a prime number?
- No — by definition, a prime number must have exactly two distinct positive divisors (1 and itself), and 1 only has one. This is why mathematicians explicitly exclude 1 from the primes, even though it might seem intuitive to include it.
Related tools
- GCF & LCM CalculatorFind the greatest common factor and least common multiple of two or more numbers, with prime factorizations shown.
- Scientific Notation CalculatorAdd, subtract, multiply, and divide in scientific notation and convert to engineering, E notation, or decimal.
- Grade CalculatorAdd up every assignment's points to find your overall grade percentage and what it takes to hit a target grade.
- Quadratic Equation SolverSolve ax² + bx + c = 0 for x, with real, repeated, or complex roots, plus the discriminant and vertex.
- Number to Words ConverterConvert any number into written-out English words, for checks, legal documents, and invoices.
- Percentage CalculatorFind X% of Y, what percent X is of Y, or the change between two numbers.
- Ratio CalculatorSimplify a ratio to lowest terms, convert it to 1 : n and percentages, split a total, or scale it to a target value.
- Rule of Three CalculatorSolve direct and inverse proportions: enter three values and find the fourth.
Updated