Prime Number Checker: Is It Prime or Not?
A prime number has exactly two factors: 1 and itself. Testing up to the square root is enough, because any larger factor pairs with a smaller one already tested.
What is the Prime Number Checker?
Enter a whole number and the tool tests it by trial division up to its square root. If the number is not prime, it reports the smallest factor it found, so you can see why. Numbers below 2 are not prime by definition.
How to use it
- Enter a whole number.
- Click Check Primality.
- Read whether it is prime, or its smallest factor if it is not.
Worked example
97 is prime: no whole number from 2 up to the square root of 97 (about 9.85) divides it evenly.
Why test only up to the square root?
If a number has a factor larger than its square root, the matching factor is smaller than the square root, so it would already have been found.
Frequently asked questions
Is 1 prime?
No. Primes must have exactly two factors, and 1 has only itself.
Is 2 prime?
Yes. It is the only even prime number.