Prime Number Checker

Smallest prime factor97
Verdict97 is prime
Prime factorization97
Number of divisors2
Previous prime89
Next prime101
How this was calculated
  1. Trial division tests every prime up to √97 ≈ 9.8; none of them divides 97, so 97 is prime — its only prime factor is itself.
  2. Counting divisors from the exponents: (1+1) = 2 divisors. The neighbouring primes are 89 below and 101 above.

A prime number checker tells you whether any whole number you enter is prime or composite, and it backs up that answer with the full reasoning rather than a bare yes or no. A prime number has exactly two divisors: 1 and itself, while every composite number factors uniquely into primes, a result known as the fundamental theorem of arithmetic. When you enter a value, the tool applies trial division, which only needs to test divisors up to the square root of n because any factor larger than the square root of n pairs with one smaller than it. For instance, 97 is confirmed prime since nothing up to the square root of 97, approximately 9.8, divides it; its neighbouring primes are 89 and 101. By contrast, 91 is composite because 91 equals 7 times 13, making it the classic number that looks prime but is not. For composite inputs the checker also produces the prime factorization and the divisor count, which comes from the factorization exponents: add 1 to each exponent and multiply. As an example, 360 equals 2 to the power of 3 times 3 to the power of 2 times 5, and its divisor count is (3+1)(2+1)(1+1), which equals 24.

Trial division is the accepted standard for this kind of calculation because it is exhaustive, transparent, and easy to verify by hand for moderate sized inputs. Rather than relying on probabilistic shortcuts, it checks each possible divisor in order, so the result is a certainty rather than an educated guess. This page shows the formula behind the method, provides step by step workings for every input, includes worked examples such as those above, and lists the sources that define the underlying mathematics.

Worked examples

97

Prime. Nothing up to √97 divides it; its neighbours are 89 and 101, and it has exactly 2 divisors. (97)

Smallest prime factor97
Verdict97 is prime
Prime factorization97
Number of divisors2
Previous prime89
Next prime101

91 — the classic impostor

Not prime: 91 = 7 × 13. It fools people because neither factor is small enough to spot at a glance. (91)

Smallest prime factor7
Verdict91 is composite
Prime factorization7 × 13
Number of divisors4
Previous prime89
Next prime97

360

360 = 2^3 × 3^2 × 5, giving (3+1)(2+1)(1+1) = 24 divisors — one reason 360 was chosen for degrees in a circle. (360)

Smallest prime factor2
Verdict360 is composite
Prime factorization2^3 × 3^2 × 5
Number of divisors24
Previous prime359
Next prime367

What makes a number prime

A prime number has exactly two divisors: 1 and itself. That strict definition is the foundation for everything a prime number checker does. A number with more than two divisors is called composite, because it can be broken into smaller factors. Every composite number factors uniquely into primes, a result known as the fundamental theorem of arithmetic. This uniqueness is why primes matter so much in mathematics and computing.

The number 1 is neither prime nor composite, and the reason comes straight from the definition. A prime must have exactly two divisors, but 1 has only one divisor, which is itself. Calling 1 prime would also break the fundamental theorem of arithmetic, because you could multiply in any number of extra 1s and still get the same value. To keep factorization unique and clean, mathematicians exclude 1 from the prime club entirely. It stands alone in its own category.

The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, and so on. Notice that 2 is the only even prime, because every other even number divides by 2 and therefore has more than two divisors. As you move higher, primes thin out and become harder to spot. The number 97 is verified prime, because nothing up to √97 ≈ 9.8 divides it. Its neighbouring primes are 89 and 101. Trial division only needs to test divisors up to the square root of n, since any factor larger than √n pairs with one smaller than √n.

Some numbers look prime at a glance but are not. The classic example is 91, which is composite because 91 = 7 × 13. A prime number checker catches this instantly, but people often miss it because 91 does not appear in the familiar multiplication tables. Compare that with 360, which is clearly composite. Its factorization is 360 = 2^3 × 3^2 × 5, and its divisor count is (3+1)(2+1)(1+1) = 24. The divisor count comes from the factorization exponents: add 1 to each exponent and multiply. That formula works for any whole number greater than 1, and it gives a quick way to confirm whether a number is prime. If the result is exactly 2, the number is prime, because the only way to reach 2 from the formula is a single prime factor with an exponent of 1.

