Everyday tool

Prime Number Checker

Enter a whole number and find out whether it is prime in one click.

Runs in your browser. No upload.

Checks integers up to one trillion locally.

—

About this tool

Prime Number Checker made simple.

A prime number is a whole number greater than 1 with exactly two positive divisors. For example, 97 is prime, while 1 and 91 are not. Check non-negative integers up to 1,000,000,000,000 in your browser.

Guide

Using Prime Number Checker

This page tells you whether a whole number is prime. Type a number, press the button, and read the verdict: Prime number or Not prime. When the number is not prime, the page also shows one way to split it into two factors, such as 91 = 7 × 13. Numbers up to one trillion are checked by plain division. Larger ones, up to 3,317,044,064,679,887,385,961,980, go through a fixed Miller-Rabin test whose answer is exact in that range. It suits students, puzzle fans and programmers. It does not list every prime factor, find the next prime, or accept negative numbers and decimals. Everything runs in your browser.

How to use it

  1. Click the Whole number box and type digits only. Leave out commas, spaces, decimal points and any minus sign.
  2. Press Check number. The answer appears in the result line under the buttons.
  3. Read the first words. Prime number means the only divisors are 1 and the number itself. Not prime means there is at least one other divisor.
  4. If the number is not prime, look after the dot for a line such as 91 = 7 × 13. It is one factor pair, not the full breakdown.
  5. If you see Enter a whole number, check for a decimal, a negative sign, a letter, an exponent such as 1e30, or a value past the upper limit.
  6. Press Clear to empty the box and the result, then test another number.

Worked examples

A small prime: 97

You enter
Number
97
You get
Result
Prime number

No whole number from 2 to 9 divides 97, and 9 is the largest to try because 10 times 10 is already more than 97. So only 1 and 97 divide it.

Run through the tool’s own code.

A small composite: 91

You enter
Number
91
You get
Result
Not prime · 91 = 7 × 13

91 looks odd and prime-like, but 7 times 13 is 91. For numbers up to one trillion the factor shown is the smallest one above 1.

Run through the tool’s own code.

The number 1

You enter
Number
1
You get
Result
Not prime

A prime needs exactly two divisors, and 1 has only one. The same goes for 0. Neither shows a factor line, because there is nothing to split.

Run through the tool’s own code.

A large composite: 998244359987710471

You enter
Number
998244359987710471
You get
Result
Not prime · 998244359987710471 = 998244353 × 1000000007

This is over one trillion, so the big-integer test runs. It is the product of two nine-digit primes, and the page finds and shows both.

Run through the tool’s own code.

The top of the range: 3317044064679887385961980

You enter
Number
3317044064679887385961980
You get
Result
Not prime · 3317044064679887385961980 = 2 × 1658522032339943692980990

This is the highest accepted value. It is even, so the answer is quick. Adding 1 gives a number the page refuses.

Run through the tool’s own code.

A decimal is refused

You enter
Number
3.5
You get
Error
Enter a whole number.

Primes are defined for whole numbers only. The same message appears for negatives, letters and large exponent notation such as 1e30.

Run through the tool’s own code.

When it helps

  • Check a homework answer when you are learning about primes and composite numbers.
  • Test a candidate number while building a puzzle, a riddle or a classroom exercise.
  • Confirm that a value you generated in a program really is prime before you use it as a hash table size.
  • Find one divisor of a number to see why it fails, for example in a divisibility lesson.
  • Settle an argument about whether a number such as 1 or 91 counts as prime.
  • Try out very large numbers to see how a deterministic primality test behaves.

