tooldeb Online Tools
Categories
Finance & Investing Interest, savings, returns, and inflation. Loans & Property Mortgages, repayment, DSR/DTI/LTV, and jeonse. Tax & Payroll Take-home pay, severance, insurance, and taxes. Shopping & Pricing Discounts, tips, unit price, and margins. Health & Fitness Body metrics, nutrition, and training. Math Percentages, fractions, algebra, and sequences. Geometry Area, volume, and surface of plane and solid shapes. Statistics & Probability Averages, spread, combinations, and odds. Unit Conversion Length, weight, temperature, pressure, and more. IT & Digital Data size, screens, color, and network speed. Engineering & Electronics Circuits, resistance, PCB, and signals. Date & Time Ages, D-day, date math, and time zones. Home & Interior Paint, tile, wallpaper, flooring, and concrete. Automotive Fuel cost, economy, tires, and vehicle tax. Everyday Bills, delivery, photos, and odds and ends.
EN
한국어 English

Prime Number Checker

Check whether a whole number is prime or composite, and list all of its divisors (factors) with a count.

Inputs
Is it prime?
17
Prime
Divisors (factors)
1, 17
Number of divisors
2
1 is neither prime nor composite by definition. Only whole numbers from 1 up to 1 trillion (10^12) are checked — above that the trial-division search takes long enough to freeze the page, so the calculator shows — instead. The same limit applies to the prime factorisation tool.

What makes a number prime

A prime number is a whole number greater than 1 whose only divisors are 1 and itself — exactly two divisors. Any number with more divisors is composite. This tool trial-divides up to √n, which is enough to find every factor.

prime ⇔ n > 1 and divisor count = 2 check factors i where i × i ≤ n
  • n — the number being checked
  • i — trial divisor, tested up to √n

More detail

Why only test up to √n

Divisors come in pairs that multiply to n — for 36, 2 pairs with 18, 3 with 12, 4 with 9, 6 with 6. One member of every pair is always ≤ √n, so once you've tested every candidate up to the square root you've found them all. That's why checking 17 only needs trial divisors 2, 3, and 4 (since 4² = 16 < 17 < 25 = 5²).

Quick screen. Every prime above 3 is of the form 6k ± 1. If a number isn't 2 or 3 and isn't next to a multiple of 6, it can't be prime — a fast mental filter before you divide.

Frequently asked questions

Is 17 a prime number?

Yes. 17's only divisors are 1 and 17 (two divisors), so it's prime. Enter 17 above to see the divisor list and count.

Is 1 a prime number?

No. A prime must have exactly two distinct divisors, but 1 has only one (itself). By convention 1 is neither prime nor composite — this tool reports it as 'not prime'.

Why is 12 composite?

12 has six divisors — 1, 2, 3, 4, 6, and 12 — which is more than two, so it's composite (not prime). Enter 12 above to see all of them listed.

What is the smallest prime number?

2 — it's the only even prime, since every other even number is divisible by 2. The next primes are 3, 5, 7, 11, and 13.

Related calculators

Browse all Math calculators