Worked examples

A prime number has exactly two divisors: 1 and itself. Every composite number factors uniquely into primes, a result known as the fundamental theorem of arithmetic. When a prime number checker tests a value, it relies on trial division, which only needs to test divisors up to the square root of n. The reason is straightforward: any factor larger than √n pairs with one smaller than √n, so finding a small factor is enough to prove the number is composite.

Consider 97. A prime number checker only needs to test possible divisors up to √97, which is approximately 9.8. None of the whole numbers from 2 through 9 divide evenly into 97, so it has no divisors other than 1 and itself. That makes 97 a prime number. Its neighbouring primes are 89 and 101, meaning no other primes fall between those two values in that stretch of the number line.

The number 91 is the classic example of a value that looks prime but is not. Testing divisors up to √91, which is roughly 9.5, reveals that 7 divides into 91 evenly. The full factorization is 91 = 7 × 13. Because it has factors beyond 1 and itself, 91 is composite. This is why a prime number checker is useful for numbers that seem prime at a glance — some composite numbers simply do not look the part.

For larger composite numbers, the factorization tells you more than whether the number is prime. Take 360, which factors into primes as 2^3 × 3^2 × 5. The divisor count comes directly from those exponents: add 1 to each exponent and multiply the results. That gives (3+1)(2+1)(1+1), which equals 24 divisors. So 360 is composite, and it has exactly 24 positive divisors.

NumberResultFactorizationDivisorsNotes
97Prime972Nothing up to √97 ≈ 9.8 divides it; neighbouring primes are 89 and 101
91Composite7 × 134Looks prime but is not
360Composite2^3 × 3^2 × 524Divisor count is (3+1)(2+1)(1+1) = 24
A quick rule for spotting composites: if a number is not prime, trial division up to its square root will find a factor. For 91, that factor is 7.

Why trial division stops at the square root

A prime number has exactly two divisors: 1 and itself. Every composite number factors uniquely into primes, a result known as the fundamental theorem of arithmetic. That fact is what makes trial division work as a prime number checker: if you can find even one divisor besides 1 and the number itself, the number is composite, and if you cannot, it is prime.

Trial division only needs to test divisors up to the square root of n. The reason is that factors come in pairs. Any factor larger than the square root of n pairs with one smaller than the square root. So if a number has a divisor above that boundary, it must already have a matching divisor below it — and you would have found that smaller one first. There is no need to keep testing once you pass the square root.

Take 97 as an example. Its square root is approximately 9.8, so you only need to test the primes up to that point: 2, 3, 5, and 7. None of them divide 97 evenly, so 97 is prime. Its neighbouring primes are 89 and 101. Contrast that with 91, the classic number that looks prime but is not. The square root of 91 is also under 10, and testing the same small primes reveals that 7 divides it: 91 = 7 × 13. A quick check up to the square root is enough to tell the two apart.

The same logic applies to numbers with more factor pairs. Consider 360, which factors as 2^3 × 3^2 × 5. Every factor of 360 pairs with another: 2 pairs with 180, 3 pairs with 120, 5 pairs with 72, and so on. The smaller member of each pair always falls at or below the square root of 360, which is about 18.97. Once you have tested every possible divisor up to that point, you have effectively tested all of them.

This square-root cutoff is what makes trial division practical for small and moderate numbers. Instead of checking every integer up to n, you check only up to the square root. For 97 that means four tests instead of ninety-six, and for larger inputs the savings grow quickly. It is a simple bound, but it turns an exhaustive search into a fast and reliable method.

91 and other impostors

