CALCULATE ALL — every calculation, from tomorrow

Math • Finance • Health • Conversion • Education — 100% free, no sign-up

Math

Prime Number Checker

Check whether any number is prime and find its smallest factor.

Enter any whole number to find out instantly whether it's prime, and if not, see its smallest factor and factorization. Great for homework, cryptography curiosity, and settling debates about numbers like 91 (it's 7 × 13).

Introduction

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, and so on. Everything else greater than 1 is composite — built by multiplying primes together, like 91 = 7 x 13 or 100 = 2^2 x 5^2. Primes are the atoms of arithmetic: the Fundamental Theorem of Arithmetic says every integer factors into primes in exactly one way. They also underpin modern cryptography — the security of much of the internet rests on how hard it is to factor the product of two huge primes, a task that is easy to set up and practically impossible to reverse.

To test a number by hand, you only need to try prime divisors up to its square root. Why? Because factors come in pairs multiplying to the number, and in every pair at least one factor is at or below the square root — so if none divides it up to that point, no larger divisor can either. A few quick pre-checks speed things up: even numbers are divisible by 2, numbers ending in 0 or 5 by 5, and numbers whose digits sum to a multiple of 3 are divisible by 3 (147: 1+4+7 = 12, so 147 = 3 x 49). This calculator applies those rules plus trial division automatically, and it is honest about the edge cases: 1 is neither prime nor composite, and 2 is the only even prime.

How it's calculated

The checker tests divisibility by every integer up to the square root of the number (trial division). If none divide it evenly, the number is prime; otherwise the first divisor found is its smallest factor.

Worked examples

Is 97 prime?

The square root of 97 is about 9.85, so only primes up to 9 need testing: 2 (97 is odd — no), 3 (digits sum to 9+7 = 16, not a multiple of 3 — no), 5 (does not end in 0 or 5 — no), 7 (7 x 13 = 91, 7 x 14 = 98, so 97 is not a multiple — no). None divide 97, so 97 is prime. This is the largest prime below 100, a favorite exam question precisely because it requires the full checklist.

Is 91 prime? (The classic trap)

91 looks prime — it is odd, does not end in 5, and its digits sum to 10 (not a multiple of 3). But test 7: 91 / 7 = 13 exactly, so 91 = 7 x 13 and is composite. Since 7^2 = 49 sits below 91 while 11^2 = 121 sits above it, testing primes up to 7 was sufficient and caught it. Moral: always test 7 before declaring a two-digit number prime — 91, and its cousin 143 = 11 x 13, are the two most common traps.

Frequently asked questions

Is 1 a prime number?

No. A prime number must have exactly two divisors (1 and itself), and 1 has only one divisor, so it is neither prime nor composite.

Why does it only check divisors up to the square root?

If a number has a factor larger than its square root, it must also have a matching factor smaller than the square root — so checking up to √n catches every factor pair.

Is 91 prime?

No — 91 = 7 × 13. It's a classic trick question because 91 looks prime at first glance.

Is the Prime Number Checker free to use?

Yes. The Prime Number Checker on CalculateAll is completely free — no sign-up, no usage limits and nothing to install. The calculation runs entirely in your browser, so the numbers you enter never leave your device.

Does the Prime Number Checker work on mobile phones?

Yes. The Prime Number Checker is fully responsive and works on phones, tablets and computers. Open the page, enter your values, and the result updates instantly — no app download needed.

Worked example: is 221 prime?

221 is a number that fools people the way 91 does, one size up. The square root of 221 is about 14.9, so the candidate prime divisors are 2, 3, 5, 7, 11 and 13. Run the checklist: 221 is odd, so not divisible by 2. Its digits sum to 2 + 2 + 1 = 5, not a multiple of 3. It does not end in 0 or 5. For 7: 7 x 31 = 217 and 7 x 32 = 224, so no. For 11: 11 x 20 = 220, one short — no. For 13: 13 x 17 = 221 exactly. So 221 = 13 x 17 and is composite, with 13 as its smallest factor. The lesson generalizes: a number can survive the easy tests (2, 3, 5) and the classic trap (7) and still fall at 11 or 13, which is why the checker tests every prime up to the square root rather than stopping at the famous ones.

Two more instructive cases: 561 and 121

The number 561 is famous in number theory as the smallest Carmichael number — a composite that pretends to be prime under certain probability tests. Trial division is not fooled for a second: its digits sum to 12, a multiple of 3, so 561 = 3 x 187, and 187 itself is 11 x 17, giving the full factorization 3 x 11 x 17. Perfect squares are the opposite trap — they look unpromising but test quickly, because the divisor sits exactly at the square root: for 121, the root is exactly 11, and 11 x 11 = 121, so the search ends the moment it reaches the boundary. That boundary case is precisely why the rule is "up to and including the square root," not "below it."

Why the checker matters beyond homework: a toy RSA key

The cryptography mentioned in the introduction can be made concrete with pocket-sized numbers. The original RSA paper's famous example multiplies the primes 61 and 53 to get 3,233 — easy to compute, and the checker confirms instantly that 61 and 53 are both prime. Reversing the process — handing someone 3,233 and asking for its factors — is the hard direction the whole system rests on, trivial at this size (the checker finds 53 quickly) but infeasible when the primes have hundreds of digits. Trying the checker on the product of two three-digit primes is a good feel for where trial division starts to strain: the method is exact, but the square-root workload grows with the number.

How much work is a check, and how rare are primes?

The square-root rule keeps even large checks short. Testing a number near one million means trial-dividing by the primes up to 1,000 — and there are only 168 of those — so the checker settles million-sized numbers in a blink, while a number near one trillion needs the primes up to one million, still routine for a computer but no longer a hand calculation. Primes also thin out as numbers grow: roughly 1 in 7 numbers near 1,000 is prime, about 1 in 14 near a million, and about 1 in 21 near a billion, following the pattern mathematicians call the prime number theorem. That thinning is exactly why "pick a random large prime" is a feasible instruction in cryptography — they are rare, but never too far away.

Related calculators

References