Prime Number Checker

Find out if a number is prime, for any whole number up to 10¹⁵. See its prime factorization, divisors and nearest primes, check up to 100 numbers at once, or list every prime in a range.

Up to 10¹⁵
Batch & Range
Exact Results
🔢
Primality Test
🎯
Factorization
✨
Special Primes
📊
Detailed Stats
Powered by orbit2x.com
0 digits
Checking…

Check Whether a Number Is Prime

A prime number is a whole number greater than 1 whose only divisors are 1 and itself, such as 2, 3, 5, 7 and 11. Any other whole number greater than 1 is composite, meaning it can be written as a product of smaller primes. This tool tells you which one a number is, for any whole number from 1 to 10¹⁵ (one quadrillion).

For a composite number it shows the prime factorization and the divisors. For a prime it shows the primes just before and after it, and whether it's a twin, Sophie Germain or Mersenne prime. You can also check up to 100 numbers at once, or list every prime between two numbers.

How to Use the Prime Checker

  1. Single number: type a whole number and press Check number (or Ctrl+Enter) for the full breakdown.
  2. Batch: paste up to 100 numbers, separated by commas or new lines. Each one gets prime or composite, its divisor count and its factorization. Anything that isn't a whole number is listed as skipped.
  3. Primes in a range: enter a start and end number to list every prime between them, inclusive. The range can cover up to 10,000 numbers.

Numbers are sent to the Orbit2x server to be checked, and the result comes back to the page. Only plain numbers are accepted: no decimals, commas inside numbers, or expressions like 2^31.

Examples

Example numbers and what the prime checker reports for each
NumberResultWhy it's interesting
97PrimeThe 25th prime. Nearest primes: 89 and 101.
91Composite: 7 × 13Looks prime because it's odd and not divisible by 3 or 5.
561Composite: 3 × 11 × 17The smallest Carmichael number, which fools the simple Fermat test.
2147483647Prime2³¹ − 1, a Mersenne prime. Nearest primes: 2147483629 and 2147483659.
28Composite: 2² × 7A perfect number: 1 + 2 + 4 + 7 + 14 = 28.
12Composite: 2² × 3Abundant: its proper divisors add up to 16, more than 12.
1000000000000000Composite: 2¹⁵ × 5¹⁵10¹⁵, the largest number the tool accepts. It has 256 divisors.
1Neither1 has only one divisor, so it's neither prime nor composite.

Range mode: there are 25 primes from 1 to 100, 21 from 100 to 200, and 1,229 from 1 to 10,000.

What the Result Shows

Prime factorization
The number written as a product of primes, with exponents for repeated factors. 60 is shown as 2² × 3 × 5. Every whole number above 1 has exactly one such factorization.
Divisors
All whole numbers that divide it exactly, and their sum. 60 has 12 divisors that add up to 168. The full list is shown for numbers up to 1,000,000; above that you get the count and the sum only.
Perfect, abundant or deficient
Compares the number with the sum of its proper divisors (all divisors except itself). Equal makes it perfect (6, 28, 496), larger makes it abundant (12), smaller makes it deficient. Every prime is deficient.
Previous and next prime
The nearest primes on either side. For primes up to 10,000 the tool also gives its position in the list of primes, so 97 is the 25th prime.
Twin, Sophie Germain and Mersenne primes
A twin prime has another prime 2 away from it (11 and 13). A Sophie Germain prime p is one where 2p + 1 is also prime (11, because 23 is prime). A Mersenne prime is a prime of the form 2ᵖ − 1, such as 7, 31 and 2147483647.

How the Check Works

For numbers below 1,000 the tool uses trial division: it tries dividing by 2 and then by every odd number up to the square root. You only need to go as far as the square root, because if n = a × b then a and b can't both be larger than √n.

For 1,000 and above it uses the Miller–Rabin test with the first 12 primes (2 to 37) as bases. Miller–Rabin is usually described as probabilistic, but with these fixed bases it's proven to give the correct answer for every number below 2⁶⁴, well above this tool's 10¹⁵ limit. So results here are exact, not "probably prime".

Factorization uses trial division by 2 and then by odd numbers up to the square root of what's left. At 10¹⁵ that's at most about 16 million divisions, which is why the tool stops there.

Frequently Asked Questions

Is 1 a prime number?

No. A prime needs exactly two different divisors, 1 and itself, and 1 only has one. It isn't composite either. Leaving 1 out is what makes every number's prime factorization unique.

Is 2 a prime number?

Yes. 2 is the smallest prime and the only even one, since every other even number is divisible by 2.

How many primes are there below 100?

25: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89 and 97. Use the range mode to list primes in any other interval.

What is the largest number I can check?

10¹⁵, which is 1,000,000,000,000,000. The largest prime below that is 999,999,999,999,989. Larger numbers, including the primes used in RSA encryption (hundreds of digits long), need arbitrary-precision software.

Why does an odd number like 91 turn out not to be prime?

Being odd only rules out the factor 2. 91 = 7 × 13, and numbers like 1001 = 7 × 11 × 13 catch people out the same way. The factorization shows exactly which primes divide the number.

Can negative numbers or 0 be prime?

No. Primes are defined as whole numbers greater than 1, so the tool only accepts numbers from 1 upward.

Related Tools