GCF and LCM Calculator
Find the greatest common factor and least common multiple of two or more numbers, with the calculation steps shown.
How GCF and LCM are calculated
LCM(a, b) = (a × b) ÷ GCF(a, b)
For more than two numbers, apply both formulas pairwise across the whole list
The Euclidean algorithm finds the GCF of two numbers efficiently without listing every factor: divide the larger by the smaller, take the remainder, and repeat with the smaller number and that remainder until the remainder hits zero — the last non-zero remainder is the GCF. Once you have the GCF, the LCM follows directly from a simple formula, since the two are mathematically linked.
GCF(12, 18) = 6. GCF(6, 30) = 6. So GCF(12, 18, 30) = 6.
LCM(12, 18) = (12 × 18) ÷ 6 = 36. LCM(36, 30) = (36 × 30) ÷ 6 = 180. So LCM(12, 18, 30) = 180.
Scheduling (LCM): Bus Route A repeats every 8 days; Bus Route B repeats every 12 days. Both ran today. GCF(8, 12) = 4, so LCM(8, 12) = (8 × 12) ÷ 4 = 96 ÷ 4 = 24. Both routes will next run on the same day again in 24 days.
Grouping (GCF): A caterer has 24 apples and 36 oranges and wants the largest possible number of identical fruit baskets with no fruit left over. GCF(24, 36) = 12, so the caterer can make 12 baskets, each with 24 ÷ 12 = 2 apples and 36 ÷ 12 = 3 oranges.
Where GCF and LCM show up in practice
GCF is what you use to simplify a fraction to its lowest terms — divide the numerator and denominator by their GCF. LCM is what you use to find a common denominator when adding or comparing fractions with different denominators. Both also come up in scheduling problems (like figuring out when two repeating events next coincide) and in dividing items into equal groups.
GCF and LCM of common number pairs
| Numbers | GCF | LCM |
|---|---|---|
| 4, 6 | 2 | 12 |
| 6, 9 | 3 | 18 |
| 8, 12 | 4 | 24 |
| 12, 18 | 6 | 36 |
| 24, 36 | 12 | 72 |
Common mistakes when finding GCF and LCM
- Confusing GCF and LCM. GCF is always less than or equal to the smallest input number; LCM is always greater than or equal to the largest.
- Listing every factor manually for large numbers. The Euclidean algorithm is much faster and less error-prone than factoring large numbers by hand.
- Applying the two-number LCM formula directly to three or more numbers. You need to chain the calculation pairwise across the whole list, not just multiply everything and divide by one GCF.
Frequently asked questions
What is the greatest common factor (GCF)?
The largest number that divides evenly into every number in a set — the GCF of 12 and 18 is 6.
What is the least common multiple (LCM)?
The smallest number that every number in a set divides into evenly — the LCM of 4 and 6 is 12.
How is GCF used to simplify fractions?
Divide the numerator and denominator by their GCF — 18/24 simplifies to 3/4 by dividing both by 6.
How is LCM used to add fractions?
The LCM of the denominators becomes the common denominator before adding.
How is LCM used for scheduling repeating events?
The LCM of the two intervals gives the days until both coincide again. Routes every 8 and 12 days next align in LCM(8,12) = 24 days.
How is GCF used to divide items into equal groups?
The GCF gives the largest number of identical groups possible. 24 apples and 36 oranges make GCF(24,36) = 12 baskets of 2 apples and 3 oranges each.
Related calculators
Note: Works with positive whole numbers. Last reviewed: September 2026.