Prime Number Checker

Enter any number to check if it is prime. Get the prime factorization, number of divisors, and nearby primes.

97
is PRIME
Prime Factorization
97
Number of Divisors
2
Previous Prime
89
Next Prime
101
Nearby Primes
Disclaimer: This tool is provided for general educational and entertainment purposes only. Results are estimates and should not be relied upon for any critical decision. Neither MayoCalc nor Cook Media Systems assumes any liability for consequences arising from the use of this tool. By using this site, you agree to our Terms of Service and Disclaimer.

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. The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29. The number 2 is the only even prime. Every integer greater than 1 is either prime or can be uniquely expressed as a product of primes (the Fundamental Theorem of Arithmetic). Primes are the "building blocks" of all integers.

How to Use This Calculator

Enter any positive integer and the calculator instantly determines whether it is prime. If the number is not prime (composite), it shows the complete prime factorization. The calculator also finds the nearest primes above and below the entered number and lists all primes up to a specified limit.

Why Primes Matter

Prime numbers are fundamental to modern cryptography. RSA encryption, which secures internet banking, email, and online transactions, relies on the difficulty of factoring the product of two very large primes. A 2048-bit RSA key involves primes with over 300 digits. While finding large primes is computationally feasible, factoring their product is astronomically difficult, which is what makes the encryption secure.

Prime Number FAQ

How many prime numbers are there?
Infinitely many. Euclid proved this around 300 BCE. His proof (by contradiction) shows that for any finite list of primes, you can always construct a new number that is not divisible by any of them, and that number is either prime itself or has a prime factor not on the list. There is no largest prime.
Is 1 a prime number?
No. By modern definition, a prime must be greater than 1. Including 1 as prime would break the uniqueness of prime factorization (the Fundamental Theorem of Arithmetic), which is one of the most useful properties of primes. This convention was standardized in the early 20th century.

Why Prime Numbers Matter

Prime numbers are the foundation of modern internet security. RSA encryption, which protects online banking, email, and e-commerce, relies on the mathematical difficulty of factoring the product of two very large prime numbers. Breaking RSA encryption would require factoring numbers with 600+ digits, a task that would take classical computers longer than the age of the universe. The largest known prime number (as of recent records) has millions of digits, discovered by the Great Internet Mersenne Prime Search (GIMPS) distributed computing project. In number theory, primes follow fascinating patterns: the twin prime conjecture suggests there are infinitely many pairs of primes that differ by 2 (like 11 and 13, or 29 and 31). The Riemann Hypothesis, one of the most important unsolved problems in mathematics, concerns the distribution of prime numbers.