Some numbers just feel prime, but a prime number checker will tell you otherwise. Take 91, the classic impostor. It looks like it should be prime — it is not obviously even, not obviously divisible by 3, and not a perfect square. But 91 is composite: 91 = 7 × 13. Once you know that, it seems obvious, yet most people miss it on instinct alone. A prime number has exactly two divisors: 1 and itself, and 91 simply does not meet that bar.

Other numbers have the same effect. The list of common impostors includes 91, 119, 121, 143, and 221. Some are products of two mid-sized primes that sit just outside the usual mental math range. Others, like 121, are perfect squares in disguise — 121 = 11² — which is easy to miss if you are only scanning for small factors. These numbers trick people because they do not end in 0, 2, 4, 5, 6, or 8, and their digit sums do not reveal divisibility by 3. They pass the easy checks, so they feel safe.

The reason these numbers fool us is that the easy mental checks only catch small divisors. Trial division is the method behind most checking tools, and it only needs to test divisors up to the square root of n. Any factor larger than √n pairs with one smaller than √n, so if nothing up to that square root divides the number, it is prime. For 91, √91 is roughly 9.5, so you only need to test 2, 3, 5, and 7. The first three fail, but 7 works — and the number is exposed as composite.

Quick divisibility checks catch most impostors fast. Check 2 by looking at the last digit. Check 3 by adding the digits. Check 5 by looking for a last digit of 0 or 5. After that, test 7 directly. For numbers under 150, those four checks reveal almost every composite. Beyond that, you may need to test 11, 13, or 17, but the principle stays the same. Every composite number factors uniquely into primes — the fundamental theorem of arithmetic — so there is always a factorization waiting to be found. A reliable prime number checker applies these tests systematically, so numbers like 91, 119, and 221 never slip through.

  • 91 = 7 × 13 — the most famous number that looks prime but is not
  • 119 = 7 × 17
  • 121 = 11 × 11, a perfect square that is easy to miss
  • 143 = 11 × 13
  • 221 = 13 × 17
Trial division only needs to test divisors up to √n. For 91, that means checking 2, 3, 5, and 7 — and 7 is the one that gives it away.

Counting divisors from the factorization

Once you have the prime factorization of a number, counting its divisors becomes a straightforward calculation rather than a guessing game. The fundamental theorem of arithmetic guarantees that every composite number factors uniquely into primes, meaning there is only one correct way to break a number down into prime components. This unique factorization is what makes divisor counting possible without listing every possible factor by hand.

The rule for counting divisors from the factorization is simple: add 1 to each exponent in the prime factorization, then multiply those results together. Each exponent represents how many times a prime appears in the factorization. When you add 1 to an exponent, you are accounting for the possibility of using that prime zero times, one time, two times, and so on up to its full exponent in the factorization. Multiplying across all primes gives the total number of ways to combine these choices, which equals the total divisor count.

A clear example is the number 360, which factors as 2^3 × 3^2 × 5. Applying the rule, you add 1 to each exponent: (3+1)(2+1)(1+1). That equals 4 × 3 × 2, which gives 24. So 360 has exactly 24 divisors. This method works for any composite number and is far more efficient than testing each candidate divisor individually, especially for larger numbers where trial division up to the square root of n would require many steps.

This divisor-counting rule also helps illustrate why primes behave differently from composites. A prime number has exactly two divisors: 1 and itself. In factored form, a prime is just a single prime raised to the first power, so the calculation becomes (1+1) = 2. A reliable prime number checker confirms this by verifying that no integer from 2 up to the square root of n divides evenly into the number. For example, 97 is verified as prime because nothing up to √97, which is approximately 9.8, divides it. By contrast, 91 looks prime at first glance but factors as 7 × 13, making it a classic composite. Once a number is factored, the divisor count follows directly from the exponents, turning what could be a lengthy search into a quick multiplication.

The (e+1) product rule turns factorization into divisor counts instantly: 360 = 2^3 × 3^2 × 5, so (3+1)(2+1)(1+1) = 24 divisors.

Where primes earn their keep

