Skip to content
UnitFormula

A prime number is a whole number greater than 1 whose only divisors are 1 and itself. To check, look for any divisor between 2 and the square root of the number: if none divides it evenly, it's prime; the first that does is its smallest factor. So 17 is prime (nothing from 2 to 4 divides it), while 15 is composite because 3 divides it (15 = 3 × 5).

Prime Number Checker — is a number prime?

Is 17 a prime number?

Prime?1Prime?Prime
Smallest factor
17

Quick examples

How it's calculated

  1. n is prime if its smallest factor is n itselfn is prime    smallest factor=nn \text{ is prime} \iff \text{smallest factor} = n
    n
    = 17
    17
Prime?1

How it works

A prime number is an integer greater than 1 that has exactly two divisors: 1 and itself. Numbers with more divisors are composite. By convention 1 is neither — it has only one divisor — so primes start at 2, the only even prime.

To test a number n, try dividing it by each integer from 2 upward. You only need to go as far as √n: if no divisor is found by then, none exists, because any factor larger than √n would pair with one smaller than √n that you'd already have caught. The first divisor found is the smallest prime factor; if you reach √n with none, n is prime.

Worked example

Is 17 prime? Check divisors up to √17 ≈ 4.1, so test 2, 3 and 4: 17 is odd (not ÷2), 1 + 7 = 8 isn't a multiple of 3, and it's not ÷4. No divisor — so 17 is prime, and its smallest factor is 17 itself.

Is 15 prime? √15 ≈ 3.9, so test 2 and 3: it's odd, but 1 + 5 = 6 is a multiple of 3, so 3 divides 15. That makes 15 composite, with smallest factor 3 (15 = 3 × 5). A perfect square like 49 is composite too — its smallest factor is 7.

Frequently asked questions

How do I check if a number is prime?

Try dividing it by every integer from 2 up to its square root. If any divides evenly, the number is composite; if none does, it's prime. You can stop at the square root because a factor above it always has a partner below it. For 91: √91 ≈ 9.5, and 7 divides it (91 = 7 × 13), so it's composite.

Why is 1 not a prime number?

Because a prime is defined to have exactly two distinct divisors, 1 and itself — and 1 has only one divisor (itself). Excluding 1 also keeps the fundamental theorem of arithmetic clean: every whole number above 1 factors into primes in exactly one way, which would fail if 1 counted as prime.

Is 2 really prime?

Yes — 2 is the smallest and the only even prime. Its only divisors are 1 and 2. Every other even number is divisible by 2, so no other even number can be prime. After 2, all primes are odd.

What's the smallest factor, and why is it useful?

It's the smallest integer greater than 1 that divides the number — always a prime. It tells you at a glance whether the number is prime (the smallest factor equals the number itself) or composite (it's smaller), and it's the first step in finding the number's full prime factorisation.

How can a computer check huge numbers quickly?

Trial division up to √n is fine for moderate numbers, and that's what this checker uses. For very large numbers (hundreds of digits), specialised primality tests like Miller–Rabin are used instead, since checking every divisor would take far too long. The definition of prime is the same; only the method changes.

What are twin primes and other patterns?

Primes thin out as numbers grow but never stop (there are infinitely many). Some come in pairs two apart — **twin primes** like 17 and 19 — and there are many other patterns and open questions. This tool checks one number at a time; the smallest factor it reports is the key to whether that number joins the primes.

How we know this is right

Last reviewed
Aug 5, 2026
Precision
Rounded to 0 decimal places.
Read our methodology

Sources