Toolalize

GCD and LCM Calculator

Find the greatest common divisor (GCD, also called HCF) and the least common multiple (LCM) of two or more whole numbers.

Separate the numbers with commas or spaces, e.g. 12, 18, 24

Greatest common divisor (GCD)

6

Least common multiple (LCM)

72

Euclidean algorithm (first two numbers)

  1. 18 = 1 × 12 + 6
  2. 12 = 2 × 6 + 0

Frequently Asked Questions

The greatest common divisor (GCD), also called the highest common factor (HCF), is the largest whole number that divides every number in the list without a remainder. The GCD of 12 and 18 is 6.
The least common multiple (LCM) is the smallest positive number that is a multiple of every number in the list. The LCM of 4, 6 and 8 is 24. It gives the lowest common denominator when you add fractions.
Divide the larger number by the smaller one and keep the remainder. Then divide the previous divisor by that remainder, and repeat until the remainder is 0. The last non-zero remainder is the GCD: 48 = 2 × 18 + 12, 18 = 1 × 12 + 6, 12 = 2 × 6 + 0, so the GCD of 48 and 18 is 6.
For two positive numbers a and b, GCD × LCM = a × b. So once you know the GCD, the LCM is a × b ÷ GCD: for 12 and 18, the LCM is 216 ÷ 6 = 36.
Yes. The calculator works with whole numbers of any size, so the LCM never overflows, and it ignores signs: the GCD and LCM are always positive. If one of the numbers is 0, the LCM is 0.