Prime Number Calculator
Check whether a number is prime and, if it is not, see its prime factorization. Enter any whole number to find out if it is prime, and to view the prime numbers that multiply together to make it.
97 is
Prime
Who should use it: Students, teachers, and anyone exploring number theory.
How to use this calculator
- 1Enter the whole number you want to check.
- 2Review whether it is prime or not prime.
- 3If it is not prime and greater than 1, read its prime factors.
Understanding the inputs
| Number | The whole number to test. Non-integer values are rounded down to the nearest whole number before testing. |
How the calculation works
A prime number is a whole number greater than 1 that is divisible only by 1 and itself. The calculator tests divisibility by every whole number from 2 up to the square root of the input; if none divide evenly, the number is prime. If the number is not prime and is greater than 1, it also lists the prime factors that multiply together to produce it.
Worked example
Scenario: Number 97.
Result: 97 is Prime, because no number from 2 to √97 (about 9.8) divides it evenly.
How to interpret your result
A "Prime" result means the number is only divisible by 1 and itself. A "Not prime" result means the number has other divisors; for numbers greater than 1, the prime factors show exactly which prime numbers multiply together to make it. The numbers 0 and 1 are not prime, and negative numbers are reported as not prime.
Factors that can affect the result
- Size of the number: larger numbers take more divisibility tests, but the calculator only checks up to the square root, which keeps it fast.
- Non-integer input: decimal values are rounded down to the nearest whole number before testing.
- Negative numbers and 0/1: these are reported as not prime, since primes are defined as whole numbers greater than 1.
Limitations and assumptions
- Tests whole numbers only; decimal inputs are floored before testing.
- Reports negative numbers, 0, and 1 as not prime without listing factors.
- Shows the prime factorization for composite numbers greater than 1 only.
Frequently asked questions
Related calculators
Methodology
The calculator tests divisibility by every integer from 2 up to the square root of the (floored) input to determine primality, and factors composite numbers greater than 1 by trial division.
Sources and references
- Mathematical basis — primality by trial division up to the square root and prime factorization are standard results of number theory; no external source is required
Disclaimer: Results are provided for informational purposes and may vary depending on the values entered, the assumptions described above, and rounding. They are not a substitute for professional advice specific to your situation. Read the full disclaimer.