Prime Number Checker

Check whether any number is prime — with its prime factorisation.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

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.

NumberPrime?Factorisation
2Yes
91No7 × 13
97Yes
100No2² × 5²

The test runs entirely in your browser, so nothing you enter is ever uploaded.

Ad placeholder (rectangle)