Prime number checker
Enter any whole number and instantly see whether it is prime — a whole number greater than 1 divisible only by 1 and itself. When a number is not prime, the tool also shows its prime factorisation, the unique set of prime factors that multiply to give it. Handy for maths homework, number theory and quick checks.
How it works
The checker uses efficient trial division up to the square root of your number:
if n < 2 → not prime
test each d from 2 up to √n
if any d divides n evenly → composite (n is not prime)
if none divide n → prime
Testing only to √n is enough, because any factor above the square root pairs with one below it. For composite numbers, the same division yields the prime factorisation.
Example
Checking 97: no number from 2 up to √97 ≈ 9.8 divides it evenly, so 97 is prime.
Checking 91: 7 divides it (91 = 7 × 13), so 91 is not prime, with factorisation 7 × 13.
| Number | Prime? | Factorisation |
|---|---|---|
| 2 | Yes | — |
| 91 | No | 7 × 13 |
| 97 | Yes | — |
| 100 | No | 2² × 5² |
The test runs entirely in your browser, so nothing you enter is ever uploaded.