What Makes a Number Prime
This checker answers one deceptively simple question: is this whole number prime, or can it be split into smaller factors? A prime is a whole number greater than 1 with exactly two divisors — 1 and itself — so 7 is prime but 9 is not, because 9 = 3 × 3. The tool tests any whole number up to one trillion by trial division and shows every divisor it tried, while list mode uses the Sieve of Eratosthenes to print all primes up to 5,000. Primes are the atoms of arithmetic: every whole number greater than 1 is either prime or a unique product of primes (the Fundamental Theorem of Arithmetic). They secure your bank transactions, generate secure keys, and still hide unsolved mysteries — nobody knows if there are infinitely many twin primes.
The Definition, Symbol by Symbol
Mathematicians state the test compactly: n is prime exactly when no integer d with 2 ≤ d ≤ √n divides n evenly. Here n is the number you are testing — the value typed into the box above. The letter d stands for a candidate divisor, any whole number you try dividing by. The symbol √n is the square root of n, the value that multiplied by itself gives n, so √97 ≈ 9.85. The notation d | n, read “d divides n”, means n ÷ d leaves no remainder. If one such d exists, n is composite; if none exists, n must be prime.
How to Use This Checker
- Choose the Check a number tab and type a whole number — anything up to 1,000,000,000,000 — into the “Enter a whole number” box.
- Read the instant verdict: PRIME, together with √n and the divisors tested, or NOT PRIME — composite, with the exact divisor found, such as 91 ÷ 7 = 13.
- To see primes in bulk, switch to the List primes up to N tab, enter any N from 2 to 5,000, and the tool reports how many primes there are and prints the full list.
The Trial Division Shortcut
To test n, you only need to trial-divide up to √n. Why? If n had a factor larger than √n, its partner factor would be smaller than √n — and you would already have found that one. For 97, that means testing just 2, 3, 5, and 7.
Special Cases to Memorize
- 1 is neither prime nor composite.
- 2 is the only even prime — every other even number is divisible by 2.
- 0 and negatives are not prime by definition.
Breaking numbers into prime factors? Try our factoring calculator.
Worked Example 1: Is 91 Prime?
Many students guess yes — 91 is odd and clearly not a multiple of 3 or 5 — so work it properly. First find the limit: √91 ≈ 9.54, so you only test whole numbers up to 9, and in practice the primes 2, 3, 5, and 7. The number 91 is odd, so 2 fails. Its digits sum to 9 + 1 = 10, not a multiple of 3, so 3 fails. It does not end in 0 or 5, so 5 fails. Now try 7: 7 × 13 = 91, so 91 ÷ 7 = 13 exactly, with no remainder. A genuine divisor exists, so 91 is composite — it equals 7 × 13. This is the classic trap: 91, 119, and 221 all look prime at a glance, yet each splits into tidy small factors.
Worked Example 2: Testing 97, Then Listing Primes to 30
For 97, √97 ≈ 9.85, so again the candidates are 2, 3, 5, and 7. The number 97 is odd, ruling out 2. Its digits sum to 9 + 7 = 16, not a multiple of 3, ruling out 3. It ends in 7 rather than 0 or 5, ruling out 5. For 7, notice 7 × 13 = 91 and 7 × 14 = 98, so 97 falls strictly between two consecutive multiples of 7 and cannot divide evenly. No candidate works, so 97 is prime — in fact the largest two-digit prime. Now switch to list mode with N = 30: the sieve crosses out every multiple of 2, 3, and 5, leaving 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29 — exactly 10 primes, matching the count the tool reports.
When a Prime Checker Earns Its Keep
Reach for this tool when homework asks you to factor a number and you first need to know whether factoring is even possible — a prime has nothing to break down. Programmers run quick primality checks when generating test data, designing hash functions, or tackling coding-challenge problems about prime gaps. Teachers use list mode to print every prime up to 100 for a classroom wall chart in seconds. And anyone reading about RSA encryption, where two large primes multiplied together guard a secret key, can experiment here with small primes to feel why recovering those factors is so difficult.
Three Mistakes That Catch Everyone
- Calling 1 prime. A prime needs exactly two divisors; 1 has only one — itself — so it sits in a category of its own, neither prime nor composite.
- Stopping after 2, 3, and 5. The number 91 slips past all three, yet 7 catches it instantly. Always test every candidate up to √n before declaring a number prime.
- Assuming every odd number is prime. Oddness only rules out the factor 2. Plenty of odd numbers — 9, 15, 21, 25, 27, 33, 35 — are composite, so odd is a hint, never a verdict.