Prime Number Checker

Find out instantly whether any number is prime, even a 40-digit one. Composite numbers are broken into their prime factors, and you'll see all divisors, the previous and next primes, and whether the number is perfect, abundant or deficient. You can also list every prime in a range and find the nth prime.

  • 100% free
  • No sign-up
  • Private & local
  • Works on mobile

List primes in a range

 

Find the nth prime

Private by design: every calculation runs locally in your browser. Nothing you type is sent to a server or stored by us.

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, 17, 19, 23 and 29. A whole number greater than 1 that isn't prime is composite: it can be written as a product of smaller whole numbers, such as 12 = 2 × 2 × 3. The number 1 is neither prime nor composite, and 2 is the only even prime.

Primes are the "atoms" of arithmetic. The fundamental theorem of arithmetic says every whole number greater than 1 can be written as a product of primes in exactly one way. They're central to number theory and to modern life: the RSA encryption that protects online banking and shopping relies on the fact that multiplying two huge primes is easy, but factoring the result back is extraordinarily hard.

How to Check if a Number Is Prime

  1. Type a whole number of up to 40 digits.
  2. Read the verdict: prime or composite.
  3. For composites, see the prime factorisation and the smallest divisor.
  4. Explore further with the neighbouring primes, a range list or the nth prime.

How Primality Is Tested

For small numbers you can test divisibility by every prime up to the square root: to check 97, try 2, 3, 5 and 7 (since √97 ≈ 9.8). None divide it, so 97 is prime. For large numbers that would take far too long, so this checker uses the Miller–Rabin test with a fixed set of bases, which is proven to give correct answers for all numbers below 3.3 × 1024 and is extremely reliable beyond that. Composite numbers are factorised with trial division followed by Pollard's rho algorithm, and ranges of primes are listed with a fast segmented Sieve of Eratosthenes.

Prime Facts

FactValue
Primes below 10025
Primes below 1,000168
Primes below 1,000,00078,498
100th prime541
1,000th prime7,919
Largest known prime (2024)2136,279,841 − 1 (over 41 million digits)

Special Kinds of Numbers

  • Twin primes differ by 2, like 11 and 13, or 41 and 43.
  • Mersenne primes have the form 2n − 1, like 7, 31 and 127.
  • Perfect numbers equal the sum of their proper divisors: 6 = 1 + 2 + 3, and 28 = 1 + 2 + 4 + 7 + 14.
  • Abundant numbers have a divisor sum greater than themselves (12), and deficient numbers a smaller one (8).
  • Co-prime numbers share no prime factors, like 8 and 15.

Features

  • Big numbersTest numbers up to 40 digits instantly.
  • Prime factorisationWith exponents, for composites up to 30 digits.
  • DivisorsComplete list and perfect/abundant/deficient classification.
  • Nearest primesPrevious and next prime.
  • Range listingAll primes in any interval, with copy.
  • nth primeUp to the millionth prime.

Why Prime Numbers Matter

Prime numbers are the building blocks of all whole numbers: by the fundamental theorem of arithmetic, every integer greater than 1 is either prime or a unique product of primes. That uniqueness is what makes prime factorisation useful for simplifying fractions, finding the GCF and LCM, and working with ratios. Primes also secure the modern internet. RSA encryption multiplies two enormous primes together; multiplying is easy, but factoring the product back into its primes is so hard that it would take ordinary computers far longer than the age of the universe.

This checker uses the deterministic Miller–Rabin test, which proves primality for any number below 3.3 × 1024 in milliseconds, and Pollard's rho algorithm to split large composite numbers into their prime factors. Smaller numbers are handled by simple trial division. Everything runs locally in your browser, so even long numbers are never sent anywhere.

Patterns Among the Primes

  • 2 is the only even prime; every other even number is divisible by 2.
  • Every prime above 3 has the form 6k ± 1, e.g. 29 = 6×5 − 1 and 31 = 6×5 + 1.
  • Twin primes differ by 2 (11 and 13, 41 and 43). Whether there are infinitely many is still unproven.
  • There are 25 primes below 100 and 168 below 1,000, and they thin out slowly as numbers grow.

Frequently Asked Questions

Is 1 a prime number?

No. A prime must have exactly two distinct divisors, and 1 has only one. Excluding 1 keeps prime factorisations unique.

Is 1 a prime number?

No. A prime must have exactly two distinct divisors, and 1 has only one. This convention keeps prime factorisation unique.

Is 2 prime?

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

How many prime numbers are there?

Infinitely many, as Euclid proved around 300 BC. They become rarer as numbers grow, but never run out.

What is the fastest way to check a small number?

Test division by primes up to its square root. If none divide it evenly, it's prime.

Is 91 prime?

No. 91 = 7 × 13, a common trick question because it looks prime.