Everyday Math

GCD & LCM Calculator

Calculate the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) for up to 10 numbers, with step-by-step working shown.

What Is GCD (Greatest Common Divisor)?

The Greatest Common Divisor (GCD), also called the Highest Common Factor (HCF) or Greatest Common Factor (GCF), is the largest positive integer that divides two or more numbers without a remainder.

Example: GCD(12, 18) = 6, because 6 is the largest number that divides both 12 and 18 evenly.

What Is LCM (Least Common Multiple)?

The Least Common Multiple (LCM) is the smallest positive integer that is divisible by all the given numbers.

Example: LCM(4, 6) = 12, because 12 is the smallest number that both 4 and 6 divide into evenly.

How GCD and LCM Are Related

For two numbers a and b: GCD(a,b) × LCM(a,b) = a × b

This is a useful relationship — if you know the GCD, you can calculate the LCM without prime factorization: LCM = (a × b) ÷ GCD

The Euclidean Algorithm (for GCD)

The Euclidean algorithm is an efficient method for computing GCD: repeatedly divide the larger number by the smaller, replacing the larger with the remainder, until the remainder is zero. The last non-zero remainder is the GCD.

GCD(48, 18): 48 = 2×18 + 12 → 18 = 1×12 + 6 → 12 = 2×6 + 0 → GCD = 6

Real-World Applications

  • Simplifying fractions: Divide both numerator and denominator by their GCD. 18/24 → divide by GCD(18,24)=6 → 3/4
  • LCM for adding fractions: To add 1/4 + 1/6, find LCM(4,6)=12, convert to 3/12 + 2/12 = 5/12
  • Scheduling: Two events repeat every 4 and 6 days — they next coincide in LCM(4,6)=12 days
  • Gear ratios and tiling: Finding smallest common dimensions or patterns

Frequently Asked Questions

What is the GCD of 12, 18, and 24?
GCD(12, 18, 24) = 6. The prime factorizations are 12=2²×3, 18=2×3², 24=2³×3. The GCD takes the lowest power of each common prime: 2¹×3¹ = 6.
What is the difference between GCD and LCM?
GCD is the largest number that divides all the given numbers. LCM is the smallest number that all the given numbers divide into. GCD(4,6)=2, LCM(4,6)=12. For two numbers a and b: GCD × LCM = a × b.
How do I use GCD to simplify a fraction?
Divide both the numerator and denominator by their GCD. To simplify 36/48: GCD(36,48) = 12. So 36÷12 = 3 and 48÷12 = 4, giving the simplified fraction 3/4.
Why is LCM used when adding fractions?
To add fractions with different denominators, you need a common denominator. The LCM of the denominators is the Least Common Denominator (LCD) — using it minimises the size of the numbers you work with. For 1/4 + 1/6, LCD = LCM(4,6) = 12, giving 3/12 + 2/12 = 5/12.
What is the GCD of any number and 1?
GCD(n, 1) = 1 for any positive integer n. This is because 1 divides every integer, and the only number that divides 1 is 1 itself.