Advertisement

Prime Number Tools

Work with prime numbers: primality tests, prime ranges, nth prime and prime factorization. Fast, free, in your browser.

Prime tools

Pick an operation and enter a number.

Tests divisibility up to the square root. Handles numbers up to 10^12 quickly.

Result

Press Calculate.
Advertisement

How the math works

Primality is tested by trial division up to the square root, skipping even divisors with a 6k ± 1 wheel, which is fast for numbers up to about a trillion. Factorization reuses the same approach to peel off prime factors, and the nth-prime finder simply counts primes upward. Everything runs locally in JavaScript.

Practical limits

Ranges are capped at 100,000 wide and nth-prime searches at the millionth prime to keep the tab responsive. These limits cover homework, coding challenges and everyday curiosity with room to spare.

Prime Number Tools FAQs

How do I check if a large number is prime?
Use the Is it prime mode. It handles numbers up to 10^12 (a trillion) in well under a second using optimized trial division.
What does 97 = 97 mean in factorization?
It means the number itself is prime, so its only prime factor is itself. Composite numbers break down further, like 60 = 2^2 x 3 x 5.
Why is 1 not prime?
By definition a prime has exactly two distinct divisors. 1 has only one divisor (itself), so mathematicians exclude it; the tool treats numbers below 2 as not prime.
Can I list the first 100 primes?
Yes. Use the Nth prime mode with N=100 to find that the 100th prime is 541, or use the range mode from 2 to 600 to list them all.
Is trial division secure for cryptography?
No. This tool is for learning and everyday math. Real cryptographic primality testing uses probabilistic algorithms like Miller-Rabin on far larger numbers.
Advertisement