Square-root shortcut
Only divisors up to √n are tested — fast and mathematically complete.
Instantly test whether a number is prime or composite. See the smallest divisor that settles it, the nearest primes above and below, a divisor-test diagram, and an AI explanation of the logic.
A prime number is a whole number greater than 1 with exactly two divisors: 1 and itself. 97 is prime; 100 is composite because it has extra divisors. To test a number you only need to check divisors up to its square root.
See exactly which divisor (if any) decides the answer — no black box.
Only divisors up to √n are tested — fast and mathematically complete.
See the previous and next prime numbers around your input.
A grid shows each tested divisor and highlights the one that proves compositeness.
Type any whole number, e.g. 97.
We test divisors from 2 up to the square root.
Get prime/composite, the smallest divisor, nearest primes and an AI note.
Tap any row to load it into the calculator.
Test whether any integer from 2 up to the square root of the number divides it evenly. If none does, the number is prime; if one does, it is composite. You can stop at the square root because any factor larger than it must pair with a smaller one you already tested.
√97 ≈ 9.8, so we test 2, 3, 5, 7. None divides 97 evenly, so 97 is prime.
Beware "pseudoprimes" like 561 = 3 × 11 × 17, which fool some quick tests — true trial division still catches them.
Check whether any integer from 2 up to its square root divides it evenly. If none does, it is prime; otherwise it is composite.
No. A prime must have exactly two distinct divisors. 1 has only one divisor, so it is neither prime nor composite.
Yes — 2 is the smallest and the only even prime number.
Any divisor larger than the square root pairs with a smaller divisor you have already checked, so testing past √n is unnecessary.
A composite number is a whole number greater than 1 that has at least one divisor other than 1 and itself, such as 100 or 561.
Least common multiple with 4 methods.
Open toolGreatest common divisor & HCF.
Open toolBreak a number into prime factors.
Open toolList every divisor & factor pair.
Open toolReduce fractions to lowest terms.
Open tool