GCF and LCM Calculator
Enter 2 to 8 whole numbers. Get the GCF and LCM from their prime factors.
How it works
Break each number into primes. The GCF takes each prime the fewest times it appears in all of them, and the LCM takes it the most times it appears in any. The LCM is the common denominator you want when adding fractions.
Example
Find the GCF and LCM of 48 and 180.
GCF 12 · LCM 720
Steps
- 48 = 24 × 3
- 180 = 22 × 32 × 5
- GCF: take each prime the lowest number of times it appears in all of them: 22 × 3 = 12.
- LCM: take each prime the most times it appears in any of them: 24 × 32 × 5 = 720.
More examples
Find the GCF and LCM of 12, 18 and 30.
GCF 6 · LCM 180
Steps
- 12 = 22 × 3
- 18 = 2 × 32
- 30 = 2 × 3 × 5
- GCF: take each prime the lowest number of times it appears in all of them: 2 × 3 = 6.
- LCM: take each prime the most times it appears in any of them: 22 × 32 × 5 = 180.
Find the GCF and LCM of 17 and 20.
GCF 1 · LCM 340
Steps
- 17 = 17
- 20 = 22 × 5
- GCF: take each prime the lowest number of times it appears in all of them: 1.
- LCM: take each prime the most times it appears in any of them: 22 × 5 × 17 = 340.
Common mistake
A prime has to be in every number to count toward the GCF. The LCM needs every prime from any number.
Questions
Where is the LCM used?
Adding fractions, where it is the least common denominator, and timing problems: buses that leave every 12 and 18 minutes leave together again after 36.
Where is the GCF used?
Simplifying fractions and factoring. 48/180 divided top and bottom by 12 is 4/15.
What if the GCF is 1?
The numbers share no prime factor, and their LCM is their product.