UTILS.
Private by default
P

Prime Checker & Factorizer

Check whether a number is prime and show its prime factorization.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →

About this tool

Enter a whole number to find out whether it is prime and to see its full prime factorisation, for example 360 = 2^3 × 3^2 × 5. The result updates as you type and everything runs in your browser.

The tool uses trial division: it tries 2 and then odd candidates up to the square root of what remains, collecting each prime factor with its exponent. A number is reported as prime when the only factor found is itself with exponent 1, and a composite number shows its factors joined with × signs. A prime simply shows itself, such as 97 = 97.

The input must be a plain integer with an optional minus sign; decimals, empty input and text show an invalid message. Numbers above 1,000,000,000,000,000 (10^15) are refused with a notice, which keeps the page responsive because trial division on very large primes would take far too long. Values below 2, meaning 1, 0 and all negatives, are reported as not prime with no prime factors.

There is no probabilistic test and no big-integer mode, so this is for everyday sizes rather than cryptographic ones.

Frequently asked questions

How big a number can I check?
Up to 10^15 (one quadrillion). Larger values are rejected with a notice, because trial division up to the square root would otherwise freeze the page.
Is 1 prime?
No. A prime has exactly two distinct divisors, so 1, 0 and negative numbers are reported as not prime with no prime factors.
Can I enter a decimal or a negative number?
Only whole numbers are accepted. Decimals show an invalid message, and a negative number is reported as not prime.
How is the factorisation written?
Repeated factors use an exponent and are joined with ×, so 360 becomes 2^3 × 3^2 × 5. A prime number shows only itself.

More tools