Free LCM and GCD calculator. Find the Least Common Multiple and Greatest Common Divisor of up to 10
Enter up to 10 numbers separated by commas or spaces
The Greatest Common Divisor (GCD), also called HCF (Highest Common Factor), is the largest number that divides all given numbers exactly. The Least Common Multiple (LCM) is the smallest number that all given numbers divide into exactly.
The Greatest Common Divisor (GCD), also called the Highest Common Factor (HCF), is the largest number that divides all given numbers exactly. The Least Common Multiple (LCM) is the smallest number that all given numbers divide into exactly. These two values are mathematically related: LCM(a,b) × GCD(a,b) = a × b.
The Euclidean algorithm is one of the oldest known algorithms, described by Euclid around 300 BCE. It finds GCD by repeatedly dividing and taking remainders until the remainder is zero. Example: GCD(48, 18) → 48 = 18×2 + 12 → GCD(18, 12) → 18 = 12×1 + 6 → GCD(12, 6) → 12 = 6×2 + 0. The last non-zero remainder is the GCD = 6. This calculator shows each step of the process. The LCM is then calculated using LCM(a,b) = (a × b) ÷ GCD(a,b).
LCM is the key to adding fractions with unlike denominators — the LCD (Lowest Common Denominator) is simply the LCM of the denominators. Our fraction calculator uses the LCM internally for addition and subtraction. LCM also solves scheduling problems: if Bus A runs every 15 minutes and Bus B every 20 minutes, they coincide every LCM(15,20) = 60 minutes. In music, LCM finds when two rhythmic patterns with different lengths align.
GCD is essential for simplifying fractions — divide numerator and denominator by their GCD to reduce to lowest terms. Example: 36/48 → GCD(36,48) = 12 → 36/12 = 3, 48/12 = 4 → simplified = 3/4. GCD is also used for equal distribution problems: how many equal groups can 36 apples and 48 oranges be divided into without splitting? GCD(36,48) = 12 groups with 3 apples and 4 oranges each. In cryptography, GCD is fundamental to RSA encryption key generation.