Check if any number is prime and find adjacent primes.
🔢 A prime is divisible only by 1 and itself. Primes are the building blocks of cryptography (RSA).
The Prime Number Checker is based on the following formula:
n is prime ⟺ n > 1 and n mod d ≠ 0 for every d in [2, √n]
Variables: n = The integer being tested d = Trial divisor, 2 ≤ d ≤ √n √n = Square root of n, the testing cutoff mod = Remainder after division
Trial division up to the square root: any composite n must have a factor at or below √n, so testing larger divisors is unnecessary. 1 is not prime by definition; 2 is the only even prime.
Worked example: Step 1: Test n = 97. √97 ≈ 9.85, so only d = 2, 3, 5, 7 need testing. Step 2: 97 mod 2 = 1, 97 mod 3 = 1, 97 mod 5 = 2, 97 mod 7 = 6. Step 3: No divisor up to √n divides 97 evenly. Result: 97 is prime.
A prime number is divisible only by 1 and itself — like 2, 3, 5, 7, 11. This tool checks any number for primality and finds the next and previous primes.
More tools you might find useful
Discriminant, both roots, vertex and factored form in one pass.
Solve proportions and find missing ratio values.
Find rectangle area, perimeter, and diagonal.
Two-way Roman numeral conversion with a quick reference chart.