Back to Homepage

LCM & GCD Calculator

Find Least Common Multiple (LCM) and Greatest Common Divisor (GCD).

Enter Two Numbers

Calculate divisors and multiples

Comprehensive Calculator Guide

The LCM & GCD Calculator finds the Least Common Multiple and Greatest Common Divisor (also called Highest Common Factor, HCF) of two or more numbers instantly — with step-by-step working shown. Essential for simplifying fractions, adding fractions with unlike denominators, and solving problems in number theory.

GCD and LCM: What They Mean and How They Are Found

The Greatest Common Divisor (GCD) of two numbers is the largest integer that divides both without a remainder. For 48 and 36: the divisors of 48 are 1,2,3,4,6,8,12,16,24,48 and divisors of 36 are 1,2,3,4,6,9,12,18,36 — the largest shared divisor is 12. The efficient way to find GCD is the Euclidean algorithm: divide the larger number by the smaller, replace the larger with the smaller and the smaller with the remainder, and repeat until the remainder is 0. The last non-zero remainder is the GCD.

The Least Common Multiple (LCM) is the smallest positive integer divisible by both numbers. Efficient calculation uses the relationship: LCM(a,b) = (a × b) ÷ GCD(a,b). For 48 and 36: (48×36)÷12 = 1728÷12 = 144. LCM can also be found by prime factorization — take each prime factor to its highest power appearing in either number.

Where GCD and LCM Appear in Real Math Problems

Simplifying fractions: to reduce 48/36 to lowest terms, divide both numerator and denominator by GCD(48,36)=12 → 4/3. This is the most common real-world use of GCD. Adding unlike fractions: to add 1/12 + 1/18, find LCM(12,18)=36 as the common denominator → 3/36 + 2/36 = 5/36. Without LCM, you would need to find the common denominator by trial and error.

Scheduling and cycles: LCM solves repeating schedule problems. Two events occur every 12 and 18 days respectively — when do they first coincide again? LCM(12,18)=36 days. Tiling and arrangements: how many square tiles (as large as possible) can exactly cover a 48×36 cm floor without cutting? The tile side is GCD(48,36)=12 cm. These practical applications appear in construction, logistics, and computer science (synchronizing processes, memory alignment).

How to Use

  1. 01Enter the first number
  2. 02Enter the second number (add more numbers if supported)
  3. 03Click Calculate
  4. 04View both GCD and LCM with step-by-step explanation

Formula Used

GCD: Euclidean algorithm — GCD(a,b) = GCD(b, a mod b) until remainder = 0. LCM: LCM(a,b) = (a × b) ÷ GCD(a,b)

Practical Examples

Example 1: GCD and LCM of 12 and 18

GCD: 18=12×1+6; 12=6×2+0 → GCD=6. LCM=(12×18)÷6=36. Use: 10/12+5/18 = 15/36+10/36 = 25/36

Example 2: Simplifying a fraction — 84/112

GCD(84,112): 112=84×1+28; 84=28×3+0 → GCD=28. Simplified: 84/112 = 3/4

Example 3: Scheduling — events every 8 and 14 days

LCM(8,14)=(8×14)÷GCD(8,14). GCD(14,8): 14=8×1+6; 8=6×1+2; 6=2×3+0 → GCD=2. LCM=112÷2=56 days until both events coincide.

Important Tips

  • For large numbers, the Euclidean algorithm is far faster than listing all factors — the calculator uses it automatically.
  • GCD of any number and 1 is always 1; LCM of any number and 1 is always the number itself.
  • Two numbers whose GCD = 1 are called coprime (or relatively prime) — their LCM equals their product.

Common Mistakes to Avoid

  • Confusing GCD and LCM: GCD (for simplifying, dividing) is ≤ the smaller number; LCM (for finding common denominators) is ≥ the larger number.
  • Assuming LCM is always the product of the two numbers — LCM = product only when the two numbers are coprime (GCD = 1).

Frequently Asked Questions

What is the difference between GCD and HCF?
They are the same thing. GCD (Greatest Common Divisor) and HCF (Highest Common Factor) are two names for the same concept — the largest integer that divides all given numbers without a remainder.
Can GCD and LCM be found for more than two numbers?
Yes. GCD(a,b,c) = GCD(GCD(a,b), c). LCM(a,b,c) = LCM(LCM(a,b), c). Apply the two-number formula repeatedly.
What is the GCD of any number and 0?
By convention, GCD(n,0) = n for any positive integer n. This is consistent with the Euclidean algorithm: GCD(n,0) terminates immediately with n.
Why is LCM useful when adding fractions?
To add fractions, you need a common denominator — a number divisible by both denominators. The LCM is the smallest such number, which keeps the resulting fraction in the most manageable form before simplification.
How is GCD used in cryptography?
RSA encryption relies on the difficulty of factoring large numbers. Key generation requires finding two large primes p and q and computing GCD checks. The Euclidean algorithm's efficiency is essential to making RSA key generation fast.
What if two numbers share no common factors?
If two numbers are coprime (GCD = 1), their LCM equals their product. For example, GCD(8,9)=1, so LCM(8,9)=72. This means to add 1/8 + 1/9, the common denominator is 72.

Read Also

Written and reviewed by the Haseebat team

Results are estimates for educational purposes and may vary depending on your situation and data sources.