Loading live prices...

Prime Number Checker

Find out instantly whether a number is prime — and why. Enter any whole number up to 1,000,000,000,000 and the checker tells you if it is prime, shows its smallest divisor if it is not, or lists every prime up to your number. It runs entirely in your browser: free, instant, no sign-in.

How the prime number checker works

A prime number is a whole number greater than 1 whose only divisors are 1 and itself. To check a number, the tool tries dividing it by every possible divisor up to its square root: if none divides it evenly, it is prime; the first divisor that does divide it evenly is its smallest divisor, which proves it is not prime. For example, 91 is not prime because 91 = 7 × 13, while 97 is prime because no number from 2 up to 9 (the square root of 97 is about 9.8) divides it. The list mode uses the Sieve of Eratosthenes: it starts with every number from 2 up to your limit and crosses out the multiples of each prime in turn, leaving only the primes behind.

Numbers 0 and 1 are not prime by definition — a prime must have exactly two divisors, and 0 and 1 do not. Negative numbers and decimals are never prime either, and the checker says so plainly instead of guessing.

A prime number is a whole number greater than 1 whose only divisors are 1 and itself — 2, 3, 5, 7, 11, 13, 17, 19, 23 and 29 are the first ten. The Prime Number Checker answers one question about any number you give it: is it prime, and why? Type a number and it gives a clear verdict, explains the reasoning, and — if the number is not prime — shows its smallest divisor as a factorisation, for example 91 = 7 × 13. Switch to list mode and it lists every prime up to your number, with a count, using the Sieve of Eratosthenes. It runs entirely in your browser, so nothing you enter is uploaded anywhere and there is no sign-in and no limit on how often you use it.

The check mode handles whole numbers up to 1,000,000,000,000 (10^12). The list mode goes up to 10,000, which keeps the list readable on the page. Numbers 0 and 1, negative numbers and decimals are handled explicitly: 0 and 1 are not prime by definition, negative numbers are never prime, and a decimal such as 2.5 is rejected with a clear message instead of a guessed answer.

How to use the checker, step by step

There are two modes and one input. Pick the mode first, then enter your number and press the button — or press Enter.

  • Step 1 — Pick a mode. “Check a number” tests one number. “List primes up to N” lists every prime from 2 up to the number you enter.
  • Step 2 — Enter a whole number. In check mode, enter the number you want to test — for example 97. In list mode, enter the upper limit — for example 100 to list every prime up to 100.
  • Step 3 — Press the button. Check mode shows a verdict (“97 is prime” or “91 is NOT prime”) with a short explanation. List mode shows how many primes there are up to your number, followed by the full list.
  • Step 4 — Read the explanation. For a prime, the checker says it checked every possible divisor up to the square root and found none. For a composite, it shows the factorisation with the smallest divisor, for example 221 = 13 × 17.

How the maths works

To test whether a number n is prime, you only need to try dividing it by numbers up to its square root. That is enough because divisors come in pairs: if n has a divisor larger than its square root, the matching divisor in the pair is smaller than the square root, so it would already have been found. The checker tries 2 first, then every odd number up to the square root. If none divides n evenly, n is prime. If one does, that first divisor is the smallest divisor, and n is not prime.

  • 97 is prime. Its square root is about 9.8, so only 2, 3, 5 and 7 need checking. None divides 97 evenly (97 ÷ 7 = 13 remainder 6), so 97 is prime.
  • 91 is not prime. Its square root is about 9.5, so 2, 3, 5 and 7 are checked. 7 divides 91 evenly: 91 = 7 × 13, so 7 is the smallest divisor and 91 is composite.
  • 221 is not prime. Its square root is about 14.9, so 2, 3, 5, 7, 11 and 13 are checked. 13 divides 221 evenly: 221 = 13 × 17, so 13 is the smallest divisor. 221 looks prime at first glance because neither 2, 3, 5, 7 nor 11 divides it — 13 is the divisor that catches it.
  • 2 is prime. It is the smallest prime number and the only even prime. Every other even number is divisible by 2, so no other even number can be prime.

