Lang
Prime Number Checker
Is Prime Number Calculator
Check whether a number is prime or composite, see factor tests, divisibility notes, examples, and related number tools. Enter a whole number and the calculator checks divisibility up to the square root of the number.
Check if a number is prime
97 is prime.
Prime number test
To test a number n, check divisibility by integers from 2 through the square root of n.
\[\text{test divisors} \le \sqrt{n}\]
If none divide evenly, the number is prime.
Examples
| Number | Result |
|---|---|
| 2 | Prime |
| 9 | Composite, divisible by 3 |
| 17 | Prime |
| 21 | Composite, divisible by 3 and 7 |
| 97 | Prime |
Related math tools
Is Prime Number Calculator FAQ
Is 1 prime?
No. A prime number must have exactly two positive divisors, and 1 has only one.
Is 2 prime?
Yes. 2 is prime and it is the only even prime number.
Why test only up to the square root?
If a number has a factor larger than its square root, it must also have a matching factor smaller than the square root.
What is a composite number?
A composite number has more than two positive divisors, such as 4, 6, 8, 9, 10, and 12.
