How to Find the GCF and LCM (With Examples)
The GCF is the largest number that divides every number in the list, and the LCM is the smallest number they all divide into. For 48 and 18: GCF = 6 and LCM = 144. They are linked by GCF × LCM = a × b.
Finding the GCF with prime factors
48 = 2⁴ × 3 and 18 = 2 × 3². Multiply the primes they share, using the lowest power: 2 × 3 = 6.
Finding the GCF with Euclid's algorithm
48 = 2 × 18 + 12 18 = 1 × 12 + 6 12 = 2 × 6 + 0The last non-zero remainder, 6, is the GCF. This is fast even for very large numbers.
Finding the LCM
Take the highest power of each prime: 2⁴ × 3² = 144. For two numbers you can also use LCM = (a × b) ÷ GCF = 864 ÷ 6 = 144.
How to use them
- Simplify a fraction by dividing by the GCF. 48/18 = 8/3.
- Add fractions using the LCM of the denominators as a common denominator.
- Find when repeating events line up, such as buses every 12 and 18 minutes (every 36 minutes).
The GCF and LCM calculator handles up to 12 numbers, and the fraction calculator simplifies for you.
A bigger worked example
Find the GCF and LCM of 84 and 126. The prime factors are 84 = 2² × 3 × 7 and 126 = 2 × 3² × 7. The GCF takes the lowest powers: 2 × 3 × 7 = 42. The LCM takes the highest powers: 2² × 3² × 7 = 252. Check: 42 × 252 = 10,584, which equals 84 × 126 = 10,584.
Simplifying a fraction with the GCF
To simplify 84/126, divide both by the GCF 42: 84 ÷ 42 = 2 and 126 ÷ 42 = 3, so 84/126 = 2/3.
Adding fractions with the LCM
To add 5/12 + 7/18, the LCM of 12 and 18 is 36. Rewrite as 15/36 + 14/36 = 29/36.
Word problems
- GCF problems ask for the largest equal groups or the biggest tile that fits. For example, cutting 84 cm and 126 cm lengths into equal pieces with no waste: the longest piece is 42 cm.
- LCM problems ask when things line up again, such as two lights flashing every 12 and 18 seconds, which coincide every 36 seconds.
Checking your work
If the GCF is 1, the numbers are coprime and the LCM equals their product. Test any pair with the GCF and LCM calculator.
Key terms
- Factor: A number that divides another exactly.
- Multiple: The product of a number and a whole number.
- GCF: The greatest common factor of two or more numbers.
- LCM: The least common multiple.
- Coprime: Numbers whose GCF is 1.
Practice questions
Try each one before you read the answer.
- GCF and LCM of 36 and 60.
Answer: GCF 12, LCM 180. - GCF and LCM of 17 and 25.
Answer: GCF 1, LCM 425 (they are coprime). - LCM of 4, 6 and 10.
Answer: 60.
Frequently asked questions
Are GCF, HCF and GCD the same?
Yes. They are different names for the greatest common factor.
How do I find the LCM of three numbers?
Find the LCM of the first two, then the LCM of that result and the third. Or take the highest prime powers across all three.
What does it mean if the GCF is 1?
The numbers are coprime: they share no factor other than 1.
What is the GCF of two prime numbers?
It is 1, because two different primes share no common factor except 1.
Can the LCM be smaller than the numbers?
No. The LCM is always at least as large as the largest number.