🔢 Prime Number Checker
A prime number has exactly two divisors: 1 and itself. This checker tests your number with trial division up to its square root — the mathematically complete method — and tells you instantly whether it is prime or composite.
Primes underpin modern cryptography: every secure website you visit relies on the fact that multiplying two large primes is easy but factoring the product back apart is enormously hard.
How to use this calculator
Type any whole number from 2 up to 100 million and the checker runs trial division against every odd divisor up to the square root.
- Enter the number you want to test.
- Read the headline result: Prime or Not prime.
- If composite, the smallest divisor is shown underneath.
How to Check If a Number Is Prime
The reliable way to check primality by hand is trial division: test whether the number divides evenly by 2, 3, 5, 7 and so on up to its square root. If none divide it, the number is prime. For example, to test 97 you only need to check divisors up to 9.8 — that is 2, 3, 5 and 7 — and since none divide 97, it is prime. This calculator automates exactly that process for numbers far too large to test manually.
Frequently asked questions
How do you check if a number is prime?
Divide it by every integer up to its square root. If any divide evenly, it is composite; if none do, it is prime. Our checker above automates this trial-division method instantly.
What is the smallest prime number?
2 is the smallest prime — and the only even prime. Every other even number is divisible by 2, so it cannot be prime.
Is 1 a prime number?
No. By definition a prime must have exactly two distinct divisors, 1 and itself. The number 1 has only one divisor, so it is neither prime nor composite.
What are the first 10 prime numbers?
2, 3, 5, 7, 11, 13, 17, 19, 23 and 29. Notice that after 2 and 3, primes appear irregularly — there is no simple formula that generates them all.
Why do prime numbers matter?
Large primes are the foundation of RSA encryption, which secures online banking, messaging and shopping. Multiplying two big primes is fast; factoring the result is practically impossible.
Can this checker handle very large numbers?
It handles whole numbers up to 100 million using optimized trial division. Beyond that, probabilistic tests like Miller-Rabin are used in practice.