GCD & LCM Calculator
Enter 2 to 10 whole numbers to find their greatest common divisor (GCD, also known as GCF) and least common multiple (LCM). For two numbers, the Euclidean algorithm steps are shown.
What are the GCD and LCM?
- The greatest common divisor (GCD), also called the greatest common factor (GCF) or highest common factor (HCF), is the largest whole number that divides every number in the list. The GCD of 12 and 18 is 6.
- The least common multiple (LCM) is the smallest positive whole number that every number in the list divides. The LCM of 12 and 18 is 36.
For two numbers, GCD × LCM = the product of the two numbers (6 × 36 = 12 × 18). For more numbers, the calculator combines them one pair at a time.
The Euclidean algorithm
To find the GCD of two numbers, divide the larger by the smaller and keep the remainder. Repeat with the smaller number and the remainder until the remainder is 0. The last divisor is the GCD.
For 48 and 18: 48 ÷ 18 = 2 remainder 12; 18 ÷ 12 = 1 remainder 6; 12 ÷ 6 = 2 remainder 0. The GCD is 6.
Examples
- 12 and 18: GCD 6, LCM 36
- 8, 12 and 20: GCD 4, LCM 120
- 7 and 13: GCD 1, so the numbers are coprime (relatively prime); LCM 91
Frequently asked questions
How do I simplify a fraction with the GCD?
Divide the numerator and the denominator by their GCD. For 18/24 the GCD is 6, so 18/24 = 3/4.
How do I find a common denominator?
The least common multiple of the denominators is the least common denominator. For 1/4 and 1/6 the LCM of 4 and 6 is 12, so the common denominator is 12.
Is GCD the same as GCF?
Yes. GCD (greatest common divisor), GCF (greatest common factor) and HCF (highest common factor) are different names for the same number.