One engine for everything you might want to know about a whole number. Hand it a number and it tells you whether that number is prime, and if it is not, exactly what it is made of — the full prime factorisation, how many divisors it has, what they sum to, Euler's totient, the nearest prime on either...
WORTH TRYING
97 IS
PRIME
PRIME GAP TO NEXT
+4
Exactly two divisors, 1 and itself. Previous prime 89, next 101.
Prime factorisation
97
Number of divisors
2
Sum of divisors
98
Totient φ(n)
96
Previous prime
89
Next prime
101
FACTOR BREAKDOWN
PRIME
POWER
CONTRIBUTES
97
1
97
STEPS
Trial-divide 97 by every prime up to √97 ≈ 9 — beyond that a factor would have a partner below it
No divisor found, so 97 has exactly two divisors: 1 and itself
Every prime above 3 sits next to a multiple of 6 — here 97 is 6 × 16 + 1
97 is PRIME
SIEVE OF ERATOSTHENES
Two thousand years old and still the fastest way. Take the first uncrossed number, 2, and strike out every multiple of it. Move to the next survivor, 3, and repeat. Each pass can start at the square of its prime, because anything smaller was already struck by a smaller factor — which is why the passes get shorter and stop entirely once the prime exceeds √100. Whatever survives is prime. Your number 97 is outlined in gold.
HOW MANY PRIMES BELOW x — AND WHAT THE THEORY PREDICTS
Actual count against x ÷ ln x. At x = 10 the estimate overshoots slightly; from 100 upward it runs low, and from 1,000 onward the gap narrows steadily — a ratio of 1.16 at a thousand down to 1.10 at a hundred thousand. That it tends to 1 at all is the Prime Number Theorem, and how slowly it does so is why the proof took a century to find.
Proved, not guessed. Primality here uses a deterministic Miller–Rabin test with a fixed witness set that is proven correct for every number this page accepts, so a result of PRIME is a proof rather than a probability. Ranges are sieved up to 200,000; single numbers are tested up to 4,503,599,627,370,495.
Live simulation · drawn to scale · updates as you type
In TEST mode, type any whole number from 2 up to about four and a half quadrillion. You get the verdict immediately, along with the factorisation if it is composite, the gap to the next prime if it is not, and six derived quantities including the divisor count and Euler's totient.
Try the suggested numbers before anything else. 91 looks prime and is 7 × 13. 561 fools the Fermat test but not this one. 8128 is a perfect number, 2147483647 is the Mersenne prime 2³¹ − 1, and 600851475143 factorises into four primes in a fraction of a second.
Switch to RANGE to sieve an interval up to 200,000. You get every prime in it, the count, the density as a percentage, the twin pairs and the sum. The quick-range buttons cover the intervals people usually want.
Watch the sieve on the right, or drag the scrubber through it a pass at a time. If your number is 100 or below it is outlined in gold on the grid, so you can see whether it survives or gets struck, and by which prime.
Is 97 prime? The square root of 97 is about 9.85, so the only primes worth trying are 2, 3, 5 and 7 — anything larger would need a partner smaller than 9.85, and we are already checking those. 97 is odd, so 2 fails. Its digits sum to 16, which is not a multiple of 3, so 3 fails. It does not end in 0 or 5, so 5 fails. And 7 × 13 = 91, 7 × 14 = 98, so 7 fails too. No divisor found. 97 is prime — the largest two-digit prime, in fact. Its divisor count is 2, its divisor sum is 98, and φ(97) = 96, since every one of the 96 numbers below it is coprime to it. The previous prime is 89 and the next is 101, so 97 sits in a gap of 4 either side. Now contrast 91, which most people would also guess is prime. It is odd, its digits sum to 10, and it does not end in 0 or 5 — every quick test passes. But 7 divides it: 91 = 7 × 13. That is why the square-root rule matters. Stopping at 5 because the small tests passed would have given the wrong answer.
Binary Converter
Calculate instantly →
Hexadecimal Converter
Calculate instantly →
4 in Binary
Calculate instantly →
Random Number Generator
Calculate instantly →
8 in Binary
Calculate instantly →
16 in Binary
Calculate instantly →
10 in Binary
Calculate instantly →
1 in Binary
Calculate instantly →
255 in Binary
Calculate instantly →
2 in Binary
Calculate instantly →
6 in Binary
Calculate instantly →
9 in Binary
Calculate instantly →
11 in Binary
Calculate instantly →
14 in Binary
Calculate instantly →
128 in Binary
Calculate instantly →
5 in Binary
Calculate instantly →
7 in Binary
Calculate instantly →
12 in Binary
Calculate instantly →
32 in Binary
Calculate instantly →
3 in Binary
Calculate instantly →
Last updated: July 28, 2026 · Formula verified · Deterministic Miller–Rabin, so a result of PRIME is proven rather than probable · Eagle-eyed accuracy for every calculation.