Skip to content
ToolZone

Prime Number Checker

Determine whether a given number is prime, meaning it has no divisors other than 1 and itself, useful for math homework and exploration.

Runs in your browser. Nothing you enter or upload leaves your device.

17 is prime
Next primes: 19, 23, 29

Keyboard shortcuts

Run the main action
⌘ / Ctrl + Enter
Copy the result
⌘ / Ctrl + Shift + Enter
Download the result
⌘ / Ctrl + S
Paste a file or image into file tools
⌘ / Ctrl + V
Search all tools
⌘ / Ctrl + K
Show these shortcuts
?

You can also drop files anywhere on the page.

About the Prime Number Checker

Type a whole number and the Prime Number Checker tells you right away whether it is prime. If it isn't, you see its prime factorization, such as 84 = 2 × 2 × 3 × 7. If it is, you get the next three primes after it. It is built for students, teachers, puzzle fans, and programmers who need a quick, reliable answer.

How it works

The checker uses trial division. Numbers below 2 are not prime, 2 is prime, and any other even number is not. For odd numbers it tries dividing by 3, 5, 7, and every odd number up to the square root. If none divides evenly, the number is prime. Stopping at the square root works because if n = a × b, at least one of a or b must be no larger than √n.

For a composite number, the factorization uses the same idea: divide out 2 as many times as possible, then 3, then 4 (which never divides once 2s are gone), and so on, collecting each divisor. Whatever is left above 1 at the end is itself a prime factor. For primes, the tool tests the following integers one by one until it has found the next three primes.

How to use

  1. 1

    Type a whole number into the input box (it starts with 17 as an example).

  2. 2

    Read the green "is prime" or red "is not prime" result.

  3. 3

    For a composite number, check the Factors line for its prime factorization.

  4. 4

    For a prime, look at Next primes to see the three primes that come after it.

Worked examples

A small prime

Checking the default value.

Input
17
Result
17 is prime. Next primes: 19, 23, 29

A deceptive composite

A number that looks prime at first glance.

Input
91
Result
91 is not prime. Factors: 7 × 13

Repeated factors

Factoring for a fraction problem.

Input
360
Result
360 is not prime. Factors: 2 × 2 × 2 × 3 × 3 × 5

In exponent form, 360 = 2³ × 3² × 5.

The number 1

A common quiz question.

Input
1
Result
1 is not prime. Primes are defined only for integers ≥ 2
Limitations
Only whole numbers are checked; decimals are truncated to their whole part. Trial division is exact but slows down for very large primes, and values beyond 9,007,199,254,740,991 lose precision in the browser. Next primes are shown only when the input is prime, and composites don't show the nearest prime.
Assumptions
Prime is used in the standard sense: a positive integer of at least 2 with no divisors other than 1 and itself.
Privacy
All checks run in your browser and the numbers you enter are not sent or stored.

Frequently asked questions

Is 1 considered a prime number?+

No. A prime must have exactly two distinct positive divisors, 1 and itself, and 1 has only one. Excluding 1 also keeps prime factorizations unique.

How does the checker verify primality for large numbers?+

It divides by 2 and then by every odd number up to the square root of the input. If none divides evenly, the number is prime. This is exact, not a probabilistic guess.

Is 2 a prime number?+

Yes. Its only divisors are 1 and 2, which makes it the smallest prime and the only even one.

What is prime factorization?+

It is writing a number as a product of primes, for example 60 = 2 × 2 × 3 × 5. The checker shows this automatically for any composite number.

Are negative numbers prime?+

No. Primes are defined only for integers 2 and above, so the checker marks 0, 1, and all negative numbers as not prime.

Related tools