Skip to main content
Preparing workspace

Prime Number Checker

Check whether a whole number from 2 to 9,007,199,254,740,991 is prime. Composite numbers show their smallest factor and its pair, like 91 = 7 × 13.

Still loading. If the tool doesn’t appear, reload this page.

About this tool

Prime Number Checker

Check whether a number is prime and see its factors if it isn't.

The Prime Number Checker tells you whether a whole number from 2 to 9,007,199,254,740,991 is prime. For a composite it shows the smallest divisor and its pair, for example 91 = 7 × 13. It checks small values by trial division and uses deterministic Miller–Rabin to confirm large primes without searching for factors.

How to use Prime Number Checker

  1. Type the whole number into the Number field of the Inputs card, which opens on 97.

  2. Read the verdict as you type. A prime has no positive divisors besides 1 and itself. A composite shows its smallest factor pair.

  3. Result reads Prime ✓, or Not prime with the factor pair beneath it such as 91 = 7 × 13; Copy places the inputs and verdict on the clipboard and Reset returns the field to 97.

Why use Prime Number Checker

  • Shows the divisor, not just a verdict

    A composite result comes with the actual factor pair it found, so you can see why it failed instead of being told only that it did.

  • Checks large primes quickly

    The browser can confirm a large prime with a fixed set of tests. For composites, the smallest factor is always at or below the square root.

  • Refuses ambiguous input

    Anything below 2 is rejected outright rather than being labelled prime or composite, since 1 and 0 are neither and negative numbers fall outside the definition.

Common use cases

  • You are working through a factorisation exercise and want to confirm that 391 is composite and see that it breaks down as 17 × 23 rather than hunting for the divisor yourself.
  • You picked a number for a maths puzzle or a class demonstration and need to be certain it has no divisors other than 1 and itself before putting it on the board.
  • You are checking a sequence — 2, 3, 5, 7, 11 and so on — and want a quick yes/no on each candidate without writing out the divisions.

Frequently asked questions

What is a prime number?

A whole number greater than 1 whose only positive divisors are 1 and itself. 2 is the smallest prime and the only even one; 1 is not prime, which is why this tool requires an input of at least 2.

Link to answer
How does the checker decide a number is prime?

It checks divisibility by 2 and 3, then looks for possible factors of the form 6k ± 1 up to the square root. For larger candidates, deterministic Miller–Rabin confirms a prime before the factor search. Its proven range covers all accepted inputs.

Link to answer
Does it give the full prime factorisation?

No — it reports the first factor pair it finds, which is the smallest divisor and its cofactor. For 60 that is 2 × 30, not 2² × 3 × 5; feed the cofactor back in if you want to keep breaking it down.

Link to answer
Is there a limit to how large a number I can test?

The maximum input is 9,007,199,254,740,991, the largest safe integer in JavaScript. For a large composite with no small divisor, finding its smallest factor can take longer than confirming a prime.

Link to answer

Embed this tool on your site

Add the Prime Number Checker widget to your blog or website — free, responsive, no signup. Just keep the “Widget by AltFTool” credit link visible.

<iframe src="https://www.altftool.com/embed/widget/prime-number-checker"
  title="Prime Number Checker — free AltFTool widget"
  width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden"
  loading="lazy" referrerpolicy="no-referrer-when-downgrade" allow="clipboard-write"></iframe>
<p style="font-size:12px;margin:4px 0 0">Widget by <a href="https://www.altftool.com/tools/all/prime-number-checker?utm_source=embed&utm_medium=widget" rel="nofollow">AltFTool — free online tools</a></p>

Browse all embeddable widgets →