P

Prime Number Calculator

Arithmetic & NumbersFreeStep by step

A prime number has exactly two factors: 1 and itself. This prime number calculator checks whether a whole number is prime by testing divisors up to its square root. If it is not prime, you get its prime factorisation. It also finds the next prime number after the one you enter.

Try:

How to use the prime number calculator

  1. Enter a whole number, such as 97.
  2. Press Calculate.
  3. See whether it is prime, its prime factors and the next prime.

Formula

n is prime  ⟺  no d with 2≤d≤n divides nn \text{ is prime} \iff \text{no } d \text{ with } 2 \le d \le \sqrt{n} \text{ divides } n

Worked example: 97

  • Whole number: 97

✓ Answer checked

97 is a prime number

Next prime
101
Step-by-step working (3 steps)
  1. Set the search limit

    Only divisors up to √97 ≈ 9 need testing; any larger factor would pair with a smaller one.

    97≈9.84886\sqrt{97} \approx 9.84886
  2. Test the divisors

    No whole number from 2 to 9 divides 97 exactly.

  3. Conclusion

    97 has exactly two factors, 1 and 97, so it is prime.

How this was checked
  • ✓ Multiplying the prime factors gives 97.
  • ✓ Every factor in the factorisation is itself prime.

Frequently asked questions

Is 1 a prime number?

No. A prime must have exactly two different factors, and 1 has only one.

Why only test divisors up to the square root?

If a number has a factor bigger than its square root, it must also have one smaller than it, so checking up to the square root is enough.

Is 2 a prime number?

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

People also search for

prime number calculatoris it primeprime checkerprime factorisationprime number calculator with stepsfree prime number calculator online

Related calculators

More arithmetic & numbers tools

Related guides