Prime Number Checker
Check if any number is prime, see its prime factorization, and find nearby primes. Uses trial division up to the square root. Free, 100% in your browser.
Reference
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 few primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29. The number 2 is the only even prime — every other even number is divisible by 2. Primes are the "building blocks" of all integers: by the Fundamental Theorem of Arithmetic, every integer greater than 1 can be uniquely expressed as a product of primes (its prime factorization).
How is primality tested?
This tool uses trial division — the simplest and most intuitive primality test. It checks whether the input number is divisible by any integer from 2 up to its square root. If no divisor is found, the number is prime. The key optimization is that you only need to check up to √n: if n = a × b and both a and b are greater than √n, then a × b > n, which is a contradiction. The algorithm also skips even numbers after checking for 2, and checks only numbers of the form 6k±1, since all primes greater than 3 have this form. This makes it efficient for numbers up to about 1015.
Privacy
All calculations run 100% in your browser. No data is sent to any server.