Prime Number Checker — Is It Prime? Check Any Number
Is 91 prime? Most people say yes — but 91 = 7 × 13, so it is not. This free prime number checker tests any number and shows every divisor it tried, lists all the primes in a range, and finds the next or previous prime. The honest surprise: 97 is prime, and it is the 25th prime — the largest prime under 100.
Prime Number Checker: Check a Number, List Primes, Find the Next Prime
Pick the mode that matches your question. Calculations run in your browser.
What Is a Prime Number Checker?
A prime number checker answers one question about any whole number: is it prime, or does it have a factor hiding inside it? Give it 91 and it finds 7 — 91 = 7 × 13, so 91 is not prime. Give it 97 and it tests 2, 3, 5 and 7 — the primes up to √97 ≈ 9.85 — finds no divisor, and calls 97 prime. Give it 1 and it says neither prime nor composite, because 1 has only one divisor. Give it a range like 1 to 100 and it lists all 25 primes, ending at 97. Give it 97 in next-and-previous mode and it returns 89 below and 101 above. Every answer shows the divisors tested and the step-by-step working, so you can check it by hand.
How to Use the Prime Number Checker
The tool has three modes so you can start with whatever your question is.
- Choose a mode that matches your question (or tap a preset to load a worked example).
- Enter your number — a whole number from 0 to 1,000,000,000,000 for checking, or a range up to 1,000,000 for listing.
- Select Calculate to generate the result cards.
- Read the note under the cards for the step-by-step working and a check you can verify by hand.
The built-in check re-derives the answer a second way — the factor multiplied back out (7 × 13 = 91), the divisor count (a prime has exactly two), or the sieve count for a range — so a wrong keystroke shows up immediately. Only whole numbers are accepted: primes are defined for whole numbers, so decimals and fractions have no verdict here.
What Is a Prime Number?
A prime number is a whole number greater than 1 that has exactly two divisors: 1 and itself. 2 is prime (divisors 1 and 2), 3 is prime (1 and 3), 5 is prime (1 and 5), 7 is prime (1 and 7). A whole number greater than 1 that is not prime is composite — it has a third divisor hiding inside it. 4 is composite (divisors 1, 2 and 4), 6 is composite (1, 2, 3 and 6), 9 is composite (1, 3 and 9), 91 is composite (1, 7, 13 and 91).
| Number | Divisors | How many? | Verdict |
|---|---|---|---|
| 0 | Divisible by every whole number | Infinitely many | Neither prime nor composite |
| 1 | 1 | 1 | Neither prime nor composite |
| 2 | 1, 2 | 2 | Prime — smallest prime, only even prime |
| 3 | 1, 3 | 2 | Prime |
| 4 | 1, 2, 4 | 3 | Composite — 4 = 2 × 2 |
| 6 | 1, 2, 3, 6 | 4 | Composite — 6 = 2 × 3 |
| 9 | 1, 3, 9 | 3 | Composite — 9 = 3 × 3 |
| 91 | 1, 7, 13, 91 | 4 | Composite — 91 = 7 × 13 |
| 97 | 1, 97 | 2 | Prime — 25th prime |
| 100 | 1, 2, 4, 5, 10, 20, 25, 50, 100 | 9 | Composite — 100 = 2² × 5² |
Why 2 Is the Only Even Prime
Every even number is divisible by 2, so every even number above 2 has at least three divisors — 1, 2 and itself — and is composite. 2 escapes only because its "itself" is 2: its divisors are 1 and 2, exactly two. That makes 2 the smallest prime and the only even prime, and it is why trial division always tests 2 first and then only odd numbers: once 2 is ruled out, every even divisor is ruled out with it.
Twin Primes and Prime Gaps
Primes that differ by 2 are called twin primes — (3, 5), (5, 7), (11, 13), (17, 19), (29, 31), (41, 43), (59, 61) and (71, 73) are the 8 pairs up to 100. Between primes there are gaps — stretches with no prime at all. The gap from 89 to 97 is 8 (90, 91, 92, 93, 94, 95 and 96 are all composite), and the gap from 113 to 127 is 14. Gaps grow as numbers get bigger, which is why the 100th prime is all the way out at 541 even though the 25th prime is only 97.
Prime Number Checker Worked Examples
Every row below is computed exactly — hand-verified in Python — so you can check each one by hand.
| Number | √n (2 dp) | Prime divisors tested | First factor found | Verdict |
|---|---|---|---|---|
| 0 | 0.00 | — (special case) | — | Neither prime nor composite |
| 1 | 1.00 | — (special case) | — | Neither prime nor composite |
| 2 | 1.41 | None needed (2 is the first prime) | — | Prime — smallest prime, only even prime |
| 49 | 7.00 | 2, 3, 5, 7 | 7 (49 = 7 × 7) | Not prime |
| 91 | 9.54 | 2, 3, 5, 7 | 7 (91 = 7 × 13) | Not prime |
| 97 | 9.85 | 2, 3, 5, 7 | None | Prime — 25th prime |
| 100 | 10.00 | 2 | 2 (100 = 2² × 5²) | Not prime |
| 101 | 10.05 | 2, 3, 5, 7 | None | Prime — next prime after 97 |
| 111 | 10.54 | 2, 3 | 3 (111 = 3 × 37) | Not prime |
| 121 | 11.00 | 2, 3, 5, 7, 11 | 11 (121 = 11 × 11) | Not prime |
| 143 | 11.96 | 2, 3, 5, 7, 11 | 11 (143 = 11 × 13) | Not prime |
| 541 | 23.26 | 2, 3, 5, 7, 11, 13, 17, 19, 23 | None | Prime — 100th prime |
Prime Numbers From 1 to 100
There are 25 primes from 1 to 100. The list below is complete — count them, and the last one is 97, the largest prime under 100.
| Range | Primes in the range | Count |
|---|---|---|
| 1–10 | 2, 3, 5, 7 | 4 |
| 11–20 | 11, 13, 17, 19 | 4 |
| 21–30 | 23, 29 | 2 |
| 31–40 | 31, 37 | 2 |
| 41–50 | 41, 43, 47 | 3 |
| 51–60 | 53, 59 | 2 |
| 61–70 | 61, 67 | 2 |
| 71–80 | 71, 73, 79 | 3 |
| 81–90 | 83, 89 | 2 |
| 91–100 | 97 | 1 |
| Total 1–100 | All 25 primes above | 25 |
The Nth Prime: 25th Is 97, 100th Is 541
Count the primes in order and 97 is the 25th — which is the same fact as "there are 25 primes from 1 to 100", because 97 is the last of them. Keep counting and the 50th prime is 229, and the 100th prime is 541. The gaps between them tell the story: 25 primes fit in the first 100 numbers, but the next 75 primes need 441 more numbers to reach 541.
How to Check If a Number Is Prime, Step by Step
Follow this recipe for the classic example — is 97 prime?
- Find the square root: √97 ≈ 9.85. You only need to test divisors up to the square root — if 97 had a factor bigger than 9.85, its partner factor would be smaller than 9.85, and you would already have found it.
- List the primes up to the square root: 2, 3, 5 and 7. (9 is not prime, so it is never tested.)
- Test 2: 97 is odd, so 2 does not divide it. 97 ÷ 2 = 48.5.
- Test 3: the digits sum to 9 + 7 = 16, which is not divisible by 3, so 3 does not divide it. 97 ÷ 3 = 32.33.
- Test 5: 97 does not end in 0 or 5, so 5 does not divide it. 97 ÷ 5 = 19.4.
- Test 7: 7 × 13 = 91 and 7 × 14 = 98, so 97 sits between two multiples of 7 — 7 does not divide it. 97 ÷ 7 = 13.86.
- Conclude: no prime up to √97 divides 97, so 97 has exactly two divisors — 1 and 97 — and is prime.
Common Mistakes With Prime Numbers
1. Calling 91 prime — the 7 × 13 trap
91 looks prime: it is odd, it does not end in 5, and its digits sum to 10, so 3 does not divide it. But 91 = 7 × 13, and 7 is inside the square-root limit (√91 ≈ 9.54), so trial division catches it on the fourth test. The trap is stopping after 2, 3 and 5 — the tests that 91 passes — and never trying 7.
2. Calling 1 prime
1 has exactly one divisor — itself — so it fails the "exactly two divisors" test. It is neither prime nor composite, and the same goes for 0. Textbooks used to call 1 prime, which is why the mistake survives; the modern definition excludes it so that every whole number has exactly one prime factorization.
3. Calling 2 composite — or saying no even number is prime
2 is prime: its divisors are 1 and 2, exactly two. It is the only even prime, because every other even number is divisible by 2 as well as by 1 and itself. "Prime numbers are odd" is wrong by exactly one number — and that one number is the most important prime of all.
4. Calling every odd number prime
Odd does not mean prime. 9 = 3 × 3, 15 = 3 × 5, 21 = 3 × 7, 27 = 3 × 9, 49 = 7 × 7, 111 = 3 × 37 and 143 = 11 × 13 are all odd and all composite. Oddness only rules out 2 as a factor; the other primes still have to be tested.
5. Testing every number up to n − 1
To check 97 you do not need 95 divisions — you need 4. Trial division stops at √n, because any factor bigger than √n comes with a partner smaller than √n that you would already have found. Testing 11, 13 or 17 for 97 is wasted work: √97 ≈ 9.85, so 7 is the last test that matters.
6. Stopping at the first factor that fails — or trusting a single test
One failed test proves nothing: 91 passes the tests for 2, 3 and 5 and still fails on 7. A number is prime only when every prime up to its square root has been tested and none divides it. The verdict comes from the full list, not from the first division.
Benefits and Limitations
Benefits
- Tests any whole number up to 1,000,000,000,000 and shows the trial-division working, not just a yes/no.
- Lists every prime in a range up to 1,000,000, with the count, the first and the last prime.
- Finds the next and previous prime for any number, with the gap in each direction.
- Presets load the landmark examples — 91 = 7 × 13, 97 prime, 111 = 3 × 37, 143 = 11 × 13, and the special cases 2, 1, 0 and 100 — with one tap.
- Every answer carries the step-by-step working, so the method — not just the verdict — is visible.
- Responsive on phones, tablets and desktops.
Limitations
- Only whole numbers from 0 to 1,000,000,000,000 can be checked; decimals, fractions and negative numbers have no prime verdict.
- Listing primes is capped at an end value of 1,000,000 and a displayed list of 200 primes, so very large ranges show the count, not every prime.
- Results use JavaScript number arithmetic, so inputs above the stated cap are rejected rather than approximated.
Quick Definitions
| Question | Direct Answer |
|---|---|
| What is a prime number checker? | A tool that tests whether a whole number is prime. 91 → not prime (91 = 7 × 13); 97 → prime; 1 → neither prime nor composite; primes 1–100 → 25 primes. |
| What is a prime number? | A whole number greater than 1 with exactly two divisors: 1 and itself. 2, 3, 5, 7, 11, 13, 17, 19 are the primes under 20. |
| Is 91 prime? | No — 91 = 7 × 13. Trial division tests 2, 3, 5 and 7 (up to √91 ≈ 9.54), and 7 divides 91 exactly: 91 ÷ 7 = 13. |
| Is 97 prime? | Yes — no prime up to √97 ≈ 9.85 (2, 3, 5, 7) divides it. 97 is the 25th prime and the largest prime under 100. |
| Is 1 a prime number? | No — 1 is neither prime nor composite. A prime needs exactly two divisors, but 1 has only one divisor: itself. 0 is neither prime nor composite either. |
| How many primes are there from 1 to 100? | 25 primes: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97. |
| What is the 100th prime number? | 541. The 25th prime is 97 and the 50th prime is 229; primes thin out as numbers grow, so the 100th prime is all the way out at 541. |
| What is the next prime after 97? | 101 — and the previous prime before 97 is 89. The gap from 89 to 97 is 8, the longest gap under 100. |
Frequently Asked Questions
Is 91 prime?
No — 91 = 7 × 13. Trial division tests the primes up to √91 ≈ 9.54 — 2, 3, 5 and 7 — and 7 divides 91 exactly: 91 ÷ 7 = 13. 91 passes the tests for 2, 3 and 5, which is why it fools almost everyone; it only falls to 7. The full working is in Is 91 Prime? Why 91 = 7 × 13 Fools Almost Everyone.
Is 1 a prime number?
No — 1 is neither prime nor composite. A prime number has exactly two divisors, 1 and itself, but 1 has only one divisor: itself. 0 is neither prime nor composite either — it is divisible by every whole number. The full explanation is in Is 1 a Prime Number? Why 1 Is Neither Prime nor Composite.
Is 97 prime?
Yes. √97 ≈ 9.85, so only the primes 2, 3, 5 and 7 need testing, and none of them divides 97. 97 is the 25th prime and the largest prime under 100; the next prime after it is 101 and the previous prime before it is 89.
How do you check if a number is prime?
Use trial division: test prime divisors up to the square root of the number. For 97, √97 ≈ 9.85, so test 2, 3, 5 and 7 only — four divisions, not 95. If none divides the number, it is prime; the first divisor that divides it is a factor, and the number is composite.
What is the 25th prime number?
97. There are 25 primes from 1 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, 97 — and 97 is the last of them, so it is the 25th prime.
What is the 100th prime number?
541. Primes thin out as numbers grow: there are 25 primes from 1 to 100 but 168 primes from 1 to 1,000, and the 100th prime is 541. The 50th prime is 229.
Related Math Tools
Prime Number Checker Methodology
This calculator tests primality by trial division using only prime divisors, lists primes with the sieve of Eratosthenes, and finds neighbouring primes by stepping outward and testing each candidate. All arithmetic runs in JavaScript (whole numbers up to 1,000,000,000,000 for checking; ranges up to 1,000,000 for listing).
Check mode first handles the special cases: 0 and 1 are neither prime nor composite, and 2 is prime. For n ≥ 3 it builds the primes up to √n by sieve, then tests them in order — 91 is caught by 7 (91 = 7 × 13), 111 by 3 (111 = 3 × 37), 143 by 11 (143 = 11 × 13), and 97 survives all four tests (2, 3, 5, 7) up to √97 ≈ 9.85. The verdict is cross-checked two ways: the factor multiplied back out (7 × 13 = 91) and the divisor count from the factorization (a prime has exactly two divisors). Range mode runs the sieve of Eratosthenes up to the end value and counts the primes in the range — 25 from 1 to 100, 8 from 1 to 20, 1 from 90 to 100 (97 only), 5 from 100 to 120. Next-and-previous mode steps outward from n one number at a time, testing each candidate by trial division — from 97 it finds 89 below (gap 8) and 101 above (gap 4). Every mode rejects non-whole numbers and numbers above the stated caps. The page is intended as an educational calculator and verification tool.
Mathematical References
Is 91 Prime? Check Yours
Enter any number above — 91, 97, 111, 143, or one of your own — and get the verdict with every divisor tested and every step shown. Watch for 91: it passes three tests and only falls to 7.
Use Prime Number Checker