Active experiment

Prime Number Tester Calculator

Test an integer efficiently for primality.

Step 01 · Set up

Fill in the mathematics

Replace the highlighted values below. Tab moves naturally through the equation.

Step 03 · Answer

Ready when you are

Substitution & process

Enter the known values, then select Calculate. Your working steps will appear here.

Understand the method

What does the prime number tester calculation mean?

A prime is an integer greater than one whose only positive divisors are one and itself. To test an integer you only need to try divisors up to its square root, because any larger factor would have to pair with a factor smaller than the root.

When to use it

Use it to check primality, factor an expression, or confirm whether two integers are coprime.

Formula

nis prime when its only positive factors are1andn

In plain text: n is prime when its only positive factors are 1 and n

Variables and units

SymbolMeaning
nthe integer being tested
√nthe largest divisor worth trying

How to use the calculator

  1. Enter each known value in its labeled field.
  2. Select the answer precision you want.
  3. Choose Calculate answer to see the result and working.

Worked example

To test 97, try 2, 3, 5, and 7 because √97 ≈ 9.85. None divides 97 evenly, so 97 is prime. For comparison, 91 = 7 × 13 is composite.

Common mistakes

  • 1 is not prime; the definition requires an integer greater than one.
  • 2 is prime and is the only even prime.
  • You must test every prime up to the square root, not stop at the first miss.

Interpret the result

If no divisor up to the square root divides n evenly, no divisor at all exists, so n is prime.