GCD/LCM Calculator
Find the Greatest Common Divisor and Least Common Multiple of two or more numbers. Used in fraction simplification and number theory.
Enter your values above to see the results.
Tips & Notes
- ✓GCD×LCM = a×b always. Use to find LCM once you have GCD: LCM = (a×b)/GCD.
- ✓GCD(a,1)=1 always. GCD(a,a)=a always. Quick sanity checks.
- ✓For fractions: simplify with GCD. Add fractions with LCM as common denominator.
- ✓Three numbers: GCD(a,b,c) = GCD(GCD(a,b), c). Apply pairwise.
- ✓If smaller divides larger evenly, GCD = smaller: GCD(6,18)=6 since 18÷6=3 exactly.
Common Mistakes
- ✗Confusing GCD with LCM. GCD ≤ min(a,b). LCM ≥ max(a,b). They go in opposite directions.
- ✗Stopping Euclidean algorithm early. GCD(48,18): first remainder is 12, not the final answer.
- ✗Taking minimum exponents of ALL primes in factorization. GCD uses only SHARED primes.
- ✗LCM formula: (a×b)/GCD. Not (a+b)/GCD or a×b×GCD.
- ✗GCD of three numbers: must apply GCD pairwise — not just to any two.
GCD/LCM Calculator Overview
The Greatest Common Divisor (GCD) and Least Common Multiple (LCM) are two fundamental number theory operations that reveal how integers relate through divisibility. The GCD finds the largest number that divides both inputs evenly — the deepest common factor. The LCM finds the smallest number divisible by both inputs — the earliest common multiple. Together they govern fraction arithmetic, ratio reduction, scheduling synchronization, and the structure of modular arithmetic. Their elegant relationship — GCD × LCM = a × b — means knowing one instantly gives you the other.
GCD using the Euclidean Algorithm — the most efficient method:
GCD(a, b) = GCD(b, a mod b) — repeat until remainder = 0
EX: GCD(48, 18) → 48 mod 18=12 → GCD(18,12) → 18 mod 12=6 → GCD(12,6) → 0 → GCD=6
EX: GCD(270, 192) → 270 mod 192=78 → GCD(192,78) → 192 mod 78=36 → GCD(78,36) → 78 mod 36=6 → GCD(36,6) → 0 → GCD=6LCM from GCD — the fastest route once GCD is known:
LCM(a, b) = (a × b) / GCD(a, b)
EX: LCM(48, 18) = (48×18)/6 = 864/6 = 144 | verify: 144÷48=3✓, 144÷18=8✓Verification identity: GCD(a,b) × LCM(a,b) = a × b always — use this to check your work:
EX: GCD(48,18)=6, LCM=144 → 6×144=864=48×18 ✓Prime factorization method: - GCD: take minimum exponent of each shared prime - LCM: take maximum exponent of every prime
EX: 48=2⁴×3, 18=2×3² → GCD=2¹×3¹=6 | LCM=2⁴×3²=144The GCD and LCM are complementary — they always satisfy the identity GCD(a,b) × LCM(a,b) = a × b. This relationship lets you compute one from the other: if you know the GCD, the LCM is a×b÷GCD, which is faster than computing the LCM directly. For three or more numbers, apply the algorithm iteratively: GCD(a,b,c) = GCD(GCD(a,b), c). The Euclidean algorithm is one of the oldest and most efficient algorithms in mathematics — it reduces any GCD problem to a sequence of simple remainders that converges in at most 5× the number of digits of the smaller input. The GCD has a geometric interpretation that makes fraction problems intuitive: the largest square tile that fits exactly into a p × q rectangle without any cuts has a side length of GCD(p, q).