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

Prime Number Checker

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

NumberResult
2Prime
9Composite, divisible by 3
17Prime
21Composite, divisible by 3 and 7
97Prime

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.