A prime number has exactly two divisors: 1 and itself. Every composite number factors uniquely into primes, a result known as the fundamental theorem of arithmetic. That uniqueness is not a mathematical curiosity — it is the reason prime numbers sit at the foundation of modern cryptography. RSA encryption, the system that secures much of online communication, works by multiplying two large primes together. The product acts as a public key anyone can use to scramble a message. Unscrambling it requires factoring that product back into its original primes, and for sufficiently large numbers that task is computationally brutal. A prime number checker confirms small cases instantly, but at the scale RSA uses — hundreds of digits — no known method can factor the product in any practical timeframe.

The difficulty is asymmetric. Multiplying two large primes is straightforward; reversing the process is not. This asymmetry is what makes the scheme useful. If factoring were easy, the encrypted traffic would be trivial to read. The security assumption rests on the apparent hardness of factoring, a problem that has resisted centuries of mathematical effort. Even with powerful hardware, no general-purpose algorithm cracks large semiprime products quickly. That is why the primes themselves remain valuable: they are the raw material from which hard-to-break keys are constructed.

Prime numbers also raise questions that are easy to state but remain unresolved. As you move along the number line, primes thin out, yet they never stop appearing. Gaps between consecutive primes grow on average, but occasionally two primes turn up separated by exactly 2 — a so-called twin-prime pair. The twin-prime conjecture asks whether infinitely many such pairs exist. No one has proven it, though progress has narrowed the question over time. The pattern of gaps is irregular, which is part of what makes primes both practically useful and mathematically stubborn.

Consider a concrete stretch of numbers. Verified: 97 is prime — nothing up to √97 ≈ 9.8 divides it; its neighbouring primes are 89 and 101. Verified: 91 is composite — 91 = 7 × 13, the classic number that looks prime but is not. Trial division only needs to test divisors up to the square root of n: any factor larger than √n pairs with one smaller than √n. Verified: 360 = 2^3 × 3^2 × 5, and its divisor count is (3+1)(2+1)(1+1) = 24. The divisor count comes from the factorization exponents: add 1 to each exponent and multiply.

FAQs

Is 91 a prime number?

No, 91 is not prime. It factors as 91 = 7 × 13. Despite having no obvious small divisors and not ending in an even digit or 5, 91 is the most famous 'looks prime' number. Many people mistakenly believe it is prime because it does not display the common warning signs that make other composite numbers easy to spot.

Is 1 a prime number?

No, 1 is not a prime number. A prime must have exactly two divisors, but 1 has only one divisor, which is itself. At the same time, 1 is also not composite because composite numbers have more than two divisors. So 1 sits in its own special category, neither prime nor composite.

How many divisors does 360 have?

360 has 24 divisors. Using its prime factorization, 360 = 2^3 × 3^2 × 5, you apply the divisor formula by adding 1 to each exponent and multiplying: (3+1)(2+1)(1+1) = 24 divisors. This method works for any positive integer once you know its prime factorization.

What is the smallest prime factor of 360?

The smallest prime factor of 360 is 2, because 360 is even and therefore divisible by 2. Repeated division by 2 gives 2^3 as part of the prime factorization, leaving 3^2 × 5 from the remaining factor. So the full prime factorization is 2^3 × 3^2 × 5.

Why do you only test up to the square root?

Factors come in pairs that multiply to n, and one member of each pair is at most √n. If you test every possible divisor up to √n and find nothing, then no larger factor can exist without a matching smaller one. Finding nothing by √n therefore proves primality.

What are the primes around 97?

The prime immediately below 97 is 89, and the prime immediately above 97 is 101. So the primes around 97 are 89 and 101. Additionally, 97 itself is the 25th prime, meaning exactly 24 primes come before it in the sequence of prime numbers.

Sources

Related calculators

Factorial Calculator
Exact factorials up to 170! computed with arbitrary-precision integers — no scientific-notation rounding — with the digit count and trailing zeros (Legendre's formula) explained.
LCM & GCF Calculator
Least common multiple and greatest common factor for two or three numbers, from their prime factorizations — the way that shows why the answer is right.
Probability Calculator
Two independent events, every combination: both happen, at least one, exactly one, or neither — from the two individual probabilities.