Prime Number Checker

Is it prime? Factors, divisors and the nearest primes

Check whether a number is prime, see its prime factorisation and divisors if not, and find the previous and next prime numbers.
Share
Try an example:
Your result will appear here as you type.

About Prime Number Checker

Formula

n is prime if no prime p ≤ √n divides it

Worked examples

97

√97 ≈ 9.8. None of 2, 3, 5 or 7 divides 97, so it is prime. The next prime is 101.

360

360 = 2³ × 3² × 5, so it has (3+1)(2+1)(1+1) = 24 divisors.

How it works

  1. A prime has exactly two divisors: 1 and itself.
  2. The number is divided by 2, 3 and then every number of the form 6k ± 1 up to its square root.
  3. If none divides evenly it is prime; otherwise the factors found give its prime factorisation.

What you need

  • A whole number up to 10^15.

Tips

  • Only numbers up to √n need checking - any larger factor pairs with a smaller one.

Limitations

  • Very large numbers near 10^15 can take a moment.

Runs in your browser. Calculations run in your browser - nothing you enter is sent anywhere.

Definitions

Prime number
A whole number above 1 with no divisors other than 1 and itself.
Composite number
A whole number above 1 that is not prime.

Frequently asked questions

Is 1 a prime number?+

No - a prime needs exactly two different divisors, and 1 has only one.

Was this calculator helpful?