How to use the prime number checker
- Type a whole number into Number to check. The page opens with 97. Commas such as 1,000,003 are accepted.
- Read the verdict at the top of the result box. It updates as you type, or press Check number to refresh it at once.
- For a composite number, read Prime factorization, Number of divisors and Divisors. Every result also lists the Previous prime and Next prime.
- Tap an example under Try an example, such as 91 (7 × 13), to see a number that looks prime but is not.
How the checker decides
A prime is a whole number greater than 1 whose only positive divisors are 1 and itself (MathWorld). This tool tests primality with the Miller-Rabin test using the first twelve primes, 2 through 37, as bases. That set is proven exact, not just probable, for every number below 3.18 × 1023 (Sorenson and Webster), so every 18-digit answer is certain. Composites are split by trial division and Pollard's rho method. Every whole number above 1 has exactly one prime factorization (Fundamental Theorem of Arithmetic), and the divisor count is the product of each exponent plus one.
Worked example with the default number
With 97 in Number to check, the tool shows 97 is a prime number.
- By hand, √97 ≈ 9.85, so you only test the primes 2, 3, 5 and 7: 97 ÷ 2 = 48.5, 97 ÷ 3 ≈ 32.33, 97 ÷ 5 = 19.4 and 97 ÷ 7 ≈ 13.86. None divides evenly.
- Divisors: 1, 97 (2 divisors). Previous prime: 89. Next prime: 101.
Now type 60. The result reads 60 is not a prime number (composite), with the prime factorization 22 × 3 × 5, 12 divisors (1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60), previous prime 59 and next prime 61. The 12 comes from (2 + 1) × (1 + 1) × (1 + 1).
Limits and edge cases
- It accepts whole numbers up to 18 digits (999,999,999,999,999,999). Longer numbers get a message instead of a slow or wrong answer.
- 0 and 1 are neither prime nor composite. Negative numbers are never prime, so for -60 you get that verdict plus the details for 60. Decimals such as 7.9 are rejected.
- The divisor list appears only for numbers with 200 divisors or fewer. The count is always shown.
- The 25 primes below 100 are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89 and 97 (OEIS A000040).
Related tools: simplify fractions with the fraction calculator, count arrangements with the permutation and combination calculator, or see how fast numbers grow with the factorial calculator.
Frequently asked questions
Is 1 a prime number?
No. A prime needs exactly two different divisors, and 1 has only one. Counting 1 as prime would also break unique prime factorization, because 6 could be written as 2 × 3, 1 × 2 × 3, and so on without end.
Is 0 a prime number?
No. Zero is neither prime nor composite. Every whole number divides 0 evenly, so it has infinitely many divisors rather than exactly two.
Is 51 a prime number?
No. 51 = 3 × 17. Its digits add up to 6, which is divisible by 3, so 3 divides 51. Numbers such as 57 (3 × 19) and 87 (3 × 29) fool people the same way.
How do you find the prime factorization of a number?
Divide by the smallest prime that goes in evenly (2, then 3, 5, 7 and so on) and repeat with the quotient until you reach 1. For 60: 60 ÷ 2 = 30, 30 ÷ 2 = 15, 15 ÷ 3 = 5, and 5 is prime, so 60 = 2² × 3 × 5.
Why is 2 the only even prime number?
Every even number greater than 2 is divisible by 2, so it has at least three divisors: 1, 2 and itself.
Sources: Wolfram MathWorld, Prime Number; Sorenson and Webster, Strong Pseudoprimes to Twelve Prime Bases; OEIS A000040.