Math

Prime Number Checker

Check whether a whole number is prime, with the trial-division method explained and worked examples for 97 and 91.

Inputs

Results update as you type — essentials first

Saved scenarios

Store input snapshots on this device — load anytime.

No saved scenarios yet.

Formula / how it works

A prime has exactly two divisors, 1 and itself. To test n, check divisibility by every prime up to √n; if none divides n, it is prime. 1 is not prime.

Detailed guide

What it is, how to use it, how to read the numbers, common mistakes, a worked example, formulas, and FAQs.

What this calculator is

A prime number is a whole number greater than 1 whose only divisors are 1 and itself. 2, 3, 5, 7, 11 and 13 are primes; 9 and 15 are not. Primes are the building blocks of integers, since every whole number factors uniquely into primes, and they underpin modern cryptography. This tool tests a number using trial division. It is meant for classroom-size numbers, homework, puzzles and checking factors. It does not factorise very large numbers, which is a hard problem and the basis of security systems.

When to use / who it helps

  • You are checking homework or a puzzle involving primes.
  • You want to know if a number can be divided evenly by anything other than 1 and itself.
  • You are simplifying fractions and need to find factors.
  • You are exploring number patterns.
  • You are testing small numbers in a program.

How to use

Steps

  1. Enter an integer greater than 1.
  2. Read whether it is prime.
  3. If not prime, find a divisor by hand using the factor tools.
  4. Check divisibility by 2, 3 and 5 using quick rules.
  5. Repeat for neighbouring numbers to see prime gaps.
  6. Use specialised software for very large numbers.

How to interpret results

  • A prime result means the number has no divisors other than 1 and itself.
  • Composite means it has at least one other factor.
  • 2 is the only even prime.
  • Testing divisors up to the square root is enough.
  • 0, 1 and negative numbers are not prime.

Common mistakes & gotchas

  • Calling 1 a prime.
  • Assuming all odd numbers are prime.
  • Forgetting to test 7 and 11 when checking by hand.
  • Entering a decimal.
  • Using the tool for numbers far beyond the classroom range.

Worked example

Worked example — 97 and 91

  1. √97 ≈ 9.85, so test the primes 2, 3, 5 and 7.
  2. 97 is odd, its digit sum 16 is not divisible by 3, it does not end in 0 or 5, and 97 ÷ 7 ≈ 13.86, so none divide it.
  3. Therefore 97 is prime.
  4. For 91: √91 ≈ 9.54; 91 ÷ 7 = 13 exactly, so 91 = 7 × 13 and is not prime.

Result: 97 is prime; 91 is composite.

To load the form's own demo values, tap Try example above the Calculate button.

How to calculate / formula

A prime has exactly two divisors, 1 and itself. To test n, check divisibility by every prime up to √n; if none divides n, it is prime. 1 is not prime.

Frequently asked questions

What is a prime number?

A whole number greater than 1 with exactly two divisors: 1 and itself.

Is 1 a prime number?

No, by convention, because primes have exactly two divisors.

Why check only up to the square root?

A composite number must have a factor no larger than its square root.

Is 2 prime?

Yes, and it is the only even prime.

How many primes are there?

Infinitely many, as Euclid proved.

Why are primes important?

They underpin number theory and cryptography.