Prime Number Checker & Prime Factorization
Enter an integer to check if it’s prime and see its prime factorization. Everything runs in your browser.
What this calculator does
This tool determines whether a number is prime and computes its prime factorization. It uses an optimized trial division up to \( \sqrt{n} \), checking 2, 3, and then only candidates of the form \( 6k \pm 1 \) (since all primes \(>3\) are \(6k\pm1\)).
Definitions
- Prime: \(n>1\) with no divisors other than 1 and \(n\).
- Composite: \(n>1\) that is not prime.
- Prime factorization: \( n = \prod p_i^{e_i} \) where each \(p_i\) is prime.
\( \text{Factorization: } n = \prod p_i^{e_i}, \; e_i \in \mathbb{Z}_{\ge 0} \)
Frequently Asked Questions
Why skip some numbers when testing divisibility?
After checking 2 and 3, any composite number has a factor that is not of the form \(6k\pm1\), so we only test those forms to reduce work.
Is 1 prime?
No. By definition, primes are integers \(\ge 2\).
How are negatives handled?
We display \( -1 \times \) the factorization of \(|n|\). Example: \(-84 = -1 \times 2^2 \times 3 \times 7\).
Performance limits?
Trial division up to \( \sqrt{n} \) is quick for typical classroom sizes (up to ~1010 is usually fine in modern browsers). Extremely large inputs will take longer.
Privacy?
100% client-side—no uploads, no storage.