A prime number is a whole number greater than 1 whose only divisors are 1 and itself — 2, 3, 5, 7, 11, 13, … Any other number above 1 is composite and can be broken into a unique product of primes. This calculator tests primality by trial division up to √n, then gives the prime factorization, the total number of divisors, and the next prime above your number.
Reviewed: June 20, 2026 · Author: Naveen P N, Founder — AI Calculator · Verified against: trial-division primality and the fundamental theorem of arithmetic, recomputed in code.
How the check works
To test a number you only need trial divisors up to its square root: any factor above √n must pair with one below it, so if none below works, none above does either. Once you have the prime factorization, the number of divisors falls out by adding one to each exponent and multiplying — for 100 = 2²·5² that's (2+1)(2+1) = 9. Every integer above 1 has exactly one prime factorization, the fundamental theorem of arithmetic.
Worked example — 97 and 100
Scenario: one prime and one composite.
97 survives every trial divisor up to 9, so it's prime — with exactly 2 divisors and a next prime of 101. 100 factors as 2² × 5², giving 9 divisors (1, 2, 4, 5, 10, 20, 25, 50, 100) and a next prime of 101 as well. A bigger composite, 360, factors as 2³ × 3² × 5 with (3+1)(2+1)(1+1) = 24 divisors.
Frequently Asked Questions
A whole number > 1 with exactly two divisors, 1 and itself: 2, 3, 5, 7, 11, 13… 2 is the only even prime.
Trial division: if nothing from 2 to √n divides it, it's prime. 97 has no factor up to ≈9.8, so it's prime.
No — 1 is neither prime nor composite. A prime needs exactly two divisors; 1 has only one.
Writing a number as a product of primes: 100 = 2² × 5², 360 = 2³ × 3² × 5. Each number has exactly one such form.
The smallest prime above it. After 100 → 101; after 17 → 19. Primes are infinite (Euclid).