Skip to content
TextArray
100% local

Prime number checker

Check whether numbers are prime, see their prime factorization and the next prime.

Input
Output

Prime number checker

Paste one number per line — commas and spaces work too — and each is checked for primality instantly. Primes are labeled prime; composites come with their full prime factorization, so 42 becomes 42 = 2 × 3 × 7 and you can see at a glance why it fails. Switch on "Show next prime" and every line also names the nearest prime above the number, which is handy when hunting for a prime table size or hash modulus.

The checker handles whole batches: homework lists, candidate hash-bucket sizes, ID ranges, puzzle inputs. Special cases are explained rather than skipped — 1 is marked not prime by definition, 0 and negative numbers are flagged with a short reason, and anything that isn't a whole number gets a calm per-line note instead of derailing the run. The live tally counts how many numbers you checked and how many turned out prime.

Under the hood the tool uses deterministic trial division: divide by 2 and 3, then test 6k±1 candidates up to the square root. That is exact — no probabilistic test, no false positives — for integers up to 15 digits (under 10^15). Because numbers near that limit take millions of divisions, a single run accepts at most 20 numbers above one billion; smaller numbers are unlimited.

Everything runs in your browser. The numbers you check are never uploaded, logged or shared — useful to know when the list is exam material or production identifiers.

FAQ

Why is 1 not a prime number?
By definition a prime has exactly two distinct divisors: 1 and itself. The number 1 has only one divisor, so it is excluded. The convention keeps unique factorization working — if 1 were prime, 6 could be written as 2 × 3, 1 × 2 × 3, 1 × 1 × 2 × 3 and so on, endlessly.
How large can the numbers be?
Up to 15 digits (just under 10^15). The test is exact trial division up to the square root, so numbers near the limit take a few million divisions each. To keep the tab responsive, one run accepts at most 20 numbers above 1,000,000,000 — smaller numbers have no such cap.
What does the factorization show?
The complete multiset of prime factors in ascending order, with repeats written out: 12 = 2 × 2 × 3, 1024 = 2 × 2 × … × 2. Multiplying the factors always reproduces the original number, so the output doubles as a check.
What happens with negative numbers and zero?
Primality is defined for whole numbers greater than 1, so 0, negative values and 1 are all reported as not prime, each with a short reason. Fractions and other non-integer tokens get a per-line "not a whole number" note.
Are the numbers I check uploaded anywhere?
No. All checks run entirely in your browser and the numbers never leave your device.