calculatorgate.com
Home
/Prime Number Check

Prime Number Check and Factorization

Check whether a whole number is prime and break it down into its prime factors. Enter any number up to one trillion, and see its divisors and the nearest primes before and after it.

Last updated: November 15, 2026 · Written by the CalculatorGate team

Example: is 97 prime?

√97 is about 9.8, so only the primes below 10 need to be tested:

Primes to test2, 3, 5, 7
Does any divide 97?No
Result97 is prime
Previous prime89
Next prime101

What Are Prime Numbers?

The building blocks of all numbers

A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29...

2 is the only even prime: Every other even number is divisible by 2, making it composite. This makes 2 unique among primes.

How to check if a number is prime: Only check divisibility by primes up to the square root. To test 97: check 2, 3, 5, 7 (√97 ≈ 9.8). If none divide evenly, it's prime.

Infinitely many primes: Euclid proved around 300 BCE that there are infinitely many prime numbers. The largest known prime (as of 2024) has over 40 million digits.

Why primes matter: RSA encryption (securing online banking, email, HTTPS) relies on the fact that multiplying two large primes is easy, but factoring the result back into its prime components is computationally infeasible.

Prime number rules

  • n is prime if its only divisors are 1 and n
  • To test n, try dividing only by primes up to √n
  • Prime factorization: n = p₁ᵃ × p₂ᵇ × …
  • Number of divisors = (a + 1) × (b + 1) × …
  • n = the number you check
  • p₁, p₂ = its prime factors
  • a, b = how many times each factor appears

Worked example: is 360 prime?

Find the prime factors of 360 and how many divisors it has.

  1. Divide by 2 while you can: 360 → 180 → 90 → 45, so 2 appears 3 times.
  2. Divide by 3: 45 → 15 → 5, so 3 appears 2 times.
  3. 5 is prime, so 360 = 2³ × 3² × 5. It is not a prime number.
  4. Number of divisors: (3 + 1) × (2 + 1) × (1 + 1) = 24.

When to use it

  • Simplifying fractions and finding the GCD or LCM of two numbers.
  • Math homework, puzzles and competition problems.
  • Checking a large number quickly instead of dividing by hand.
  • Learning the basics behind encryption, which relies on large primes.

Common mistakes

  • Calling 1 a prime: a prime needs exactly two divisors, and 1 has only one.
  • Forgetting that 2 is prime: it is the only even prime.
  • Assuming odd means prime: 9, 15, 21 and 91 are all odd but composite.
  • Testing every number up to n: checking up to √n is enough.

Frequently asked questions

Short answers to common questions

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...

Is 1 a prime number?

No, 1 is not a prime number. Prime numbers start from 2.

What is the smallest prime number?

The smallest prime number is 2. It's also the only even prime number.

What is prime factorization?

Writing a number as a product of prime numbers. Example: 12 = 2 × 2 × 3

Can negative numbers be prime?

No, by definition prime numbers are positive integers.