Advertisement

Prime Number Calculator

Check whether any integer up to 10,000,000 is prime, get a step-by-step prime factorization, and list all primes up to 1,000.

Enter a positive integer (up to 10,000,000) to test primality.

What is a Prime Number?

A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. Examples: 2, 3, 5, 7, 11, 13…

Trial Division: Test divisibility by all integers from 2 to √n. If none divide n evenly, n is prime.

Worked Examples

Example 1 — Is 97 Prime?

√97 ≈ 9.85. Test 2, 3, 5, 7 — none divide 97 evenly.

97 is PRIME

Example 2 — Factorize 360

360 is not prime. Step by step:

360 ÷ 2 = 180
180 ÷ 2 = 90
90 ÷ 2 = 45
45 ÷ 3 = 15
15 ÷ 3 = 5
5 ÷ 5 = 1
360 = 2³ × 3² × 5

Frequently Asked Questions

No. By definition, a prime number must have exactly two distinct positive divisors: 1 and itself. The number 1 has only one divisor (itself), so it is neither prime nor composite.

Yes, 2 is the only even prime number. Every other even number is divisible by 2, making it composite.

Prime factorization expresses a number as a product of prime numbers. For example, 60 = 2² × 3 × 5. Every integer greater than 1 has a unique prime factorization (Fundamental Theorem of Arithmetic).

Infinitely many. Euclid proved this around 300 BC. The primes become less dense as numbers grow larger, but they never stop.

As of 2024 the largest known prime is a Mersenne prime: 2^136,279,841 − 1, containing over 41 million digits. These records are tracked by the Great Internet Mersenne Prime Search (GIMPS).

Related Calculators