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.

  1. 2
  2. 3
  3. 5
  4. 7
  5. 11
  6. 13
  7. 17
  8. 19
  9. 23
  10. 29
  11. 31
  12. 37
  13. 41
  14. 43
  15. 47
  16. 53
  17. 59
  18. 61
  19. 67
  20. 71
  21. 73
  22. 79
  23. 83
  24. 89
  25. 97

How to check or generate primes

  1. 1

    Switch between "Check a number" and "Generate primes" mode.

  2. 2

    In check mode, type any whole number — it's tested by trial division up to its square root.

  3. 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

All Calculators →

Updated