Prime Number Checker

Type any whole number to see straight away whether it is prime or composite. For a composite number you also get its prime factorisation in index form (like 2^3 × 3^2 × 5), the number of divisors, and the nearest primes on either side. Below that, list every prime between two numbers. It handles numbers up to 60 digits exactly, and nothing you type leaves your browser.

Commas and spaces are fine. Up to 60 digits.

360

Not prime

It has a divisor other than 1 and itself.

Prime factorisation
2^3 × 3^2 × 5
Previous prime
359
Next prime
367
Number of divisors
24

Primes in a range

Up to 10,000 numbers at a time.

25 primes

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97

Every calculation runs in your browser. What you type never leaves this device.

Features

  • Prime or composite answer as you type

  • Prime factorisation in index form, ready for HCF and LCM work

  • Number of divisors from the factorisation

  • Next prime and previous prime

  • All primes in a range of up to 10,000 numbers, with a count

  • Exact whole-number arithmetic for numbers up to 60 digits

  • Copy the factorisation or the list of primes

  • Runs in your browser; free, no signup

Who uses it

School maths

Check Class 6 to Class 10 answers on primes, composites, prime factorisation, HCF and LCM.

Competitive exams

Quickly test a number from a quantitative aptitude question, or count the divisors of a number.

Programming practice

Verify the output of your own prime sieve or factorisation code against a second answer.

Puzzles and curiosity

Find the next prime after a year, a phone number or a large power of two.

Primes, factors and divisors

What makes a number prime

A prime number has exactly two divisors: 1 and itself. 2, 3, 5, 7, 11 and 13 are prime. A composite number has more divisors, such as 12 (1, 2, 3, 4, 6 and 12). 1 is neither prime nor composite, and 2 is the only even prime.

Reading the factorisation

Every whole number above 1 can be written as a product of primes in exactly one way. 360 = 2^3 × 3^2 × 5 means 2 × 2 × 2 × 3 × 3 × 5.

The number of divisors comes from the powers: add 1 to each power and multiply. For 360 that is (3 + 1) × (2 + 1) × (1 + 1) = 24 divisors.

How the check works

  • Small numbers are tested against small primes first.
  • Larger numbers go through the Miller-Rabin test, which is proven exact below about 3.3 × 10^24. Above that the page says "probably prime": no number is known to pass the test without being prime, but it is not proven.
  • Factors are found by trial division and then Pollard's rho method. If a remaining part is composite but too large to split in a few seconds, the page says so instead of guessing.

Related tools

Use the LCM and HCF calculator for two or more numbers, the factorial calculator for n!, nPr and nCr, and the number base converter to write a number in binary or hex.

Prime Number Checker - FAQ