Prime Checker & Factorization

Check whether a number is prime, see its prime factorisation and every divisor, find the nearest primes either side, and list the primes between two numbers.

60 is not prime
Prime factors: 60 = 2² × 3 × 5
Divides by:1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60
Nearest primes:before 59after 61

π(60) = 17: there are 17 primes up to 60

Show the working

Divide by the smallest prime that goes in, then do the same to what is left, until a prime remains.

  1. 60 ÷ 2 = 30
  2. 30 ÷ 2 = 15
  3. 15 ÷ 3 = 5

5 is prime, so the division stops.

Primes between two numbers
25 primes
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97
The nth prime
Two primes that add up to an even number

Prime or not, and the working

Type a whole number and the tool says in a sentence whether it is prime, and for a composite number shows the working underneath: 60 is not prime, and 60 = 2² × 3 × 5. Below that it lists what the number divides by, which is what makes an answer of not prime believable, and the nearest prime on either side of it. For numbers up to a size the page states, π(n) says how many primes there are up to the number, and "Show the working" opens the division chain — or, for a prime, the primes up to its square root that were tried. A separate section lists every prime between two numbers you choose. A number is prime when it is 2 or greater and has no divisors other than 1 and itself; 0, 1, negatives and decimals are not prime and have no factorization.

How far it goes, and how fast

It uses trial division up to the square root of the number, skipping everything that is not of the form 6k ± 1, so anything up to about a trillion resolves instantly and the largest whole number JavaScript can hold exactly — 9,007,199,254,740,991 — still resolves, if not quite instantly. Past it, a number typed as plain digits is read as an exact big integer and put through the Miller–Rabin test: below a bound the page states that is a proof, and above it the answer says “almost certainly prime”. The divisor list appears for numbers with at most 200 divisors, since a longer list is neither useful on a page nor cheap to build, and the first 24 are shown with a count of the rest. The range section spans up to a million numbers: its count is every prime in the span, the first 500 are listed, ready to copy, and "Mark twin primes" highlights each pair p and p + 2. “Show the gaps between them” lists the gap from each prime in the list to the next and names the largest. The last section, “Two primes that add up to an even number”, splits an even number into two primes, choosing the smallest first prime that works — Goldbach's conjecture says such a split exists for every even number from 4 up; it is unproved, but checked far past any number the box takes.

Why factorization matters

Prime factorization is the backbone of number theory and shows up everywhere from simplifying fractions and finding least common multiples to understanding how encryption keys are built. Because every integer greater than 1 has a unique prime factorization, the breakdown you see here is the one and only correct answer for that number. Everything is computed locally in your browser, so you can check as many numbers as you like without limits.

Frequently asked questions

How large a number can I check?

Up to 300 digits. To 9,007,199,254,740,991 — the largest integer JavaScript represents exactly — the answer comes from trial division; past it the number is read as an exact big integer and tested with Miller–Rabin, which is a proof below a bound the page states and “almost certainly prime” above it. Trial division runs only as far as the square root, so anything up to about a trillion answers instantly.

How do I know it is really not prime?

The page shows the factorisation and the list of divisors, so the claim can be checked rather than trusted: 91 is not prime because 91 = 7 × 13, and 1, 7, 13 and 91 are what it divides by. For a prime, the divisor list is just 1 and the number itself.

Can it list the primes in a range?

Yes. The section below takes a start and an end and counts every prime between them and lists them, with a copy button. The span can be up to a million numbers wide; the count covers the whole span, but only the first 500 primes are listed, so narrow the range if you need the ones after that.

Can it find the nth prime?

Yes. Type n and the page gives the nth prime, up to the limit it states.

Can it mark twin primes, or count the primes up to a number?

Yes. "Mark twin primes" highlights each pair p and p + 2 in the list and counts them, and for a single number π(n) says how many primes there are up to it, with "Show the working" giving the division chain.

Can it show prime gaps, or split an even number into two primes?

Yes. Tick “Show the gaps between them” under the range list and the gaps between consecutive primes are listed in order, with the largest gap and the two primes either side of it. “Two primes that add up to an even number”, last on the page, takes an even number and gives the split with the smallest possible first prime — Goldbach's conjecture, unproved but checked far past anything the box accepts.