Loading Prime Factorization Calculator…
How to Use Prime Factorization Calculator
New windowPrime Factorization, LCM & GCD breaks numbers into prime factors with the division ladder and uses the factors to find the least common multiple and greatest common divisor.

How to use it
- Type the numbers in Numbers, separated by spaces or commas, e.g.
12 18 30. One number gives its factorization; two or more give LCM and GCD as well. - Follow the ladder. Each row divides by the prime on the right. Numbers divisible by that prime are written in bold and divided; the others are copied down unchanged. The ladder ends when every number has become 1.
- Read the factorizations in power form for each number.
- Read LCM and GCD. The cards at the top give the values; the explanation below shows which prime powers were taken.
- Check coprime pairs – pairs whose GCD is 1.
- Press Copy results to copy the factorizations, LCM and GCD as text.

Theoretical Background
New windowPrime factorization
Every whole number greater than 1 can be written as a product of primes in exactly one way (fundamental theorem of arithmetic):
The division ladder finds it by dividing repeatedly by the smallest prime that still divides the number.
LCM and GCD from the factors
Write all numbers with the same primes (use exponent 0 where a prime is missing). Then
For two numbers the two are linked by
Worked example
Example
Find the LCM and GCD of 12, 18 and 30.
| ÷ | 12 | 18 | 30 |
|---|---|---|---|
| 2 | 12 | 18 | 30 |
| 2 | 6 | 9 | 15 |
| 3 | 3 | 9 | 15 |
| 3 | 1 | 3 | 5 |
| 5 | 1 | 1 | 5 |
| 1 | 1 | 1 |
\(12 = 2^2 \cdot 3\), \(18 = 2 \cdot 3^2\), \(30 = 2 \cdot 3 \cdot 5\).
LCM \(= 2^2 \cdot 3^2 \cdot 5 = 180\) (highest powers). GCD \(= 2^1 \cdot 3^1 = 6\) (powers common to all three; 5 is not in 12).
Euclid's algorithm
The GCD of two numbers can also be found without factoring, by repeated division with remainder:
Example: \(\gcd(84, 36) = \gcd(36, 12) = \gcd(12, 0) = 12\). This is much faster for very large numbers, and the app uses it to check its results.
Where LCM and GCD are used
- LCM: common denominator of fractions (\(\tfrac{1}{12} + \tfrac{1}{18}\) uses 36), events repeating with different periods, gear teeth meeting again.
- GCD: simplifying fractions (\(\tfrac{18}{30} = \tfrac{3}{5}\) after dividing by 6), cutting pieces of equal largest size, tiling.
FAQ
What does coprime mean?
Two numbers are coprime (relatively prime) when their GCD is 1, e.g. 8 and 15. Coprime numbers need not be prime themselves.
Why is the LCM of coprime numbers their product?
They share no prime, so every prime power appears in only one of them and all of them are needed: LCM(8, 15) = 120.
Can I factor a prime?
Yes – the ladder has a single row and the factorization is the prime itself.
How big can the numbers be?
Each number may have up to 12 digits. Numbers with two large prime factors take the longest; the app stops a search that would take too long and tells you.
Version history
- 2.01 Dec 2026Rebuilt: division ladder for several numbers at once, factorizations with powers, LCM and GCD with the working, coprime pairs, examples and copy.
- 1.028 Oct 2024Improvements and fixes
- 1.021 Oct 2024App added
Embed this app
Paste this code into your website, LMS (Moodle, Canvas…) or blog.
Feedback on Prime Factorization Calculator
Found a mistake or have an idea? We read every message and use it to improve the app.




