GCD & LCM Calculator
Calculate the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of two numbers using the Euclidean algorithm.
GCD (Greatest Common Divisor)
—
LCM (Least Common Multiple) —
GCD Steps —
How to Use This Calculator
Enter two positive integers. The calculator finds their GCD using the Euclidean algorithm and their LCM from the formula LCM = |a×b| / GCD.
Formula
Euclidean GCD: repeatedly apply (a,b) → (b, a mod b) until b=0 • LCM = |a×b| / GCD
Example
GCD(48,18): 48=2×18+12 → 18=1×12+6 → 12=2×6+0 → GCD=6, LCM=144
Frequently Asked Questions
- The Greatest Common Divisor is the largest integer that divides both numbers without a remainder. GCD(48,18)=6.
- The Least Common Multiple is the smallest positive integer divisible by both numbers. LCM(4,6)=12.
- An efficient method to find GCD: repeatedly replace (a,b) with (b, a mod b) until b=0. The remaining a is the GCD.
- LCM(a,b) = |a×b| / GCD(a,b). Knowing one lets you find the other instantly.
- Simplifying fractions (divide numerator and denominator by GCD), finding common denominators, and solving number theory problems.