Prime Number Checker
Use the Prime Number Checker to determine whether a positive whole number is prime, composite, or the special value 1. A prime number greater than 1 has exactly two positive factors: 1 and itself. Composite numbers have additional positive factors. The tool also lists the positive factors it finds so the classification can be inspected rather than returning only a yes-or-no answer.
A prime number greater than 1 has exactly two positive factors: 1 and itself.
How to use the Prime Number Checker
- Enter a positive whole number.
- The calculator tests possible divisors up to the square root of the number.
- Each exact divisor produces a factor pair.
- If a number greater than 1 has only factors 1 and itself, it is prime.
- If additional factors exist, the number is composite.
- The number 1 is handled separately because it is neither prime nor composite.
- For browser performance, this implementation accepts whole numbers up to one trillion.
Examples
Is 97 prime?
Yes. Its only positive factors are 1 and 97.
Is 100 prime?
No. 100 is composite and has several factors including 2, 4, 5, 10, 20, 25 and 50.
Is 2 prime?
Yes. 2 is the smallest prime number and the only even prime.
Is 1 prime?
No. The number 1 is neither prime nor composite.
Frequently asked questions
What is a prime number?
A prime number is a whole number greater than 1 with exactly two positive factors: 1 and itself.
Is 1 a prime number?
No. 1 has only one positive factor, so it is neither prime nor composite.
Is 2 prime?
Yes. 2 is the smallest prime and the only even prime number.
What is a composite number?
A composite integer greater than 1 has more than two positive factors.
Why only test factors up to the square root?
If a number has a factor larger than its square root, the matching factor in that pair must be smaller than the square root, so checking both sides separately is unnecessary.
Does the checker show factors?
Yes. For valid inputs it lists the positive factors used to understand the prime or composite result.
More math tools
LCM Calculator
PopularFind the least common multiple of two or more positive integers.
Open tool →GCF Calculator
PopularFind the greatest common factor of two or more positive integers.
Open tool →Random Number Generator
PopularGenerate a random number within a custom range.
Open tool →Scientific Calculator
PopularAdvanced calculator for trig, logs, roots, powers, factorials and more.
Open tool →Random Number Generator
PopularGenerate a random number within a custom range.
Open tool →Fraction Calculator
PopularCalculate and simplify fractions and mixed numbers with steps.
Open tool →