Free tools that run in your browser. Use any tool without an account.

Favourites Cart
Sign in
Join free

Prime Number Checker

  • Free
  • Nothing stored
  • No account needed

This tool tells you whether a whole number is prime and gives the smallest factor, certainty, previous prime and next prime. For example, 104729 is prime; the tool reports proven prime and returns nearest primes.

Is it prime?
Yes, 97 is a prime number
Certainty
Proven (deterministic Miller-Rabin test)
Next prime
101
Previous prime
89
Runs in your browser. Your files and values are not sent to us. Report a problem
Advertisement

About the Prime Number Checker

This tool tests a single whole number and shows five results: prime or not, the smallest factor, a certainty label, the previous prime and the next prime. You use it for homework checks, coding tests, quick research and curiosity. The check runs entirely in your browser so your number does not leave your device. The tool first tries small divisors. Then it runs Miller-Rabin with the first 13 prime bases 2 to 41 for a proven result up to 3,317,044,064,679,887,385,961,981. For larger inputs it runs 33 bases and reports probable prime. Results update as you type. You can copy the output or share a link that reopens with your number. That makes results fast and simple to reuse.

How to use it

  1. 1Enter a whole number in the input field
  2. 2See instant results: prime or not, smallest factor, certainty, previous and next prime
  3. 3Copy the result text to the clipboard
  4. 4Share the generated link to reopen the same number
Advertisement

Worked example

Input: 561 Is it prime? No Smallest factor: 3 Certainty: Proven composite Previous prime: 557 Next prime: 563

How it works

A prime is a whole number above 1 whose only divisors are 1 and itselfSmall divisors are tried firstThen the Miller-Rabin test runs with the 13 prime bases 2 to 41, which is a proof (no exceptions) for every number below 3,317,044,064,679,887,385,961,981Above that, 33 bases are used and a pass is reported as a probable prime; no composite number is known to pass such a testResults update instantly as the visitor types; there is no calculate buttonVisitors can copy the result and share a link that reopens with their numbers

Source: Miller, Rabin primality test - WikipediaSorenson and Webster, arXiv 1509.00864 (bases for deterministic MR). Last checked 6 November 2026.

What it is good for

  • Instant in-browser answers as you type
  • Shows smallest factor and nearest primes for context
  • Deterministic proof for numbers below about 3.317×10^24
  • Accepts whole numbers only; decimals and fractions are invalid
  • Above the proven bound results are reported as probable primes; very large factorizations may be slow
Advertisement

Questions people ask

Is 1 a prime number?

No. By definition a prime is an integer greater than 1 with exactly two positive divisors, 1 and itself. So 1 is neither prime nor composite.

How accurate are the results for big numbers?

For numbers below 3,317,044,064,679,887,385,961,981 the result is proven correct using 13 Miller-Rabin bases. For larger numbers the tool reports probable prime after 33 bases; no composite is known to pass such a test.

What does the certainty label mean?

Proven means the test guarantees correctness for that size range. Probable means the number passed strong tests but is reported as probable prime for huge inputs.

Does the tool send my number to a server?

No. The check runs in your browser, so your number stays on your device. You can copy results or create a share link that encodes the number in the page URL.

Can I check negative numbers or decimals?

No. Enter only whole numbers greater than or equal to 0. The tool treats 0 and 1 as not prime and gives clear feedback for invalid inputs.

How fast is the test?

Small numbers return instantly using trial division. Larger inputs use Miller-Rabin bases and still update as you type. Very large numbers may take more time in the browser.

Help keep every tool free

FreeToolr stays free because people help it grow. Share a tool you like, tell us what to build next, or support us on Ko-fi.

Advertisement
Advertisement