Account

What new tool do you want?

Math & Education

Prime Number Checker & Factorization

Check whether a number is prime and find its prime factorization, all divisors, and the nearest primes above and below.

How to use

  1. 1Enter a whole number (up to 9 quadrillion).
  2. 2See whether it's prime, its prime factors and its divisors.

How it's calculated

Trial division by 2 and odd numbers up to √n. The number of divisors = Π(eᵢ + 1) over the prime factorization.

Frequently asked questions

Is 1 a prime number?

No — a prime has exactly two distinct divisors, 1 and itself. 1 has only one.

What's the only even prime?

2. Every other even number is divisible by 2.

How large a number can I check?

Up to 9,007,199,254,740,991 (2⁵³ − 1). Very large numbers with big prime factors may take a moment.

The nearest-prime search is a simple walk, not a shortcut

Finding the previous and next prime works by checking numbers one at a time, moving down from n − 1 and up from n + 1 until each hits a number that passes the same primality test used for the main result. For small and medium numbers this is instant, since primes are common enough nearby (there's rarely a gap of more than a few dozen integers between consecutive primes in this range). It does mean the search re-runs trial-division factorization on every candidate it checks along the way, rather than using a faster specialized primality test — a reasonable trade-off for a browser tool checking everyday-sized numbers, even though dedicated prime-finding software uses far more sophisticated methods for numbers with hundreds of digits.

A worked example: why 360 has exactly 24 divisors

360 factors as 2³ × 3² × 5¹. The divisor-count formula multiplies (exponent + 1) for each prime: (3+1) × (2+1) × (1+1) = 4 × 3 × 2 = 24. That works because every divisor of 360 is built by independently choosing a power of 2 from {0,1,2,3}, a power of 3 from {0,1,2}, and a power of 5 from {0,1} — 4 × 3 × 2 combinations in total, from 1 up to 360 itself. The same formula explains why a prime number like 97 always has exactly 2 divisors: its only exponent is 1, giving (1+1) = 2.

Why trial division is fast for small numbers and slow for some large ones

This tool checks for factors only up to √n, which is why factoring 360 is instant — you never need to test past 18 or so. But a number like 600,851,475,143 factors into 71 × 839 × 1,471 × 6,857, and finding that largest factor still requires testing candidates up to roughly its square root (about 775,000), which is why the tool notes that very large numbers with big prime factors can take a moment: there's no shortcut around checking that many candidates with simple trial division.

1 is a special case, not a small prime

A prime number is defined as having exactly two distinct divisors: 1 and itself. The number 1 only has one divisor (itself), so it fails that definition and is classified as neither prime nor composite — which is why this tool reports it separately as "1 is not prime" rather than grouping it with composites. It's a common misconception worth stating plainly since 1 behaves like the "simplest" number but doesn't fit the prime definition at all.

Why the full divisor list sometimes disappears

The divisor list only displays when the number of divisors is 200 or fewer, purely to keep the result readable. A highly composite number like 720,720 (2⁴ × 3² × 5 × 7 × 11 × 13) has (4+1)(2+1)(1+1)(1+1)(1+1)(1+1) = 240 divisors — over the cutoff — so this tool would show its divisor count and factorization but skip printing all 240 individual numbers. The headline count and factorization are unaffected either way; it's purely the itemized list that gets suppressed for numbers built from many small prime factors.

Related tools

More: Math & Education