🔒 100% private — runs in your browser, nothing is uploaded

Prime Checker & Factoriser

Is it prime? Check a number, see its full prime factorisation, and find the primes on either side.

A prime is a whole number greater than 1 whose only divisors are 1 and itself, and checking one honestly means looking for divisors: if any number up to its square root divides it evenly, it is composite. That square-root shortcut is what makes the check fast — a divisor larger than the square root would have to pair with one smaller than it, which the search would already have found. The number 97 survives the test and is prime. The number 561 is the classic cautionary tale: it looks prime-ish, fools some fancier probabilistic tests, but factorises cleanly as 3 × 11 × 17, and plain trial division finds the 3 immediately.

Checking is exact trial division in your browser. It is instant for everyday numbers; very large inputs (above about a trillion) can take a few seconds because every candidate divisor up to the square root is genuinely tested. Nothing is uploaded or stored.

Quick answers

Is 97 prime?

Yes. No number up to √97 ≈ 9.8 divides it — not 2, 3, 5 or 7 — so its only divisors are 1 and 97.

Its neighbours make a tidy illustration: the previous prime is 89 and the next prime after 97 is 101.

What is the prime factorisation of 561?

561 = 3 × 11 × 17. It is composite despite passing Fermat-style primality tests, which is exactly why it is famous as the smallest Carmichael number.

Trial division finds it immediately: 561 ÷ 3 = 187, and 187 = 11 × 17. Factorisations like this are always unique — every composite has exactly one prime factorisation.

How to use

  1. Type the whole number you want to test.
  2. Read the verdict: prime, or composite with the reason shown.
  3. If it is composite, read its prime factorisation — the full list of primes that multiply to give it.
  4. Use the previous and next prime shown with the result when you need a nearby prime rather than this number.

About this tool

The factorisation is the more useful output for most visitors. Every composite breaks down into a unique multiset of primes — 360 = 2 × 2 × 2 × 3 × 3 × 5 — and that list is what fraction reduction, GCD work and a lot of cryptography-adjacent homework actually run on. One honest limit, stated on the page: trial division tests every candidate up to the square root, so a prime near a trillion (square root: a million) is still quick, but inputs far beyond that can take seconds, and the page says so instead of pretending to be a large-number factoring service.

Frequently asked questions

Is 1 a prime number?

No. A prime needs exactly two divisors — 1 and itself — and 1 has only one. Excluding 1 is also what keeps the fundamental theorem tidy: if 1 were prime, factorisations would never be unique, since any number could include extra 1s. The primes begin at 2, which is also the only even prime.

Why does the check only go up to the square root?

Because divisors come in pairs that multiply to the number. If a divisor larger than the square root existed, its partner would be smaller than the square root and would have been found first. Finding nothing up to the square root therefore proves there is nothing to find — it is a proof, not a shortcut that might miss one.

What is 561, and why do people mention it?

561 = 3 × 11 × 17 is the smallest Carmichael number: composite, yet it passes Fermat’s little-theorem test for every base that shares no factor with it, which makes it the standard counterexample showing why that test alone cannot prove primality. Deterministic trial division, as used here, is not fooled by it.

How big a number can I check?

Any whole number the browser can represent exactly, up to 9,007,199,254,740,991. In practice, speed is the real limit: the trial division is instant for everyday sizes, takes a moment for primes in the trillions, and the page warns before very large inputs rather than silently hanging.

📦 Embed this tool on your site

<iframe src="https://verystep.com/embed/prime-checker/" title="Prime Checker & Factoriser" width="100%" height="520" loading="lazy" style="border:0"></iframe>

Free to use. The embed shows a small "Powered by Verystep" link.

First time embedding? Read the step-by-step guide →

More free tools