Prime Number Calculator
Check whether any integer up to 10,000,000 is prime, get a step-by-step prime factorization, and list all primes up to 1,000.
Enter a positive integer (up to 10,000,000) to test primality.
What is a Prime Number?
A prime number is a natural number greater than 1 that has exactly two positive divisors: 1 and itself. The first few primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29. The number 2 is the only even prime — all other even numbers are divisible by 2 and therefore composite. Prime numbers are the fundamental building blocks of all positive integers: every integer greater than 1 can be expressed uniquely as a product of prime numbers, a fact known as the Fundamental Theorem of Arithmetic.
Prime numbers have fascinated mathematicians for over two millennia. Euclid proved around 300 BCE that there are infinitely many primes — a proof that remains one of the most elegant in all of mathematics. Despite centuries of study, the distribution of primes among natural numbers still holds mysteries: the twin prime conjecture (whether infinitely many pairs of primes differ by 2) and the Riemann hypothesis (relating prime distribution to the zeros of the Riemann zeta function) remain among the greatest unsolved problems in mathematics.
Beyond pure mathematics, prime numbers are the foundation of modern cryptography. Public-key cryptosystems like RSA rely on the fact that multiplying two very large primes is computationally easy, while factoring the resulting product back into its prime components is computationally infeasible for sufficiently large numbers. This mathematical asymmetry secures internet banking, encrypted messaging, digital signatures, and virtually all sensitive online communications used today.
What is a Prime Number?
A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. Examples: 2, 3, 5, 7, 11, 13…
Worked Examples
Example 1 — Is 97 Prime?
√97 ≈ 9.85. Test 2, 3, 5, 7 — none divide 97 evenly.
Example 2 — Factorize 360
360 is not prime. Step by step:
How the Prime Number Calculator Works
Formula, assumptions, and calculation steps for this math tool.
Methodology
Math calculators apply the relevant arithmetic, algebraic, geometric, or numeric rule to the values entered and simplify the result where possible.
Calculation Steps
- Read the values and operation selected.
- Normalize signs, decimals, fractions, or units if needed.
- Apply the mathematical rule or formula.
- Format the answer and any intermediate values for checking.
Assumptions and Limits
- Inputs must be within the supported domain of the operation.
- Decimal answers may be rounded for readability.
- Symbolic simplification is limited to the calculator scope.
Frequently Asked Questions
No. By definition, a prime number must have exactly two distinct positive divisors: 1 and itself. The number 1 has only one divisor (itself), so it is neither prime nor composite.
Yes, 2 is the only even prime number. Every other even number is divisible by 2, making it composite.
Prime factorization expresses a number as a product of prime numbers. For example, 60 = 2² × 3 × 5. Every integer greater than 1 has a unique prime factorization (Fundamental Theorem of Arithmetic).
Infinitely many. Euclid proved this around 300 BC. The primes become less dense as numbers grow larger, but they never stop.
As of 2024 the largest known prime is a Mersenne prime: 2^136,279,841 − 1, containing over 41 million digits. These records are tracked by the Great Internet Mersenne Prime Search (GIMPS).
Real-World Applications
Common Mistakes
Prime Number Distribution Quick Reference
| Range | Count of Primes | Notable Primes |
|---|---|---|
| 1–10 | 4 | 2, 3, 5, 7 |
| 1–100 | 25 | 2, 3, 5, … 97 |
| 1–1,000 | 168 | Largest: 997 |
| 1–10,000 | 1,229 | Largest: 9,973 |
| 1–1,000,000 | 78,498 | Largest: 999,983 |
| Known largest (2024) | 1 (Mersenne) | 2^136,279,841 − 1 (41M+ digits) |
References
- Hardy, G.H. and Wright, E.M. An Introduction to the Theory of Numbers. Oxford University Press, 2008.
- Riemann, B. "Über die Anzahl der Primzahlen unter einer gegebenen Grösse." Monatsberichte der Berliner Akademie, 1859.
- Rivest, R., Shamir, A., and Adleman, L. "A Method for Obtaining Digital Signatures and Public-Key Cryptosystems." CACM, 1978.
- Crandall, R. and Pomerance, C. Prime Numbers: A Computational Perspective. Springer, 2005.
- GIMPS. Great Internet Mersenne Prime Search. mersenne.org, 2024.
Related Calculators
Browse all Math calculators →Factor Calculator
Find all factors and prime factors of any positive integer.
GCF Calculator
Calculate the Greatest Common Factor (GCF/GCD) of two or more numbers.
LCM Calculator
Calculate the Least Common Multiple (LCM) of two or more numbers.