Prime Number Checker

Find out if a number is prime, see its prime factorization and number of divisors, and list every prime up to a limit. It handles whole numbers up to 16 digits and runs in your browser.

Is it a prime number?

Commas and spaces are fine, for example 1,000,003

97 is a prime number.

Prime factorization
97
a prime is its own factor
Divisors
2
positive divisors
Nearest primes
89 · 101
previous · next

List of prime numbers

Up to 1,000,000

Primes found
25
up to 100
Largest
97

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

How to check if a number is prime

  1. Type a whole number. The answer, its prime factorization and its divisor count appear straight away.
  2. For a composite number, read the smallest factor and the full list of prime factors.
  3. To see primes in a range, enter a limit in the second box and copy the list.

How primality is tested

A prime has exactly two divisors, 1 and itself. To test a number n, you only need to try divisors up to the square root of n, because any factor larger than that pairs with a smaller one. The checker skips multiples of 2 and 3 and tests the rest, which is quick for numbers up to 16 digits. The list uses the sieve of Eratosthenes: cross out the multiples of each prime and what is left is prime.

Related tools

To simplify a ratio use the ratio calculator. To reduce fractions use the fraction calculator. To pick numbers at random use the random number generator, or find a mean with the average calculator.

See also

Frequently Asked Questions (FAQ)

What is a prime number?

A prime number is a whole number greater than 1 whose only divisors are 1 and itself. The first primes are 2, 3, 5, 7, 11, 13 and 17. A number with more divisors, such as 12, is called composite.

How do I check if a number is prime?

Type the number into the checker. It tells you at once whether it is prime. If it is not, it shows the smallest number that divides it and the full prime factorization.

Is 1 a prime number?

No. A prime has exactly two divisors, and 1 has only one. Excluding 1 keeps every number's prime factorization unique. 0 is not prime either.

Is 2 the only even prime?

Yes. Every other even number is divisible by 2, so it has at least three divisors. That makes 2 the smallest prime and the only even one.

What is prime factorization?

It writes a number as a product of primes. For example 360 = 2 × 2 × 2 × 3 × 3 × 5, or 2³ × 3² × 5. Every whole number above 1 has exactly one such form, apart from the order.

How big a number can I check?

Any whole number up to 9,007,199,254,740,991 (2^53 − 1), which is 16 digits. Beyond that, a browser cannot hold the value exactly. Very large primes may take a moment to confirm.

How does the list of primes work?

Enter a limit and the tool lists every prime up to it using the sieve of Eratosthenes. Limits go up to 1,000,000, which has 78,498 primes. The first 2,000 are shown and you can copy the whole list.

Is my number sent anywhere?

No. Everything is calculated in your browser and nothing is uploaded.