Prime Number Checker

Client-sideNo sign-upFree

Check instantly whether a number is prime, with the factor that disqualifies it if not.

Quick facts

Category
Calculators
Best for
Quickly checking whether a number is prime without doing trial division by hand
Result
97 is prime
✓ 97 has no divisors other than 1 and itself.
In-content slot
Was this tool helpful?
On this page

Overview

Enter a whole number to check whether it's prime - divisible only by 1 and itself. The check uses trial division up to the square root of the number, which is fast and exact for any number within JavaScript's safe integer range. If the number isn't prime, the smallest factor that disqualifies it is shown, so you can see exactly why rather than just getting a yes/no answer. Runs entirely client-side.

Best for: Quickly checking whether a number is prime without doing trial division by hand

How to use this tool

  1. Enter a whole number. Any positive or negative integer.
  2. Trial division runs instantly. Checked for divisibility up to the square root of the number - exact, not probabilistic.
  3. See the result and why. If it's not prime, the smallest factor that disqualifies it is shown.

Frequently asked questions

Up to JavaScript's maximum safe integer (about 9 quadrillion). Trial division up to the square root stays fast even near that limit, but numbers beyond it can't be represented exactly enough to check reliably.

No - by definition, prime numbers are positive integers greater than 1 with exactly two divisors (1 and themselves). 0, 1, and all negative numbers are correctly reported as not prime.

Explore more free tools

Formatters, converters, validators, and generators - all free and running entirely in your browser.

Browse more tools