Prime Number Checker
Test whether a number is prime, and get the next prime above it.
Is it prime?
A prime number has exactly two divisors: 1 and itself. Primes are the atoms of number theory and the backbone of cryptography, so quickly checking one matters. Enter a number and this tells you whether it is prime, and if not, why.
For 97 the answer is prime; for 91 it reveals the factor 7 (91 = 7 × 13). It also reports the next prime above your input, which is useful when sizing a hash table or picking a modulus.
Quick and private
The check uses trial division only up to the square root, so it stays fast, and everything is computed in your browser with nothing uploaded.
Frequently Asked Questions
How does it test for primality?
By trial division up to the square root of the number, skipping even numbers after 2. If nothing divides it evenly, it is prime.
What if the number is not prime?
It shows the smallest factor it found, which proves the number is composite and gives you a starting point for factoring.
Does it find the next prime?
Yes — it steps upward from your number and returns the first prime it reaches, handy for hash sizes and table lengths.
Browse the full set of free, private, in-browser tools.