GCF Calculator (Greatest Common Factor) and LCM
Calculates the greatest common factor (GCD) and least common multiple (LCM) of several numbers. Free online.
Advertisement
Advertisement
How to find the GCF and LCM
The GCF calculator finds the greatest common factor (also called the greatest common divisor, GCD, or highest common factor, HCF) and the least common multiple (LCM) of two to ten whole numbers, and shows the prime factorization and the Euclidean algorithm steps so you can check the working. The GCF is the largest number that divides all your numbers exactly; the LCM is the smallest number that all of them divide into.
How to find the GCF
- Prime factorization: write each number as a product of primes (12 = 2² × 3, 18 = 2 × 3²), then multiply the primes they share, using the smallest power: 2 × 3 = 6.
- Euclidean algorithm: divide the larger number by the smaller and keep dividing by the remainder until it is zero. 18 = 1 × 12 + 6, 12 = 2 × 6 + 0, so the GCF is 6.
- Listing factors: list the factors of each number and pick the largest one they share. This works for small numbers.
How to find the LCM
Use the largest power of every prime that appears: 12 = 2² × 3 and 18 = 2 × 3² give LCM = 2² × 3² = 36. A shortcut for two numbers is LCM = (a × b) ÷ GCF: (12 × 18) ÷ 6 = 36.
Examples
| Numbers | GCF | LCM |
|---|---|---|
| 12 and 18 | 6 | 36 |
| 24 and 36 | 12 | 72 |
| 48 and 180 | 12 | 720 |
| 12, 18 and 24 | 6 | 72 |
| 17 and 31 (both prime) | 1 | 527 |
What the GCF is used for
- Simplifying fractions: divide the top and bottom by their GCF. 18/24 → 3/4 (GCF 6).
- Splitting things evenly: the GCF of 48 and 180 is 12, so you can make 12 identical groups.
- Scheduling: the LCM tells you when repeating events line up, such as buses every 12 and 18 minutes meeting again after 36 minutes.
Related: ratio calculator, fraction calculator and prime number checker.
How to use GCD and LCM Calculator
- Open GCD and LCM Calculator in RoviDev (you don't need to install anything or register).
- Enter the required data in the tool form.
- Press the button and see the result instantly on the screen.
GCF and LCM of common number pairs
Quick answers for pairs people look up most. The GCF (greatest common factor, also called GCD or HCF) is the largest number that divides both numbers; the LCM (least common multiple) is the smallest number both divide into.
| Numbers | GCF | LCM |
|---|---|---|
| 12 and 18 | 6 | 36 |
| 24 and 36 | 12 | 72 |
| 15 and 25 | 5 | 75 |
| 18 and 24 | 6 | 72 |
| 30 and 45 | 15 | 90 |
| 36 and 48 | 12 | 144 |
| 48 and 60 | 12 | 240 |
| 54 and 72 | 18 | 216 |
| 75 and 100 | 25 | 300 |
| 84 and 126 | 42 | 252 |
| 8 and 12 | 4 | 24 |
| 20 and 30 | 10 | 60 |
| 16 and 24 | 8 | 48 |
| 40 and 60 | 20 | 120 |
| 42 and 56 | 14 | 168 |
Three ways to find the GCF
- List the factors. Factors of 24: 1, 2, 3, 4, 6, 8, 12, 24. Factors of 36: 1, 2, 3, 4, 6, 9, 12, 18, 36. The largest one they share is 12, so GCF(24, 36) = 12.
- Prime factorization. 24 = 2³ × 3 and 36 = 2² × 3². Take each prime with its smallest exponent: 2² × 3 = 12.
- Euclidean algorithm (fastest for big numbers): divide, then replace the pair with the divisor and the remainder until the remainder is 0. For 48 and 18:
- 48 = 18 × 2 + 12
- 18 = 12 × 1 + 6
- 12 = 6 × 2 + 0
Where you use GCF and LCM
- Simplifying fractions: divide the top and bottom by their GCF. 18/24 becomes 3/4 because GCF(18, 24) = 6.
- Adding fractions: use the LCM of the denominators as the common denominator. For 1/6 + 1/8 the LCM of 6 and 8 is 24.
- Scheduling: if one event repeats every 4 days and another every 6 days, they coincide every LCM(4, 6) = 12 days.
The relationship GCF × LCM = a × b holds for any two numbers: for 12 and 18, 6 × 36 = 216 = 12 × 18. Use the calculator above for any numbers, including more than two. See also the fractions calculator and the prime number checker.
GCF and LCM FAQ
What is the difference between GCF, GCD and HCF?
They are the same thing: the largest number that divides all the given numbers without a remainder. GCF is common in the US, GCD in mathematics and HCF in the UK.
How do I find the GCF of two numbers?
Factor both into primes and multiply the shared primes, or use the Euclidean algorithm. The GCF of 12 and 18 is 6.
How do I find the LCM?
Use the highest power of each prime in the numbers, or LCM = (a × b) ÷ GCF. The LCM of 12 and 18 is 36.
What is the GCF of two prime numbers?
1, because the only common factor of two different primes is 1.
What is the GCF if one number divides the other?
The smaller number. The GCF of 6 and 18 is 6.
Can I use more than two numbers?
Yes. The calculator accepts up to ten numbers and finds their common GCF and LCM.
Related tools: Proportion calculator · Factor calculator · List of prime numbers