Prime Number Checker
Prime Number Checker
Enter any whole number to check whether it's prime. This tests for divisibility by every number up to its square root, and if a number isn't prime, shows the smallest factor that divides it.
A prime number is a whole number greater than 1 with exactly two positive divisors — 1 and itself — meaning nothing else divides it evenly. Checking only up to the square root is enough to be certain: if a number had a factor larger than its square root, it would necessarily also have a corresponding factor smaller than the square root, so any factor that exists would already have been found by that point, making the square-root cutoff both correct and efficient even for fairly large numbers.
- Definition of a prime number: a whole number greater than 1 with exactly two positive divisors — 1 and itself — meaning nothing else divides it evenly.
- Why only checking up to the square root is enough: if a number has a factor larger than its square root, it must also have a corresponding factor smaller than the square root, so checking beyond that point is redundant.
- 1 is not prime, and neither is 0 or any negative number: primality is only defined for whole numbers greater than 1.
Why isn't 1 considered a prime number?
A prime number needs exactly two distinct divisors (1 and itself) — 1 only has one divisor (itself), so it doesn't meet the definition, and excluding it also keeps the Fundamental Theorem of Arithmetic clean and consistent.
What does the "smallest factor" tell me about a non-prime number?
It's the quickest way to see why the number failed the primality test — the smallest factor is always a prime number itself, and dividing the original number by it is the first step toward a full prime factorization.
Prime Number Checker


Enter any whole number to check whether it's prime. This tests for divisibility by every number up to its square root, and if a number isn't prime, shows the smallest factor that divides it.
A prime number is a whole number greater than 1 with exactly two positive divisors — 1 and itself — meaning nothing else divides it evenly. Checking only up to the square root is enough to be certain: if a number had a factor larger than its square root, it would necessarily also have a corresponding factor smaller than the square root, so any factor that exists would already have been found by that point, making the square-root cutoff both correct and efficient even for fairly large numbers.

- Definition of a prime number: a whole number greater than 1 with exactly two positive divisors — 1 and itself — meaning nothing else divides it evenly.
- Why only checking up to the square root is enough: if a number has a factor larger than its square root, it must also have a corresponding factor smaller than the square root, so checking beyond that point is redundant.
- 1 is not prime, and neither is 0 or any negative number: primality is only defined for whole numbers greater than 1.
Why isn't 1 considered a prime number?
A prime number needs exactly two distinct divisors (1 and itself) — 1 only has one divisor (itself), so it doesn't meet the definition, and excluding it also keeps the Fundamental Theorem of Arithmetic clean and consistent.
What does the "smallest factor" tell me about a non-prime number?
It's the quickest way to see why the number failed the primality test — the smallest factor is always a prime number itself, and dividing the original number by it is the first step toward a full prime factorization.
