LCM & GCD Calculator
Find the Least Common Multiple and Greatest Common Divisor with step-by-step solution.
Frequently Asked Questions
What is the GCD (Greatest Common Divisor)?
The GCD (also called HCF — Highest Common Factor, or GCF — Greatest Common Factor) is the largest positive integer that divides all given numbers without a remainder. GCD(12, 18) = 6 because 6 is the largest number that divides both. The Euclidean algorithm is the efficient way to compute it: GCD(18, 12) = GCD(12, 6) = GCD(6, 0) = 6.
What is the LCM (Least Common Multiple)?
The LCM is the smallest positive integer divisible by all the given numbers. LCM(4, 6) = 12 because 12 is the smallest number both 4 and 6 divide into evenly. Relationship with GCD: LCM(a, b) = (a × b) ÷ GCD(a, b). Used in adding/subtracting fractions with different denominators.
What does it mean for two numbers to be coprime?
Two numbers are coprime (relatively prime) if their GCD = 1 — they share no common factors other than 1. Example: 8 and 15 are coprime (8 = 2³; 15 = 3 × 5; no shared prime factors). Coprimality is important in cryptography (RSA key generation), modular arithmetic, and fraction simplification.
How is LCM used in real life?
LCM finds the smallest time when two recurring events synchronise. If bus A comes every 12 minutes and bus B every 8 minutes, LCM(12, 8) = 24 — they'll both be at the stop together every 24 minutes. Also used in music (finding common rhythm cycles) and computing (memory alignment).