This prime number test calculator checks whether any whole number you choose is prime, meaning it can only be divided evenly by 1 and itself, or composite, meaning a smaller number divides into it exactly. Enter a whole number up to one billion into the single field, and the result updates instantly as you type, with no need to press submit. It returns three results: a plain statement of whether your number is prime, the classification as prime or composite, and, where the number is composite, its smallest divisor, the smallest number greater than 1 that divides evenly into it. Under the hood, the calculator uses trial division, testing whether 2 divides your number evenly and then checking every odd number up to its square root, the standard, exact method for settling primality at this scale. Prime numbers, those with no divisors besides 1 and themselves, sit at the centre of number theory and underpin much of modern cryptography, hashing and computer science, so this tool suits students working through maths homework, programmers testing edge cases, and anyone curious whether a particular number is prime. Try a small prime like 97 or a composite number like 91 to see how the smallest divisor is reported, and enter as many numbers as you like.
A number n greater than 1 is prime if no integer from 2 up to the square root of n divides it evenly. If any does, n is composite and that divisor is a proper factor.
97 is not divisible by 2, 3, 5 or 7, and the square root of 97 is under 10, so there is nothing left to test: 97 is prime. By contrast 91 = 7 times 13, so its smallest divisor is 7. Enter 97 or 91 to confirm.
It is a whole number above 1 whose only divisors are 1 and itself, such as 2, 3, 5, 7 and 11.
No. By definition a prime has exactly two distinct divisors. The number 1 has only one, so it is neither prime nor composite.
It tries dividing by 2 and the odd numbers up to the square root of n. If none divide evenly, n is prime.
This calculator is for students, programmers and anyone exploring number theory.