Prime Number Check
Enter an integer of up to 20,000 decimal digits to check whether it is prime. Calculations run directly in your browser using high-precision BigInt arithmetic. Numbers typed or pasted into the checker are never sent to the server. A number supplied through the page URL is part of the page request and should not be used for private values. Numbers below 264 are settled by a deterministic test; larger ones use Baillie–PSW, with live progress and a stop button.
- Elapsed
- 0.0 s
- Remaining
- estimating
- Speed
- -
- Operations
- 0
What are prime numbers?
A prime number is a positive whole number greater than 1 that cannot be formed by multiplying two smaller natural numbers. In other words, a prime number has exactly two distinct positive divisors: 1 and itself.
Quick Rules:
- 0 and 1 are not prime numbers.
- 2 is the only even prime number.
- All other prime numbers are odd (3, 5, 7, 11, 13, 17, 19, ...).
You can read more about what prime numbers are, how to check whether a number is prime, the different types of primes, the first million primes, and the history of prime numbers.
Sources & Further Reading
- Wikipedia: Prime number- General mathematical overview of primes, divisibility rules, and properties.
- Wikipedia: Baillie-PSW primality test- Technical details on the fixed base-2 Miller-Rabin check and Lucas probable-prime test used in this prime number checker.
- Wikipedia: Miller-Rabin primality test- Analysis of the modular exponentiation algorithms also used in this prime number checker.
- Wolfram MathWorld: Prime Number- Comprehensive reference on prime sequences, conjectures, and theorems.