Math & Scientific

Prime Number Checker

Check whether a number is prime, with its smallest factor and nearest primes if it isn't.

What makes a number prime

A prime number is a whole number greater than 1 that has exactly two divisors: 1 and itself. Numbers with more divisors (like 12, divisible by 1, 2, 3, 4, 6, and 12) are called composite.

This tool checks primality using trial division: it tests whether any number up to the square root of your input divides evenly into it. If none do, the number is prime — checking only up to the square root works because any factor larger than that would have to pair with a factor smaller than it.

Special cases

0 and 1 are neither prime nor composite — 1 has only one divisor, and 0 is divisible by every number, so neither fits the definition. 2 is the only even prime number, since every other even number is divisible by 2.

Frequently asked questions

Why isn't 1 considered a prime number?

A prime number needs exactly two distinct divisors. 1 has only one divisor (itself), so it doesn't meet the definition — this is a deliberate convention, not an accident, and it keeps theorems like unique prime factorization consistent.

How large a number can this check?

Up to 1,000,000,000,000,000. Trial division gets slower as numbers grow, since it has to test divisors up to the square root of the input, so extremely large numbers are capped to keep the result instant.

What does 'smallest prime factor' mean?

It's the smallest prime number that divides your number evenly with no remainder. Every composite number has one, and dividing it out is the first step of finding a full prime factorization.

Related calculators