LCM / GCD Calculator
Calculate Least Common Multiple and Greatest Common Divisor of integers.
Math
LCM / GCD Calculator
Generated on April 24, 2026
?What is the LCM / GCD Calculator?
This calculator finds both the Greatest Common Divisor (GCD, also called Highest Common Factor or HCF) and the Least Common Multiple (LCM) of any list of positive integers. GCD is the largest integer that divides every value in your list; LCM is the smallest positive integer that every value divides into. These are essential for simplifying fractions (GCD of numerator and denominator), adding or subtracting fractions (LCM of denominators), scheduling repeating events, and many number-theory problems in competitive mathematics and cryptography.
The Formula
Euclid's algorithm (published around 300 BC and still optimal for this problem) repeatedly replaces the pair (a, b) with (b, a mod b), shrinking the numbers rapidly. When b becomes 0, the remaining a is the GCD. The LCM follows from the beautiful identity LCM(a, b) × GCD(a, b) = a × b, which holds for all positive integers. For longer lists, just chain: GCD(a, b, c) = GCD(GCD(a, b), c). The same logic extends to LCM.
Practical Examples
12 and 18: GCD = 6, LCM = 36 — classic textbook example that also shows the identity 12 × 18 = 216 = 6 × 36.
8 and 12: GCD = 4, LCM = 24 — useful when simplifying 8/12 or finding a common denominator.
4, 6, and 10: GCD = 2, LCM = 60 — the minimum time at which three repeating events (every 4, 6, and 10 units) coincide.
Adding fractions: to add 1/4 + 1/6 + 1/10, the LCM of denominators (60) becomes the least common denominator.
Gear ratios: a gear with 24 teeth meshing with one of 36 teeth will return to the same relative position after LCM(24, 36) = 72 teeth of rotation.
Traffic lights: if three signals cycle every 30, 45, and 60 seconds, they synchronize every LCM(30, 45, 60) = 180 seconds (3 minutes).
Frequently Asked Questions
Explore More Tools
GPA Calculator
Calculate your Grade Point Average on the 4.0 scale from your courses.
Grade Calculator
Calculate your final grade from weighted categories like tests, homework, and exams.
Student Result Card Calculator
Subject-wise marks, grades, and a printable school result card — ideal for small schools and parents.