GCF and LCM Calculator
By using our calculators, you agree to our Terms of Use.
Greatest common factor and least common multiple of two whole numbers, using the Euclidean algorithm.
Two numbers
Greatest common factor
6
Least common multiple: 36
- Least common multiple (LCM)
- 36
Related calculators
GCF and LCM
The greatest common factor (GCF), also called the greatest common divisor (GCD), is the largest whole number that divides both numbers evenly. This calculator finds it with the Euclidean algorithm: repeatedly divide and keep the remainder until it reaches zero.
The least common multiple (LCM) is the smallest number that both inputs divide into evenly. It relates directly to the GCF: LCM(a, b) = (a × b) ÷ GCF(a, b). LCM is especially useful for finding a common denominator when adding fractions.
Example: for 12 and 18, the GCF is 6 (the largest number that divides both) and the LCM is 36 (12 × 18 ÷ 6). That means 12/18 simplifies to 2/3, and 36 is the smallest number both 12 and 18 divide into evenly.
Common questions
What is the GCF used for?
The GCF simplifies fractions and ratios to their lowest terms, and is a building block for factoring expressions in algebra.
What is the LCM used for?
The LCM finds a common denominator for adding or comparing fractions, and helps schedule events that repeat on different cycles (e.g., "every 4 days" and "every 6 days").