● calculated entirely in your browser
Prime number checker & generator
Check any number, or list all primes up to a limit.
How it works
Primality is tested by trial division: after handling 2 and 3 as special cases, the checker only tries odd divisors up to the square root of the number, since any factor larger than the square root would have a matching factor smaller than one already tested. The "primes up to" list runs that same check against every integer up to your limit.
FAQ
- Why is the "primes up to" limit capped at 1,000,000 and the list capped at 2,000 primes?
- Trial division doesn't scale — checking every integer up to a million with hand-rolled division in the browser would freeze the tab, so the input is capped and the displayed list stops at the first 2,000 matches to stay responsive.
- Is 1 considered a prime number here?
- No — by definition a prime has exactly two divisors, 1 and itself, and 1 only has one, so the checker correctly marks 0, 1, and any negative number as not prime.
Free, unlimited, no account. If this saved you a paid tool, a small thanks is appreciated.
Say thanks — $3