Prime number & factorization calculator
Check if a number is prime and get its prime factorization and number of divisors.
How the calculation works
A prime number has exactly two divisors: 1 and itself. 2, 3, 5, 7, 11, 13… are primes. Composite numbers (4, 6, 8, 9) have others.
How to test primality
Try dividing by primes up to its square root. If none divides evenly, it is prime. For 37, test up to ~6: not divisible by 2, 3 or 5 → prime.
Prime factorization
Every composite number has a unique product of primes (Fundamental Theorem of Arithmetic). Divide by the smallest possible prime, repeatedly:
360 = 2 × 180 = … = 2³ × 3² × 5
Counting divisors
From the factorization, add 1 to each exponent and multiply:
divisors = (e₁+1) × (e₂+1) × …
For 360 = 2³ × 3² × 5¹: 4 × 3 × 2 = 24 divisors.
Why it matters
Prime factorization underpins LCM/GCD, fraction simplification, and modern cryptography.
Examples
- 37 is prime: not divisible by any prime up to 6 (√37 ≈ 6.08).
- 84 = 2² × 3 × 7 → (2+1)(1+1)(1+1) = 12 divisors.
Frequently asked questions
Is 1 a prime number?
No. A prime has exactly two distinct divisors; 1 has only one.
Is 2 the only even prime?
Yes. Any other even number is divisible by 2, so it has more than two divisors.
How to factor a large number?
Divide successively by the smallest primes (2, 3, 5, 7…) until you reach 1. This calculator does it automatically.
How far do I need to divide to test a prime?
Up to the square root. To test 97 (root ≈ 9.8) you only check 2, 3, 5 and 7.
Why is 1 not prime?
Because factorisation would stop being unique, breaking the Fundamental Theorem of Arithmetic.
Do primes ever run out?
No. Euclid proved there are infinitely many over 2,000 years ago.
What do primes have to do with online security?
Multiplying two large primes is easy; factoring the product is infeasible. That asymmetry underpins RSA.
Related calculators
More Math calculators
See all →Scientific calculator
Free online scientific calculator: sine, cosine, tangent, root, power, log, ln, π and parentheses.
Percentage
Calculate percentages every way: X% of Y, increase, discount and percentage change.
Rule of three
Solve a simple rule of three (direct or inverse): enter three values and find the fourth.
Compound rule of three
Solve problems where two quantities vary at once (machines, days, output...), directly or inversely.
Area of shapes
Calculate the area of a square, rectangle, triangle, circle and trapezoid in seconds.
Pythagorean theorem
Find the hypotenuse or a leg of a right triangle (a² + b² = c²).
Logarithm
Calculate the logarithm of a number in any base, plus natural log (ln), log10 and log2.
Trigonometry (sin, cos, tan)
Calculate the sine, cosine and tangent of an angle in degrees or radians.
Updated on June 30, 2026 · by Rafael Rossi · Methodology & sources