Math Solver Free

Prime Number Checker

Test primality with steps, or list all primes up to N — free.

97 is PRIME ✓

Step 1: trial-divide 97 by every integer up to √97 ≈ 9.85

Step 2: divisors tested: 2, 3, 5, 7, 9

Result: no divisor found — 97 has only the divisors 1 and itself.

What Makes a Number Prime

This checker answers one deceptively simple question: is this whole number prime, or can it be split into smaller factors? A prime is a whole number greater than 1 with exactly two divisors — 1 and itself — so 7 is prime but 9 is not, because 9 = 3 × 3. The tool tests any whole number up to one trillion by trial division and shows every divisor it tried, while list mode uses the Sieve of Eratosthenes to print all primes up to 5,000. Primes are the atoms of arithmetic: every whole number greater than 1 is either prime or a unique product of primes (the Fundamental Theorem of Arithmetic). They secure your bank transactions, generate secure keys, and still hide unsolved mysteries — nobody knows if there are infinitely many twin primes.

The Definition, Symbol by Symbol

Mathematicians state the test compactly: n is prime exactly when no integer d with 2 ≤ d ≤ √n divides n evenly. Here n is the number you are testing — the value typed into the box above. The letter d stands for a candidate divisor, any whole number you try dividing by. The symbol √n is the square root of n, the value that multiplied by itself gives n, so √97 ≈ 9.85. The notation d | n, read “d divides n”, means n ÷ d leaves no remainder. If one such d exists, n is composite; if none exists, n must be prime.

How to Use This Checker

  1. Choose the Check a number tab and type a whole number — anything up to 1,000,000,000,000 — into the “Enter a whole number” box.
  2. Read the instant verdict: PRIME, together with √n and the divisors tested, or NOT PRIME — composite, with the exact divisor found, such as 91 ÷ 7 = 13.
  3. To see primes in bulk, switch to the List primes up to N tab, enter any N from 2 to 5,000, and the tool reports how many primes there are and prints the full list.

The Trial Division Shortcut

To test n, you only need to trial-divide up to √n. Why? If n had a factor larger than √n, its partner factor would be smaller than √n — and you would already have found that one. For 97, that means testing just 2, 3, 5, and 7.

Special Cases to Memorize

  • 1 is neither prime nor composite.
  • 2 is the only even prime — every other even number is divisible by 2.
  • 0 and negatives are not prime by definition.

Breaking numbers into prime factors? Try our factoring calculator.

Worked Example 1: Is 91 Prime?

Many students guess yes — 91 is odd and clearly not a multiple of 3 or 5 — so work it properly. First find the limit: √91 ≈ 9.54, so you only test whole numbers up to 9, and in practice the primes 2, 3, 5, and 7. The number 91 is odd, so 2 fails. Its digits sum to 9 + 1 = 10, not a multiple of 3, so 3 fails. It does not end in 0 or 5, so 5 fails. Now try 7: 7 × 13 = 91, so 91 ÷ 7 = 13 exactly, with no remainder. A genuine divisor exists, so 91 is composite — it equals 7 × 13. This is the classic trap: 91, 119, and 221 all look prime at a glance, yet each splits into tidy small factors.

Worked Example 2: Testing 97, Then Listing Primes to 30

For 97, √97 ≈ 9.85, so again the candidates are 2, 3, 5, and 7. The number 97 is odd, ruling out 2. Its digits sum to 9 + 7 = 16, not a multiple of 3, ruling out 3. It ends in 7 rather than 0 or 5, ruling out 5. For 7, notice 7 × 13 = 91 and 7 × 14 = 98, so 97 falls strictly between two consecutive multiples of 7 and cannot divide evenly. No candidate works, so 97 is prime — in fact the largest two-digit prime. Now switch to list mode with N = 30: the sieve crosses out every multiple of 2, 3, and 5, leaving 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29 — exactly 10 primes, matching the count the tool reports.

When a Prime Checker Earns Its Keep

Reach for this tool when homework asks you to factor a number and you first need to know whether factoring is even possible — a prime has nothing to break down. Programmers run quick primality checks when generating test data, designing hash functions, or tackling coding-challenge problems about prime gaps. Teachers use list mode to print every prime up to 100 for a classroom wall chart in seconds. And anyone reading about RSA encryption, where two large primes multiplied together guard a secret key, can experiment here with small primes to feel why recovering those factors is so difficult.

Three Mistakes That Catch Everyone

  • Calling 1 prime. A prime needs exactly two divisors; 1 has only one — itself — so it sits in a category of its own, neither prime nor composite.
  • Stopping after 2, 3, and 5. The number 91 slips past all three, yet 7 catches it instantly. Always test every candidate up to √n before declaring a number prime.
  • Assuming every odd number is prime. Oddness only rules out the factor 2. Plenty of odd numbers — 9, 15, 21, 25, 27, 33, 35 — are composite, so odd is a hint, never a verdict.

Frequently Asked Questions

What is a prime number?

A prime number is a whole number greater than 1 whose only divisors are 1 and itself, which means it has exactly two divisors. The first primes are 2, 3, 5, 7, 11, and 13. Every other whole number greater than 1 is composite — it can be built by multiplying primes together — except 1, which is neither.

Is 1 a prime number?

No. By definition, a prime must be greater than 1 and have exactly two divisors, but 1 has only one divisor: itself. Mathematicians classify 1 as neither prime nor composite. Excluding it also keeps the Fundamental Theorem of Arithmetic clean — factorisations into primes stay unique instead of allowing endless extra 1s.

How do you check if a large number is prime?

Use trial division: try dividing by every integer from 2 up to the square root of the number. If one divides evenly, the number is composite; if none do, it is prime. This checker does exactly that for numbers up to one trillion and shows each divisor it tested, so you can follow the working.

Is this prime number checker free?

Yes — every tool on Math Solver Free is free with no sign-up, and all calculations run in your browser. You can test single numbers up to one trillion, or list every prime up to 5,000, as many times as you like; nothing you type is sent to a server or stored.

Why does trial division stop at the square root?

Because factors come in pairs. If n = a × b and a were larger than √n, then b would have to be smaller than √n — so the smaller partner always shows up first. Testing beyond √n only repeats divisors you have already ruled out, which is why checking 97 needs just the candidates 2, 3, 5, and 7.

What is the difference between prime and composite numbers?

A prime has exactly two divisors, 1 and itself, while a composite number has at least one more divisor besides those two — 12, for instance, is divisible by 2, 3, 4, and 6. The number 1 is the exception that fits neither label. Every composite number breaks down into a unique product of primes.

Related Tools & Guides

About the MathSolverFree Team

The MathSolverFree Team builds and maintains the calculators and step-by-step solvers on this site. Every tool is checked against worked textbook examples before it is published, and the method behind each solver is written out in full — in the worked examples on the page and in our guides — so you can see exactly how an answer is reached, not just the answer itself.

How we build and test our tools·More about the team