Prime Number Checker – Is Your Number Prime or Composite

Use the free Prime Number Checker below: your data never leaves your browser — all work happens on your device, and nothing is uploaded to any server.

What Makes a Number Prime?

A prime number is a whole number greater than 1 whose only divisors are 1 and itself. 2, 3, 5, 7, 11 and 13 are prime. 4 is not, because 2 × 2 = 4. 1 is not prime either, and neither is 0: primes start at 2, by definition. This definition sounds simple, but it supports an enormous amount of mathematics. Every whole number larger than 1 is either prime or a product of primes, and that product is unique. That fact, called the fundamental theorem of arithmetic, makes primes the atoms of the number world.

Primes also guard modern life. The encryption that protects your bank login and your messages depends on the fact that multiplying two large primes is easy, while splitting the product back into its prime factors is extremely hard. When you check whether a number is prime, you are touching the same idea that keeps online life private.

How to Use This Checker

Enter a whole number up to 10,000,000 and press Check primality. The tool tests divisors from 2 up to the square root of your number. If none divides it, the number is prime, and the tool says how many divisors it tested. If a divisor is found, the number is composite, and the tool shows the smallest factor plus the full prime factorisation, for example 60 = 2 × 2 × 3 × 5.

Testing only up to the square root is the key shortcut. If a number has a factor larger than its square root, it must also have a partner factor smaller than the square root, so checking the small side is enough. For 97, the square root is about 9.8, so testing 2 through 9 settles it. For 10,000,000, the tool tests up to 3,162, which is fast in a browser.

A Worked Example

Try 91. Many people guess it is prime because it looks prime and ends in 1. It is not: 91 = 7 × 13. The tool finds 7 as the smallest factor and shows the factorisation. Try 97 next. No divisor from 2 to 9 works, so 97 is prime. That pair, 91 and 97, is a good reminder that primality cannot be judged by appearance; it has to be tested.

Try 1 and 0 as well, since these are the classic edge cases. The tool explains that neither is prime nor composite. Students lose marks on exactly this point, so it is worth seeing the answer stated plainly.

Why Primes Thin Out

Primes get rarer as numbers grow, but they never run out: Euclid proved more than two thousand years ago that there are infinitely many primes. Among the first 100 numbers there are 25 primes. Among numbers near one million, only about 1 in 14 is prime. This thinning is gradual and predictable, and it is one reason large primes are useful for encryption: they are common enough to find, but a random large number is usually composite.

The largest known primes today have tens of millions of digits and are found by distributed computing projects. You do not need numbers that large to appreciate the idea, though. The checker here handles the range where hand-checking is tedious but the reasoning is fully visible.

Common Mistakes

The most common mistake is calling 1 prime. It is not. Another is assuming odd numbers are prime: 9, 15, 21 and 27 are all odd and all composite. A third is stopping the trial division too early or too late: you must test up to the square root, not up to half the number, and not just the small primes you remember. The tool handles the bound for you and prints it, so you can see exactly where the testing stopped.

Also remember that “prime” is a property of the number itself, not of how it is written. 91 in any base, or written as 7 × 13, is still the same composite number.

Try It Yourself

Test your birth year, your house number, and a few numbers around 100. Then test a number like 999983, which is prime, and 999984, which is not. Notice how the tool’s factorisation of the composite neighbour makes the contrast obvious. That habit, testing rather than guessing, is the whole skill this checker is meant to build.

Related tools

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top