Prime Number Checker

Check if a number is prime, find all prime factors, and list all primes within a range. Instant results with factorization breakdown.

Is this number prime?

How to Use This Tool

  1. Choose a mode: "Is it Prime?" to check a single number, "Prime Factorization" to break a number into its prime factors, or "Primes in Range" to list all primes between two numbers.
  2. Enter the number (or range) into the input field.
  3. The result updates instantly as you type.
  4. For a non-prime number, review the prime factorization and the list of all divisors shown below the result.

Formula & How It Works

Trial Division Primality Test

n is prime if no integer i in [2, √n] divides n evenly

Test n for divisibility by every integer from 2 up to the square root of n; if none divide evenly, n is prime. Testing beyond √n is unnecessary because any factor larger than √n must pair with a factor smaller than √n.

Prime Factorization

n = p₁^e₁ × p₂^e₂ × … × pₖ^eₖ

Every integer greater than 1 can be written as a unique product of prime numbers raised to whole-number powers.

Divisor Pairing

If i divides n, then n / i also divides n

Divisors are found by testing integers up to √n; each divisor found below the square root pairs with a corresponding divisor above it.

Practical Examples & Common Use Cases

Example: Is 97 Prime?

Testing divisors from 2 up to √97 ≈ 9.8 (i.e. 2, 3, 5, 7): none divide 97 evenly, so 97 is prime.

Example: Prime Factorization of 360

360 = 2 × 2 × 2 × 3 × 3 × 5 = 2³ × 3² × 5.

Example: Primes Between 1 and 20

Checking each number from 1 to 20 gives the primes: 2, 3, 5, 7, 11, 13, 17, 19.

Frequently Asked Questions

A prime number is greater than 1 and has exactly two distinct divisors: 1 and itself. Examples: 2, 3, 5, 7, 11, 13.

No. By mathematical convention, 1 is not considered prime because prime numbers are defined as having exactly two distinct divisors, and 1 only has one divisor (itself).

Prime factorization breaks a number into a product of prime numbers. Every integer greater than 1 has a unique prime factorization. Example: 60 = 2² × 3 × 5.

To check if n is prime, test divisibility by all integers up to √n. If none divide evenly, the number is prime. This calculator uses that method.

Related Tools