esc
Calculators

Prime number checker:
is it prime? next and previous prime

Type a whole number and find out at once whether it is prime. For composite numbers you see what divides them, and for small numbers, the trial divisions up to the square root.

Whole numbers up to 40 digits.
Is 221 prime?No, it is composite
Smallest prime factor
13
Prime factorization
13 × 17
Example
221 = 13 × 17
Previous prime
211
Next prime
223
How it was checked
Exact test (Miller–Rabin with fixed bases, proven for this size)
Trial division by primes up to √221 ≈ 14.8661
PrimeDivisionResult
2221 ÷ 2 = 110 r 1no
3221 ÷ 3 = 73 r 2no
5221 ÷ 5 = 44 r 1no
7221 ÷ 7 = 31 r 4no
11221 ÷ 11 = 20 r 1no
13221 ÷ 13 = 17 r 0divides

How to use Prime number checker

  1. 01Type the numberUp to 40 digits.
  2. 02Read the answerPrime or composite.
  3. 03See the neighboursPrevious and next prime.
File character arranging marked pages

Exactly two factors: 1 and itself.

A prime has no divisors except 1 and itself; 1 is not prime and 2 is the only even prime. For small numbers the check is trial division by every prime up to the square root. Large numbers use the Miller–Rabin test with the first 13 prime bases, which is proven correct for every number below 3.3 × 10²⁴ and almost certain above that.

At a glance

Price
Free. No sign-up, no watermark.
Privacy
Your text stays in your browser. Nothing is uploaded.
Works in
Chrome, Edge, Firefox and Safari, on phones and computers

Questions

Is 221 prime?

No. 221 = 13 × 17. It is a common trick question because it is not divisible by 2, 3, 5, 7 or 11.

Why do I only need to test up to the square root?

If n = a × b and both a and b were bigger than √n, their product would be bigger than n. So any composite number has a factor no larger than its square root. For 221, √221 ≈ 14.9.

Is 2,147,483,647 prime?

Yes. It is 2³¹ − 1, a Mersenne prime and the largest value of a signed 32-bit integer.

Is what I type sent anywhere?

No. The calculation runs in your browser and nothing you type leaves your device.