Choose a translated page where available; otherwise a clear fallback is shown.
← All tools

Math tool

Prime Number Checker

Check whether an integer is prime and list its factors when it is composite.

Loading tool workspace…

Your text and calculations are processed in your browser unless a tool explicitly needs an external public data source. Results are estimates and should be checked before financial or business decisions.

Advertisement

Math utility

Check whether a whole number is prime or composite

A prime number is an integer greater than 1 that has exactly two positive factors: 1 and itself. A composite number is greater than 1 and has additional positive factors. Enter a whole number to test its classification and review the available factor information.

How to use the prime number checker

  1. Enter a whole-number integer in the input field.
  2. Run the checker to test the number.
  3. Read whether the value is prime or composite and inspect the factor result.
  4. Try another integer to compare prime and composite examples.

Prime number examples and rules

The numbers 2, 3, 5, 7, 11 and 13 are prime. The number 2 is the only even prime; every other even integer greater than 2 is composite. For example, 21 is composite because it can be divided evenly by 3 and 7.

Zero and 1 are not prime numbers. Negative integers are not classified as prime numbers under the standard positive-prime definition. A prime number must be greater than 1 and have no positive divisors other than 1 and itself.

How to test divisibility efficiently

To determine whether an integer n greater than 1 is prime, it is sufficient to test possible divisors up to the square root of n. If no integer from 2 through the square root divides it evenly, the number is prime. This works because any factor larger than the square root would have a matching factor smaller than the square root.

For example, to test 29, check possible divisors 2, 3, 4 and 5. None divides 29 evenly, so 29 is prime. For 35, the divisor 5 gives 35 = 5 × 7, so 35 is composite.

Frequently asked questions

Is 1 a prime number?

No. A prime number has exactly two distinct positive factors. The number 1 has only one positive factor: itself.

Is 2 the only even prime number?

Yes. Every even integer greater than 2 is divisible by 2 and therefore has more than two positive factors.

How can I check a large number for primality?

For a basic divisibility test, checking possible factors up to the square root is sufficient. Very large integers may require specialised primality algorithms.

What is the difference between prime and composite?

A prime integer greater than 1 has exactly two positive factors. A composite integer greater than 1 has more than two.

Related maths tools

PDFora toolbox

Explore all tools

PDF tools are here, with finance, text, developer and image utilities in our all-tools hub.

Explore finance, text, developer & image tools →