Enter Integers
Use one line for a single calculation. Add more lines for batch processing.
Recent Local History
Formula Used
Prime factorization expresses an integer as a product of prime numbers. The largest value in that prime list is the largest prime factor.
n = p₁ × p₂ × ... × pₖ
Largest prime factor = max(p₁, p₂, ..., pₖ)
For negative inputs, the calculator factors the absolute value. The sign does not change the positive prime factors.
How to Use This Calculator
- Enter one integer or several integers.
- Select an automatic or manual factorization method.
- Choose a safe time limit for each value.
- Enable division steps when using trial or wheel mode.
- Press the calculation button and review the results.
- Copy, download, print, or save the result as PDF.
How the Calculation Works
The calculator first validates every submitted value. It rejects decimals, unsupported symbols, zero, and one.
Automatic mode tests whether the number is prime. Composite values are split with Pollard’s Rho factorization.
Trial division checks possible divisors in sequence. Wheel factorization skips many values that cannot be prime.
Repeated factors are collected and counted. The sorted final list reveals the smallest and largest factors.
Example Results
| Input | Prime factorization | Largest prime factor |
|---|---|---|
| 84 | 2² × 3 × 7 | 7 |
| 13195 | 5 × 7 × 13 × 29 | 29 |
| 97 | 97 | 97 |
| -45 | 3² × 5 | 5 |
Prime and Composite Numbers
A prime number has exactly two positive divisors. Those divisors are one and the number itself.
A composite number has more than two positive divisors. Every composite number can be written using prime factors.
When the input itself is prime, its largest prime factor equals the input. This is a valid one-factor prime factorization.
Special Cases
Zero has infinitely many divisors and no standard prime factorization. One is a unit and has no prime factors.
Negative numbers use the prime factors of their absolute values. A negative sign may be written separately as minus one.
Very large integers may need the GMP extension. The calculator reports this requirement instead of producing unsafe results.
Practical Uses
Prime factorization supports fraction simplification and divisibility analysis. It also helps calculate greatest common factors.
Number theory exercises often ask for largest prime factors. Programming challenges also use this calculation frequently.
Cryptography studies the difficulty of factoring large composites. This page is educational and not a cryptographic auditing tool.
Frequently Asked Questions
What is the largest prime factor?
It is the greatest prime number that divides an integer exactly.
What is the largest prime factor of a prime number?
The prime number itself is its only prime factor.
Does one have a largest prime factor?
No. One has no prime factors under standard definitions.
Does zero have a largest prime factor?
No. Zero has no unique finite prime factorization.
Can I enter negative numbers?
Yes. The calculator factors the corresponding absolute value.
Why are repeated factors shown?
Repeated factors reveal each prime exponent in the complete factorization.
Which method should I select?
Automatic mode is suitable for most calculations and mixed batches.
Why can trial division be slow?
It may test many candidates before finding a large factor.
What does GMP provide?
GMP enables reliable arithmetic with integers beyond native PHP limits.
Can I export multiple results?
Yes. The CSV button exports every successful displayed calculation.
Can the page work without JavaScript?
Core PHP calculations work normally. Export and history tools need JavaScript.