Limits to keep in mind

  • Accepts whole numbers from 0 up to 3,317,044,064,679,887,385,961,980. The value 3,317,044,064,679,887,385,961,981 and anything above it is refused.
  • A refused number shows the same short message, Enter a whole number, even when the real cause is that it is too big.
  • Negative numbers, decimals, commas, spaces and letters are not accepted. Exponent notation is unreliable: 1e30 is refused, and so is 1e13, but 1e5 is read as 100000. Type plain digits.
  • Only one factor pair is shown for a composite number. This is not a prime factorisation, so 360 does not become 2 × 2 × 2 × 3 × 3 × 5.
  • Up to one trillion, the factor shown is the smallest divisor. Above that, it is the smallest one below 100,000 if there is one, otherwise whatever the search finds, which may not be the smallest.
  • Above one trillion, the factor search stops after about 0.3 seconds. A composite number made of two very large primes can show Not prime with no factor line. The verdict itself is not affected.

Tips

  • Paste the number into the box instead of retyping it. A single wrong digit in a long number changes the answer completely.
  • To check a result by hand, multiply the two factors shown and see whether you get your number back.
  • A number ending in 0, 2, 4, 5, 6 or 8 can only be prime if it is 2 or 5. This quick glance saves you a click.
  • If you need all the prime factors, run the second factor through the checker again and keep splitting until you see Prime number.
  • When a long composite shows no factor line, the verdict still stands. Treat the missing line as a time cut, not as a sign of a prime.

Sources

UsefulVerse guides

All guides

Common questions

About Prime Number Checker.

How do I check if a number is prime?

Type a whole number in the box and press Check number. The page replies with Prime number or Not prime. If it is not prime, it adds a line that splits the number into two factors, so you can see why it failed.

Is 1 a prime number?

No. A prime number is greater than 1 and has exactly two positive divisors: 1 and itself. The smallest prime is 2; 97 is another example.

What is the biggest number I can test?

The upper limit is 3,317,044,064,679,887,385,961,980, which has 25 digits. A number one higher, or larger, is refused with the message Enter a whole number. Smaller whole numbers, including 0 and 1, are all accepted.

How can the page be sure about such a huge number?

Above one trillion it runs a Miller-Rabin test using the first 13 prime bases. Researchers showed that no composite number below the limit passes all 13 bases, so the yes or no answer is exact there. It is not a guess or a probability.

Why does a composite number show only one factor?

The page is a primality checker, not a factoring tool. It shows a single pair of factors as evidence that the number is not prime. To get the full prime breakdown, test the second factor again and repeat.

Why is there sometimes no factor line for a big composite?

For numbers above one trillion, finding a factor can take long, so the search stops after about 0.3 seconds. When that happens you still see Not prime, just without the equation. The verdict comes from a separate test and stays correct.

Why do I get Enter a whole number?

The box rejects anything that is not a plain non-negative whole number. Decimals like 3.5, a minus sign, letters, commas and large exponent forms like 1e30 all trigger it. So does a value at or above 3,317,044,064,679,887,385,961,981.

Is 2 prime, and is it the only even prime?

Yes to both. The number 2 has only the divisors 1 and 2. Every other even number can also be divided by 2, so each has at least three divisors. Type 2 into the box and the page confirms Prime number.

Is my number sent anywhere?

No. The test runs in your own browser, and the status line says the number was checked locally. Nothing you type is uploaded, saved on a server or shared with anyone.

How is this different from a prime factorisation tool?

A factorisation tool returns every prime that multiplies to your number, such as 2 × 2 × 3 for 12. This page answers one question, prime or not, and shows at most one factor pair. It also does not find the next or previous prime.

Can I use it to make or test encryption keys?

It is meant for learning and checking numbers, not for building security. Real keys are hundreds of digits long, far above this limit, and should come from a trusted cryptography library. Use this page to explore how primes behave.

What is a prime number?

A prime number is an integer greater than 1 with exactly two positive divisors: 1 and itself. The number 1 is not prime.

How do I test whether a number is prime?

Enter a whole number and select Check number. The result tells you whether it is prime; composite numbers include a divisor other than 1 and themselves.

What numbers can this prime checker test?

It tests whole numbers from 0 through 1,000,000,000,000. Decimal values, negative values and prime factorization are not supported.