🔢 LCM & GCD Calculator

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

Try:
LCM (Least Common Multiple)
GCD / HCF

LCM & GCD Guide

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.

GCD(a,b): Euclidean algorithm — repeatedly divide and take remainder
LCM(a,b) = (a × b) ÷ GCD(a,b)

LCM & GCD Calculator – What They Are and When to Use Each

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 – How GCD Is Calculated

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).

Real-World Uses of LCM

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.

Real-World Uses of GCD

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.

Related Calculators

½
Fraction Calculator
Use LCM as the common denominator to add fractions
🧮
Scientific Calculator
Full-featured scientific calculations
%
Percentage Calculator
Percentage calculations for everyday use

Frequently Asked Questions

LCM stands for Least Common Multiple — the smallest positive number that is divisible by all the given numbers. For example, LCM(4, 6) = 12, because 12 is the smallest number that both 4 and 6 divide into evenly. LCM is used when adding fractions with different denominators and when finding when repeating events coincide.
GCD stands for Greatest Common Divisor (also called HCF — Highest Common Factor). It is the largest number that divides all the given numbers exactly with no remainder. For example, GCD(12, 18) = 6, because 6 is the largest number that divides both 12 and 18 evenly. GCD is used to simplify fractions.
For any two positive integers a and b: LCM(a, b) x GCD(a, b) = a x b. For example, LCM(4,6) = 12 and GCD(4,6) = 2, and 12 x 2 = 24 = 4 x 6. This relationship lets you calculate one from the other efficiently.
The Euclidean algorithm finds GCD by repeatedly dividing and taking remainders. GCD(48, 18): 48 = 18x2 + 12, then GCD(18,12): 18 = 12x1 + 6, then GCD(12,6): 12 = 6x2 + 0. When remainder is 0, the last divisor (6) is the GCD. This is one of the oldest known algorithms, described by Euclid around 300 BCE.
LCM is used when adding fractions with unlike denominators (find the LCD, which is the LCM of the denominators), scheduling repeating events (if event A repeats every 4 days and event B every 6 days, they coincide every LCM(4,6) = 12 days), and in music theory for finding when rhythmic patterns align.