Math

Prime Number Checker

Check whether a number is prime, and find its smallest factor if not.


Prime Number Checker

Advertisement

A number is prime if it has no divisors other than 1 and itself — this checks any whole number directly.

How it works

Testing divisibility by every whole number from 2 up to the square root of the number being checked; if none divide evenly, the number is prime.

What this does not include

This does not include full prime factorization for composite numbers — it reports only the smallest factor found, not every factor.

How to use this calculator

  1. Enter a whole number.

A worked example

17 has no divisors other than 1 and itself → 17 is prime.

18 divides evenly by 2 → 18 is not prime, with 2 as its smallest factor.

1 is a special case: 1 is not prime — by definition, a prime number must have exactly two distinct divisors, and 1 only has one.

What the terms mean

Term Meaning
Prime number A number greater than 1 divisible only by 1 and itself
Smallest factor The lowest number (other than 1) that divides evenly into a composite number

Edge cases worth knowing

1 is neither prime nor composite — a rule that trips up a lot of people, since 1 technically has no factor besides itself.

2 is the only even prime number — every other even number is divisible by 2, which immediately disqualifies it from being prime.

Frequently asked questions

Why check only up to the square root?

If a number has a factor larger than its square root, it must also have a matching factor smaller than the square root — so checking beyond that point can never find a new factor.

Is 1 a prime number?

No — by definition, a prime number must have exactly two distinct divisors (1 and itself); 1 has only one divisor, so it’s excluded.

Is 2 the only even prime number?

Yes — every other even number is divisible by 2, which disqualifies it from being prime.

Be the first to rate this

Written by

J. Adeyemi

Statistics writer

J. Adeyemi writes the statistics and probability calculators, from descriptive summaries through to distributions and conditional probability. The recurring theme is scope: each page states precisely which question it answers, because most statistical mistakes come from applying a correct formula to the wrong question. Related-but-different measures get separate pages rather than being quietly merged.

Reviewed by

T. Okafor

Calculator reviewer — mathematics

T. Okafor reviews the mathematics calculators, verifying algebraic correctness and, just as importantly, behaviour at the edges — division by zero, undefined results, and the floating-point cases where a formula technically returns a number that should be reported as undefined. Every test case is recomputed independently rather than taken on trust.

How we write and review

Related calculators