Map Extract
Free tool

Prime number checker

Type any whole number of up to 30 digits. The tool says whether it is prime, breaks it into prime factors if it is not, and shows the primes either side of it.

Runs in your browser. Nothing you enter is uploaded.

Checking a number

  1. Enter the number

    Type a whole number with digits only, no commas or spaces inside it.

  2. Read the verdict

    The large result says whether it is prime or composite. Numbers below 2 are reported as not prime, since primes start at 2.

  3. See the factors and neighbours

    For a composite number the Prime factors are listed with powers, for example 2^3 × 3^2 × 5. Previous prime and Next prime show the nearest primes below and above.

Examples

97 is prime; the primes either side are 89 and 101. 91 looks prime at a glance but is 7 × 13, a classic trap in quizzes. 360 breaks down as 2^3 × 3^2 × 5, which explains why it divides so neatly into halves, thirds, quarters, fifths, sixths and more.

This year, 2026, is not prime: it is 2 × 1013, and 1013 itself is prime.

Input
97
91
360
2026
Result
Prime (previous 89, next 101)
Composite: 7 × 13
Composite: 2^3 × 3^2 × 5
Composite: 2 × 1013

How the test works

Small divisors are checked before anything else, and then the Miller-Rabin test runs with the first thirteen primes as witnesses. With those witnesses the answer is proven correct for every number below about 3.3 × 10^24, which covers anything up to 24 digits. Between 25 and 30 digits the test is still extremely reliable but is, strictly, a probable-prime test.

Factorising is harder than testing. The tool divides by candidate factors for a fraction of a second; when a big number has no small divisors to find, it will say it is too large to factorise quickly in a browser, even though it can still tell you the number is composite.

Questions people ask

Is 1 a prime number?

No. A prime has exactly two different divisors, one and the number itself, whereas 1 is divisible only by 1. Treating 1 as prime would also break the rule that every whole number has a single prime factorisation, so mathematicians exclude it. The smallest prime is 2, the only even one.

How do I find the prime factors of a number?

Divide by the smallest prime that goes in exactly, then repeat with the result until you reach 1. For 360: halve three times to 45, divide by 3 twice to 5, and 5 is prime. The factors are 2, 2, 2, 3, 3 and 5, written 2^3 × 3^2 × 5.

What are the primes under 50?

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43 and 47, fifteen in total. To list larger primes, type a number into the checker and read the next prime, then type that number plus one, and so on.

Where your data goes

Primality testing and factorising run on your own device in this tab. The numbers you check are not logged or sent.

Checked against the tool on

Top