Prime Number Checker
Check whether a number is prime, see its prime factorisation and find the nearest primes.
What is the Prime Number Checker?
A prime number has exactly two divisors: 1 and itself. 2 is the only even prime.
How does it work?
The checker uses a deterministic Miller–Rabin test that is proven correct for numbers up to 24 digits. Composite numbers are factorised by trial division.
Formula
n is prime ⇔ n > 1 and its only divisors are 1 and n
Example
97 is prime. 360 = 2³ × 3² × 5, which has 24 divisors.
Frequently asked questions
Is 1 a prime number?
No. By definition a prime must have exactly two distinct divisors, and 1 has only one.
Related tools
Enable JavaScript to use this calculator.