Skip to content

Prime Number Checker

Check whether a number is prime and see its factors.

Calculated locally in your browser.

How do you check whether a number is prime?

A prime number greater than 1 has exactly two factors: 1 and itself. The tool tests divisibility up to the square root of the number, lists its factors and finds the next prime. Note that 1 is not prime and the only even prime is 2. For example, 17 is prime; 18 is not, since its factors are 1, 2, 3, 6, 9 and 18.

Understanding your result

1 is not prime, and the only even prime is 2.

Formula and method

A prime number greater than 1 has exactly two factors: 1 and itself. The tool tests divisibility up to the square root.

Assumptions and limitations

It tests a single whole number greater than 1, since 1 is not prime and negatives and fractions are outside its scope. It reports primality and factors but does not perform a full prime factorisation into repeated prime powers for composite numbers.

Worked example

17 is prime; 18 is not (its factors are 1, 2, 3, 6, 9, 18).

How to use this tool

  1. Enter a whole number.
  2. See whether it is prime and its factors.

Common mistakes to avoid

  • Assuming 1 is prime — it is not.

About the Prime Number Checker

Check whether a whole number is prime, list its factors and find the next prime.

Who should use this tool

Students exploring number theory, teachers setting divisibility exercises, and coders or puzzle-solvers who want to confirm whether a whole number is prime, see its full list of factors and find the next prime above it.

Benefits

  • Confirms primality by testing divisors up to the square root
  • Lists every factor of a composite number
  • Finds the next prime above your input
  • Handles large numbers without manual trial division

Practical use cases

  • Checking whether a number is prime for a maths class
  • Listing the factors of a composite number quickly
  • Finding the next prime for a coding or cryptography exercise
  • Verifying a divisibility answer during revision

Explore all Mathematics tools

Frequently asked questions

Is 2 prime?

Yes. 2 is the smallest and only even prime number.

Why is 1 not a prime number?

A prime number is defined as having exactly two distinct factors, 1 and itself. The number 1 has only a single factor, itself, so it fails that definition. Excluding 1 also keeps prime factorisation unique, which is why mathematicians treat it as neither prime nor composite.

Why does the tool only test divisors up to the square root?

If a number has a factor larger than its square root, it must also have a matching factor smaller than the square root. So once you have checked every divisor up to the square root and found none, the number is certainly prime. This makes the test far faster.

Share this tool

Free to use — copy the link, share it anywhere, or add the tool to your own website.

Embed this tool on your site (free)

Copy this code and paste it into any web page — it stays free and always up to date: