Prime Number Checker & Factorizer

In short: a prime number has exactly two divisors — 1 and itself. 97 is prime; 91 is not (7 × 13). Enter any number to get the verdict, its full prime factorization if composite, the nearest primes on both sides, and the list of primes up to your limit.

How the check works — and why the square root is enough

To prove a number prime you must show nothing divides it, and the saving grace is symmetry: factors come in pairs straddling the square root. If 360 = 12 × 30, it is also 15 × 24 and 18 × 20 — in every pair, one factor is at or below √360 ≈ 18.97. So a search that finds no divisor up to √n has searched everywhere a first factor could hide, and the number is prime. For 97 the whole proof is four divisions (by 2, 3, 5, 7, since √97 ≈ 9.8); the evens and multiples of 3 and 5 can be skipped by pattern, and testing only prime divisors trims it further. This page does exactly that — trial division to √n — which is instant for the sizes typed into a web page, and it shows the factorization it finds, so a composite verdict comes with its evidence attached.

Composites get dismantled completely: 360 = 2³ × 3² × 5, the unique prime factorization guaranteed by the fundamental theorem of arithmetic — the same representation the LCM/GCF calculator builds on. Primes, by contrast, factor only as themselves, which is why they are called the atoms of arithmetic: every integer is a molecule built from them in exactly one way. The checker also reports the neighbouring primes, because the gaps are interesting in themselves — primes thin out as numbers grow (25 below 100, 168 below 1000, about n ÷ ln n in general), yet pairs like 11 and 13, or 107 and 109, keep appearing as twin primes two apart, a pattern conjectured but never proved to continue forever.

The asymmetry between checking and factoring runs the modern world. Multiplying two large primes is easy; recovering them from the product is, for 300-digit numbers, beyond every known computer — and that one-way difficulty is the load-bearing assumption of RSA encryption. The numbers on this page are small enough that factoring is trivial, but the principle scales: primality testing stays fast at sizes where factorization fails, which is precisely why primes are useful secrets.

Listing many primes: the sieve of Eratosthenes

Checking numbers one at a time is the wrong tool for producing a whole list — for that, a 2,200-year-old algorithm still wins. Write down every number to your limit, then cross out the multiples of 2 (except 2), the multiples of 3 (except 3), of 5, of 7, and so on up to the square root of the limit. Everything never crossed out is prime. The sieve is fast because it never divides anything: it simply marks, and each composite is marked by its smallest prime factor. The list feature beside the checker uses exactly this method, which is why a limit of 100,000 returns instantly — and why the count it reports (9,592 primes) is a computation, not a lookup.

Worked examples

97 is prime. √97 ≈ 9.8; 97 is not divisible by 2, 3, 5 or 7 — proof complete. It is the 25th and largest prime below 100.

91 = 7 × 13. The classic trap: not divisible by 2, 3 or 5, so it feels prime — but 7 catches it. Always test to the square root.

360 = 2³ × 3² × 5. Full factorization: 360 ÷ 2 ÷ 2 ÷ 2 = 45, ÷ 3 ÷ 3 = 5, and 5 is prime. Its divisor count follows from the exponents: (3+1)(2+1)(1+1) = 24 divisors.

The first primes, and how they thin out

BelowPrimes found π(n)Rough density
1041 in 2.5
100251 in 4
1,0001681 in 6
10,0001,2291 in 8
100,0009,5921 in 10
1,000,00078,4981 in 13

Frequently asked questions

Is 91 a prime number?

No — 91 = 7 × 13. It is the classic false prime: it looks prime because it is not divisible by 2, 3 or 5, and many people stop checking there. Its smallest factor is 7, which is why a proper check tests divisibility up to the square root (√91 ≈ 9.5, so testing 2, 3, 5 and 7 settles it).

Is 1 a prime number?

No. 1 is neither prime nor composite — it is a unit. Primes are defined as numbers with exactly two distinct divisors (1 and themselves); 1 has only one. Excluding it also keeps the fundamental theorem of arithmetic clean: every number factors into primes in exactly one way, which would fail if 1 counted as prime.

How many prime numbers are there below 100 and below 1000?

25 below 100 and 168 below 1000. Primes thin out as numbers grow — the prime number theorem says the count below n is about n ÷ ln(n) — but they never run out: Euclid proved over two thousand years ago that the list is infinite, because multiplying any finite set of primes and adding 1 always creates a number with a new prime factor.

Why does the checker only test divisors up to the square root?

Because factors come in pairs. If n = a × b with a ≤ b, then a cannot exceed √n — otherwise both would exceed √n and their product would exceed n. So if no divisor appears by √n, none exists at all. For 97, testing 2, 3, 5 and 7 (√97 ≈ 9.8) is a complete proof of primality.

What is the largest known prime number?

As of late 2024, 2136,279,841 − 1, a Mersenne prime with 41,024,320 digits, found by the GIMPS volunteer computing project. The largest primes are almost always Mersenne primes (one less than a power of two) because a special test makes them far faster to verify than arbitrary numbers of similar size.

Note: this checker uses trial division and is exact for numbers up to 1012; the primes list is generated up to 100,000. Very large integers beyond that range are the territory of probabilistic tests (Miller-Rabin) used by cryptography software.

Related tools

Values last verified: 23 November 2026. Everything is calculated in your browser — nothing you type is sent anywhere.