Free math tool
Prime Factorization, GCF & LCM Calculator
Find the prime factorization of any whole number up to a trillion, shown as a division ladder with exponents, whether it's prime, and all of its factors. Or enter up to six numbers for their greatest common factor (GCF) and least common multiple (LCM), worked out from the prime factors step by step - with Euclid's algorithm as a check. Free, no signup.
2 to 1,000,000,000,000
Prime factorization
Prime or composite?
Number of factors
Division ladder
| 360 | |
| 2 | 180 |
| 2 | 90 |
| 2 | 45 |
| 3 | 15 |
| 3 | 5 |
| 5 | 1 |
Divide by the smallest prime that goes in exactly, again and again, until you reach 1. The primes on the left are the prime factors.
All 24 factors
How to find a prime factorization
Divide by the smallest prime that goes in exactly (2, then 3, 5, 7, 11, ...) and repeat with the result until you reach 1. Then collect the primes you divided by:
You only need to try primes up to the square root of the number: if nothing up to divides n, then n is prime.
Counting factors from the prime factorization
Add one to each exponent and multiply. For that is factors - each factor picks how many 2s (0 to 3), 3s (0 to 2) and 5s (0 or 1) it uses.
GCF and LCM side by side
For 12, 18 and 30:
The GCF takes the smallest power of the shared primes; the LCM takes the largest power of every prime.
Frequently asked questions
What is prime factorization?+
Writing a whole number as a product of prime numbers. Every whole number greater than 1 has exactly one prime factorization (apart from the order of the factors) - this is the Fundamental Theorem of Arithmetic. For example .
How do you find the GCF of two numbers?+
Write both numbers as products of primes, then multiply the primes they share, each to the smallest power it has. and share one 2 and one 3, so the GCF is . Euclid's algorithm is a fast alternative: keep dividing and taking remainders until the remainder is 0.
How do you find the LCM?+
Multiply every prime that appears in any of the numbers, each to the largest power it has. For 12 and 18 that is . For two numbers you can also use : .
Is 1 a prime number?+
No. A prime has exactly two different factors, 1 and itself; 1 has only one factor. Leaving 1 out is also what makes every number's prime factorization unique.
Where are GCF and LCM used?+
The GCF simplifies fractions ( divides by the GCF 6 to give ) and splits things into equal groups. The LCM gives the least common denominator for adding fractions and answers “when will these line up again?” problems, like two buses that leave every 12 and 18 minutes meeting again after 36 minutes.
Building number sense?
Factors, multiples and primes sit under fractions, algebra and more. A math tutor can make them solid one-on-one - your first trial lesson is free.
Strong number sense, strong math
A 1-on-1 math tutor builds the foundations that make every later topic easier - your first trial lesson is free.