Prime Number Checker
Last updated:
How to Use This Calculator
Step 1: Enter any positive whole number up to one trillion.
Step 2: Click Calculate.
Step 3: See whether the number is prime. If composite, the result includes the full prime factorization.
What Is a Prime Number?
A prime number is a whole number greater than 1 whose only positive divisors are 1 and itself. In other words, you cannot divide a prime number by any smaller whole number (except 1) without leaving a remainder.
The first ten prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29. The number 2 is the only even prime — every other even number is divisible by 2.
Numbers that are not prime (and not 1) are called 'composite.' Every composite number can be written uniquely as a product of primes — this is the fundamental theorem of arithmetic, and it underpins number theory, cryptography, and modern computer security.
How to Check If a Number Is Prime
Trial division method:
1. If n < 2 → not prime
2. If n = 2 → prime
3. If n is even → not prime
4. Check odd divisors from 3 up to √n. If any divide n evenly, n is composite.
5. If no divisor is found → prime.
Why only up to √n? If n has a factor larger than √n, its paired factor must be smaller than √n — so you would have found it already.
Example: Is 29 prime? √29 ≈ 5.39. Check 3, 5. Neither divides 29 → prime.
Primes Under 100
| Range | Primes |
|---|---|
| 1–20 | 2, 3, 5, 7, 11, 13, 17, 19 |
| 21–40 | 23, 29, 31, 37 |
| 41–60 | 41, 43, 47, 53, 59 |
| 61–80 | 61, 67, 71, 73, 79 |
| 81–100 | 83, 89, 97 |
| Total | 25 primes |
Examples
Example 1: 17 → Prime. Tested 3 (17/3 ≈ 5.67, not whole). √17 ≈ 4.12, so no more checks needed.
Example 2: 91 → Not prime. 91 = 7 × 13. A common trick question — looks prime but isn't.
Example 3: 1 → Not prime. By definition, primes must be greater than 1.
Tips
1 is not prime — by modern definition, primes must be greater than 1.
2 is the only even prime. All other even numbers are composite.
91 is not prime — a classic trick (91 = 7 × 13).
RSA encryption relies on the difficulty of factoring large primes.
Frequently Asked Questions
Why is 1 not considered a prime number?
Are there infinitely many primes?
Why is 2 the only even prime?
What is prime factorization and why does it matter?
How are prime numbers used in cryptography?
How fast is this prime checker for large numbers?
Related Calculators
Factorial Calculator
Free factorial calculator. Compute factorial of any number up to ...
GCF Calculator (Greatest Common Factor)
Free GCF calculator. Find the greatest common factor of two or mo...
LCM Calculator (Least Common Multiple)
Free LCM calculator. Find the least common multiple of two or mor...
Random Number Generator
Free random number generator. Generate one or multiple random int...