The list mode uses the Sieve of Eratosthenes, a method from ancient Greece. Write down every number from 2 up to your limit, then cross out the multiples of 2, then the multiples of 3, then the multiples of 5, and so on — each time starting from the next number that has not been crossed out. When you finish, the numbers left standing are exactly the primes. It is the fastest simple way to find all primes up to a limit.

Worked examples

Example 1 — Is 97 prime? Yes. The square root of 97 is about 9.8, so only 2, 3, 5 and 7 need checking. 97 is odd, so 2 does not divide it; its digits add to 16, so 3 does not divide it; it does not end in 0 or 5, so 5 does not divide it; and 97 ÷ 7 = 13 remainder 6. No divisor found, so 97 is prime.

Example 2 — Is 91 prime? No. 91 = 7 × 13. The checker tries 2 (91 is odd), 3 (9 + 1 = 10, not divisible by 3), 5 (91 does not end in 0 or 5) and then 7 — and 91 ÷ 7 = 13 exactly. The smallest divisor is 7.

Example 3 — Is 100 prime? No. 100 = 2 × 50. The smallest divisor is 2 — 100 is even, so it is divisible by 2 straight away.

Example 4 — Is 104,729 prime? Yes. 104,729 is the 10,000th prime number. Its square root is about 323.6, so the checker tries every odd divisor from 3 up to 323 and finds none that divides it evenly.

Example 5 — Primes up to 30. There are 10 primes up to 30: 2, 3, 5, 7, 11, 13, 17, 19, 23 and 29. Primes up to 100 number 25 in total — the 15 extra primes between 31 and 100 are 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89 and 97.

Example 6 — Is 1 prime? No. A prime number must have exactly two divisors: 1 and itself. The number 1 has only one divisor — itself — so it is neither prime nor composite. It is in a category of its own, called a unit.

Common mistakes

  • Thinking 1 is prime. It is the most common mistake in primality. 1 has only one divisor, so it fails the definition — a prime must have exactly two divisors. 1 is not prime, and it is not composite either.
  • Thinking all odd numbers are prime. Most odd numbers are not prime: 9 = 3 × 3, 15 = 3 × 5, 21 = 3 × 7, 27 = 3 × 9 and 91 = 7 × 13 are all odd and all composite. Being odd only rules out 2 as a divisor.
  • Thinking 2 is not prime because it is even. 2 is prime — the smallest prime of all, and the only even one. “Even” means divisible by 2, and 2’s only divisors are 1 and 2, which is exactly the definition of prime.
  • Stopping the check too early. 221 looks prime if you only try 2, 3, 5, 7 and 11 — it takes 13 to catch it. Always check up to the square root: for 221 that means up to 14, which includes 13.
  • Checking past the square root. The other direction is wasted work, not a mistake in the answer: once you have checked up to the square root and found nothing, the number is prime — any divisor larger than the square root would have a matching partner smaller than it, which you already tried.

Related tools

The prime number checker sits in the Math Tools group, and three companion tools cover the rest of everyday number maths.

  • LCM & GCF Calculator — find the least common multiple and greatest common factor of two numbers, with the factor steps shown.
  • Ratio Calculator — simplify ratios and solve missing values in a proportion.
  • Percentage Calculator — work out any percentage, percentage increase or decrease, or what percentage one number is of another.

For all of ToolZana’s free tools, start at the ToolZana home page.

The short version

The Prime Number Checker tests whether a whole number up to 1,000,000,000,000 is prime by trial division up to its square root: 97 is prime because nothing from 2 to 9 divides it, 91 is not prime because 91 = 7 × 13, and 221 is not prime because 221 = 13 × 17. 0 and 1 are not prime, negative numbers are never prime, and decimals are rejected. List mode uses the Sieve of Eratosthenes: there are 10 primes up to 30 and 25 primes up to 100. The tool is free, runs entirely in your browser, and needs no sign-in.

Frequently Asked Questions

What is a prime number checker?

A prime number checker tests whether a whole number is prime — that is, whether its only divisors are 1 and itself. Enter a number and it gives a verdict, explains the reasoning, and shows the smallest divisor if the number is not prime, for example 91 = 7 × 13. The ToolZana checker also has a list mode that shows every prime up to a number you choose, with a count. It runs entirely in your browser, with no sign-in and no limit on how often you use it.

