Prime Number Calculator

Enter a positive whole number.
Calculation Result
—

Prime Number Calculator – How to Use

This free prime number calculator helps you check whether a number is prime, find prime numbers within a range, calculate prime factors, and list all factors.

How to Use

  • Select the calculation type.
  • Enter a number or a starting and ending range.
  • Click Calculate.
  • Your answer will appear in the result section.
  • Click Copy Result to copy your answer.

Prime Number Formula

A prime number has exactly two positive factors: 1 and itself.

A number greater than 1 is prime if it cannot be divided evenly by any integer from 2 up to its square root.

Worked Examples

  • 7 is a prime number because its only factors are 1 and 7.
  • 12 is not prime because its factors include 1, 2, 3, 4, 6 and 12.
  • Prime numbers between 1 and 20: 2, 3, 5, 7, 11, 13, 17, 19.
  • Prime factorization of 12: 2 × 2 × 3.
  • Factors of 18: 1, 2, 3, 6, 9, 18.

Important Notes

  • Prime numbers are greater than 1.
  • 1 is neither prime nor composite.
  • 2 is the only even prime number.
  • Negative numbers, decimals and zero are not accepted.
  • Range searches are limited to 1,000,000 numbers.
  • Individual number calculations support safe JavaScript integers.

Frequently Asked Questions

What is a prime number?

A prime number is a whole number greater than 1 that has exactly two positive factors: 1 and itself.

Is 1 a prime number?

No. The number 1 has only one positive factor, so it is neither prime nor composite.

Is 2 a prime number?

Yes. 2 is the smallest prime number and the only even prime number.

What are the first 10 prime numbers?

2, 3, 5, 7, 11, 13, 17, 19, 23 and 29.

What is prime factorization?

Prime factorization means expressing a number as a product of prime numbers. For example, 30 = 2 × 3 × 5.

What is the difference between prime and composite numbers?

A prime number has exactly two positive factors, while a composite number has more than two positive factors.