Prime Number Checker

Check whether a number is prime, see its prime factors and all its divisors, find the next and previous prime, and list every prime up to a limit.

Math & Science Runs in your browser · no upload

Reviewed 23 November 2026 · Free · No account needed

ExecutionYour browserInput never leaves your tab
File retentionNoneNothing is stored
AccountNot requiredNo sign-up, no paywall
PriceFreeNo trial, no usage cap on the tool itself

How to use

  1. Type a whole number from 0 up to 1,000,000,000,000,000 (10 to the power 15).
  2. Read whether it is prime, composite or neither, with its prime factorisation and its number of divisors.
  3. See the next prime above it, the previous prime below it and the full list of divisors.
  4. To list primes, type a limit up to 1,000,000 in the second box and press Copy list.

Example

Input: 360

Output: Not prime. 360 = 2³ × 3² × 5, with 24 divisors

How it works

The tool divides the number by 2, by 3 and then by numbers of the form 6k − 1 and 6k + 1, up to its square root. If none divides it evenly, it is prime. The same divisions give the prime factors, and the divisors are built from them. The list of primes uses the sieve of Eratosthenes.

n is prime when n ≥ 2 and no whole number from 2 up to √n divides it. Every prime above 3 has the form 6k ± 1, so only those candidates are tried. The number of divisors is the product of (exponent + 1) over the prime factors.

Another example

For 360: 360 = 2 × 180 = 2 × 2 × 90 = 2³ × 45 = 2³ × 3² × 5, and the divisors number (3 + 1) × (2 + 1) × (1 + 1) = 24. For 97, none of 2, 3, 5 or 7 divides it and √97 is about 9.85, so 97 is prime. The next prime is 101 and the previous is 89.

Limits and edge cases

  • Whole numbers from 0 to 10^15 only. Larger numbers are refused, because the browser cannot calculate them exactly.
  • The prime list stops at 1,000,000. Only the first 2,000 primes are shown on the page, but Copy list copies all of them.
  • The divisor list shows the first 120 divisors for numbers that have more.
  • A very large prime near the limit can take a fraction of a second to check.
  • 0 and 1 are neither prime nor composite. 2 is the only even prime.
  • The previous prime of 2 does not exist, so the tool shows None.
  • Negative numbers and decimals are rejected with a message.
  • A number such as 561 fools some quick tests used elsewhere but is composite (3 × 11 × 17). This tool tries real divisors, so it is not fooled.

Privacy

Everything is calculated in this browser tab. The numbers you enter are never sent to a server or stored.

About this page

Written and reviewed by Toolnexo on 23 November 2026. The limits above describe the published tool, not an idealised version of it. If a result looks wrong or the page is unclear, email [email protected] with the tool URL and what you entered. Corrections are published here.

Further reading

Guides that use Prime Number Checker

All guides →

Related tools

FAQ

Questions about Prime Number Checker

What is a prime number?

A prime number is a whole number greater than 1 whose only divisors are 1 and itself. The first primes are 2, 3, 5, 7, 11, 13 and 17. A number with more divisors is called composite.

Is 1 a prime number?

No. A prime has exactly two divisors and 1 has only one. Leaving 1 out also keeps prime factorisation unique, because otherwise you could write 6 as 2 × 3 or 1 × 2 × 3 and so on.

Is 2 prime?

Yes. It is the smallest prime and the only even one, because every other even number is also divisible by 2.

What is prime factorisation?

It is writing a number as a product of primes, such as 360 = 2³ × 3² × 5. Every whole number above 1 has exactly one such form, apart from the order of the factors.

How many primes are there below 100, 1,000 and 1,000,000?

There are 25 primes below 100, 168 below 1,000 and 78,498 below 1,000,000. You can check these with the list tool.

How big a number can it check?

Whole numbers up to 10^15, which is 1,000,000,000,000,000. Beyond that the browser cannot hold the exact value, so the tool refuses rather than guess.

Is anything uploaded?

No. Everything is calculated in your browser and nothing is sent anywhere.