Prime Number Checker
Check instantly whether a number is prime, see its smallest divisor and full prime factorization, and find the previous and next prime.
Enter a whole number from 0 to 1,000,000,000,000.
Prime factorization
Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.
How to use the Prime Number Checker
- 1 Type a whole number between 0 and 1,000,000,000,000.
- 2 See at once whether it is prime.
- 3 For a composite number, read its smallest factor and prime factorization; for any number, the nearest primes.
About the Prime Number Checker
A prime number is a whole number greater than 1 that can only be divided by 1 and itself: 2, 3, 5, 7, 11, 13 and so on. Numbers greater than 1 that are not prime are called composite. 0 and 1 are neither prime nor composite.
The checker tests divisibility by 2 and 3 and then by every number of the form 6k ± 1 up to the square root of your number. That is enough: if a number has a divisor, it has one no larger than its square root. For numbers up to one trillion this takes at most a million divisions, so the answer is instant.
For composite numbers you also get the prime factorization, written with exponents (360 = 2^3 × 3^2 × 5), and the number of divisors, which follows from it: (3 + 1) × (2 + 1) × (1 + 1) = 24. Every whole number greater than 1 has exactly one prime factorization (the fundamental theorem of arithmetic).
Frequently asked questions
Is 1 a prime number?
No. By definition a prime has exactly two different divisors, 1 and itself. The number 1 has only one divisor.
Is 2 a prime number?
Yes, 2 is the smallest prime and the only even one. Every other even number is divisible by 2.
How do I find the prime factors of a number?
Divide by the smallest prime that fits, repeat with the quotient, and continue until you reach 1. The checker does this for you and lists each prime with its power.
How large a number can I check?
Up to 1,000,000,000,000 (one trillion).
How many divisors does a number have?
Write it as p^a × q^b × …; the number of divisors is (a + 1)(b + 1)…. For 12 = 2^2 × 3 that is 3 × 2 = 6: 1, 2, 3, 4, 6 and 12.