Free online calculator

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.

Result
97 is a prime number
Positive factors
1, 97

A prime number greater than 1 has exactly two positive factors: 1 and itself.

How to use the Prime Number Checker

  1. Enter a positive whole number.
  2. The calculator tests possible divisors up to the square root of the number.
  3. Each exact divisor produces a factor pair.
  4. If a number greater than 1 has only factors 1 and itself, it is prime.
  5. If additional factors exist, the number is composite.
  6. The number 1 is handled separately because it is neither prime nor composite.
  7. 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.

Related tools

More math tools