What is a prime number?
A prime number is a whole number greater than 1 that has exactly two divisors: 1 and itself. The number 97 is prime because nothing divides it evenly except 1 and 97. The number 100 is not prime because 2, 4, 5, 10, 20, 25 and 50 all divide it evenly. The number 1 is not prime, because it has only one divisor, and 0 is not prime either.
Primes are the building blocks of all whole numbers. Every whole number greater than 1 is either prime itself or can be written as a product of primes, and that product is unique. This is the fundamental theorem of arithmetic, and it is why primes sit at the centre of number theory. The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23 and 29.
This checker takes one number and tells you whether it is prime, what its smallest factor is, and how many divisors it has. Type a number up to 100 million and the answer updates live. Nothing is uploaded and there is no sign-up, so you can check a homework answer or settle an argument in seconds.
How a prime number checker works
The checker uses trial division, the oldest primality test in mathematics. To test a number n, it tries dividing n by 2, then 3, then 4, and so on, stopping at the square root of n. If any of those divisions comes out even, n is not prime and the first divisor found is the smallest factor. If none divides evenly, n is prime.
Stopping at the square root is the key shortcut. If n has a factor larger than its square root, it must also have a matching factor smaller than its square root, so checking beyond the square root is wasted work. For 97, the square root is about 9.85, so only the divisors 2 through 9 need testing. None of them divides 97, so 97 is prime.
For 100, the test stops almost at once: 100 divided by 2 is 50, so 2 is the smallest factor and 100 is not prime. The divisor count is found the same way, by pairing each divisor below the square root with its partner above it. The number 100 has 9 divisors: 1, 2, 4, 5, 10, 20, 25, 50 and 100.
The number 2 and the special cases people get wrong
The number 2 is the only even prime, and it is the smallest prime of all. Every other even number is divisible by 2, so it cannot be prime. Students often forget this and say there are no even primes at all, but 2 qualifies because its only divisors are 1 and 2. It is also the reason trial division always starts with 2.
The number 1 causes the most confusion. It looks prime because it is only divisible by 1 and itself, but those are the same number, so 1 has exactly one divisor, not two. Mathematicians exclude 1 from the primes so that every number has exactly one prime factorisation. If 1 were prime, 6 could be written as 2 times 3, or 1 times 2 times 3, or 1 times 1 times 2 times 3, and uniqueness would be lost.
Negative numbers, zero and fractions are not prime either, because primality is defined only for whole numbers greater than 1. This checker starts at 2 for that reason. If you type 1, the answer is not prime, and the divisor count is 1, which is the honest result rather than a guess.
A worked example: 97, 100 and 49
Start with the default, 97. The square root of 97 is about 9.85, so the checker tests 2, 3, 4, 5, 6, 7, 8 and 9. None divides 97 evenly, so the result is Prime, the smallest factor shown is 97 itself, and the number of divisors is 2: just 1 and 97. That is the full answer for a prime number.
Now try 100. The first test, division by 2, succeeds: 100 divided by 2 is 50. So 100 is not prime, its smallest factor is 2, and its divisor count is 9. The divisors are 1, 2, 4, 5, 10, 20, 25, 50 and 100. Notice that 10 is the square root of 100, so it pairs with itself and counts only once.
Finally try 49. Division by 2, 3, 4, 5 and 6 all fail, but 49 divided by 7 is exactly 7. So 49 is not prime, its smallest factor is 7, and it has 3 divisors: 1, 7 and 49. Numbers like 49, where the square root is itself a divisor, are the classic trap — they look prime at a glance but are perfect squares of a prime.
Where prime numbers actually get used
Cryptography is the biggest real-world use of primes. The RSA encryption that protects bank logins and online payments works by multiplying two very large primes together. Multiplying is easy, but splitting the product back into its two prime factors is so hard that it keeps the secret safe. The primes used are hundreds of digits long, far beyond what trial division can test.
Primes also appear in hashing, random number generation and error detection, where their lack of small factors makes patterns harder to predict. A hash table sized to a prime number spreads keys more evenly than one sized to a round number. Computer science borrows the same idea whenever it needs numbers that do not line up in neat rows.
In school, primes are the gateway to factors, multiples and fractions. Simplifying a fraction, finding a lowest common denominator, or working out a greatest common divisor all start with breaking numbers into primes. A GCD calculator and a LCM calculator both lean on the same prime-factor idea, and a factorial calculator shows how fast products of whole numbers grow.
Prime number checker vs prime number generator
A checker answers one question about one number: is this number prime? A generator does the opposite job: it lists the first N primes in order. Use the checker when a specific number is in front of you, such as 97 on a homework sheet, and use the generator when you need a list, such as the first 10 primes for a table or a test.
The two tools share the same maths. The generator on this site uses trial division too, testing each candidate the same way the checker tests your number. The difference is only the direction: the checker stops at the first factor it finds, while the generator keeps going until it has collected as many primes as you asked for. Try the prime number generator when you need the list instead of a single verdict.
For very large numbers, trial division gets slow and professional tools switch to faster tests such as Miller-Rabin, which can say a huge number is probably prime in a fraction of a second. This checker caps at 100 million, where trial division is still instant in a browser, so it covers every school and everyday use without needing those heavier tests.
Common prime number mistakes
The first mistake is calling 1 prime. It is not, for the reason given above: it has only one divisor. The second mistake is calling 9 prime. It looks prime because it is odd, but 9 is 3 times 3. Odd does not mean prime — 9, 15, 21, 25, 27 and 33 are all odd and all composite.
The third mistake is stopping the trial division too early. To test 91, you must check up to its square root, about 9.54, which includes 7. Many people test 2, 3 and 5, find nothing, and declare 91 prime, but 91 is 7 times 13. The square-root rule exists precisely to catch cases like this one.
The fourth mistake is assuming primes get rarer in a simple pattern. They thin out as numbers grow, but irregularly — there are gaps of over 100 between consecutive primes below 10,000, and also runs where primes sit close together, like the twin primes 11 and 13. No simple formula lists all primes, which is part of why they stay interesting.
How to use this prime number checker
Type the number you want to test into the box. The default is 97, which is prime. The result updates live as you type, so you can run through a list of numbers quickly by changing the value and reading the three rows: prime or not, smallest factor, and number of divisors.
Read the smallest factor row with care. For a prime number it shows the number itself, because the number is its own smallest prime factor. For a composite number it shows the first divisor found, which is always prime. If that factor is 2, the number is even; if it is 3, the digits of the number add up to a multiple of 3.
Everything runs in your browser. No account, no upload, no data sent anywhere. Use it for homework, for checking a factorisation by hand, or alongside the scientific calculator when a problem mixes primes with other arithmetic.