How do I check if a number is prime?

Enter the number in check mode and press “Check if prime”. The tool tries dividing it by 2, then by every odd number up to its square root. If none divides it evenly, the number is prime; the first divisor that does divide it evenly is the smallest divisor, which proves it is not prime. For 97, only 2, 3, 5 and 7 need checking, because the square root of 97 is about 9.8 — and none of them divides 97, so 97 is prime.

Is 1 a prime number?

No. A prime number must have exactly two divisors: 1 and itself. The number 1 has only one divisor — itself — so it does not meet the definition. It is also not composite: composite numbers have more than two divisors, and 1 has just one. Mathematicians call 1 a unit, a category of its own. The smallest prime number is 2.

Is 0 a prime number?

No. A prime number must be greater than 1, and 0 is not. 0 is divisible by every number — 0 divided by any number is 0 — so it has far more than two divisors. 0 is not composite either; like 1, it sits outside the prime/composite split entirely. The checker says so plainly: 0 is not prime, because a prime must be greater than 1.

Is 2 a prime number?

Yes. 2 is the smallest prime number and the only even prime. Its only divisors are 1 and 2, which is exactly the definition of a prime number. Every other even number is divisible by 2 as well as by 1 and itself, so no other even number can be prime. That is why the checker tests 2 first and then only odd numbers — once 2 is ruled out, no other even divisor is possible.

Is 91 a prime number?

No. 91 = 7 × 13, so 7 is its smallest divisor. 91 is a classic trap because it looks prime: it is odd, it does not end in 5, and its digits add to 10, so neither 2, 3 nor 5 divides it. But 91 ÷ 7 = 13 exactly. The checker catches it by testing every divisor up to the square root of 91, which is about 9.5 — and 7 is in that range.

How do you find the smallest divisor of a number?

Try dividing the number by 2 first, then by 3, 5, 7, 11 and so on, in increasing order, up to its square root. The first number that divides it evenly is the smallest divisor. For 221, the tries go 2, 3, 5, 7, 11 — none works — and then 13 divides it: 221 = 13 × 17, so 13 is the smallest divisor. If no divisor is found up to the square root, the number has no smallest divisor because it is prime.

What are the prime numbers up to 100?

There are 25 prime numbers up to 100: 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. Enter 100 in the checker’s list mode to see the same list with the count. The primes thin out as numbers grow: there are 25 primes up to 100, 168 up to 1,000, and 1,229 up to 10,000.

How many prime numbers are there up to 1,000?

There are 168 prime numbers up to 1,000. The count grows more slowly than the numbers themselves: 25 primes up to 100, 168 up to 1,000, 1,229 up to 10,000 and 9,592 up to 100,000. The list mode on this page goes up to 10,000, where the count is 1,229. The 1,000th prime is 7,919 and the 10,000th prime is 104,729.

What is the largest prime number?

There is no largest prime number — Euclid proved over 2,000 years ago that there are infinitely many primes, because multiplying all known primes together and adding 1 always produces a number with a prime factor not in the list. The largest prime actually found so far is a Mersenne prime, 2^136279841 − 1, discovered in 2024, with 41,024,320 digits. New record primes are still found by volunteers running prime-searching software on ordinary computers.

Why are prime numbers important?

Prime numbers are the building blocks of all whole numbers: every whole number greater than 1 is either prime or a product of primes, which is called the fundamental theorem of arithmetic. Their most famous practical use is in cryptography — the RSA encryption that protects online banking and shopping relies on the fact that multiplying two large primes is easy while factoring the result back into those primes is extremely hard. Primes also appear in computer hashing, random-number generation and error-correcting codes.

Is the prime number checker free?

Yes — the Prime Number Checker is completely free, with no sign-in and no limits. It runs entirely in your browser, so nothing you enter is uploaded anywhere, and you can use it as often as you like, for numbers up to 1,000,000,000,000 in check mode and lists up to 10,000 in list mode.