LCD and GCD Calculator
Find the least common denominator and greatest common divisor of two or more whole numbers.
Written by Golam Rabbani, Founder & Lead Engineer
How to use this lcd and gcd calculator
- Type two or more whole numbers into the input field, separated by commas or spaces — for example: 12, 18, 24.
- Press Calculate to instantly see the Greatest Common Divisor (GCD) and the Least Common Multiple / Lowest Common Denominator (LCM / LCD) for your set of numbers.
- Review the step-by-step working shown below each result to understand how the values were reached.
- Click Copy to save the results to your clipboard, or Reset to clear the field and start a new calculation.
About this lcd and gcd calculator
The GCD (Greatest Common Divisor) of a set of integers is the largest positive integer that divides every number in the set without leaving a remainder. For example, GCD(12, 18) = 6 because 6 is the largest number that divides both 12 and 18 evenly. This calculator finds the GCD by taking each pair of numbers in turn and applying the modulo (remainder) operation until one value reaches zero; the last non-zero value is the GCD. It then folds that pairwise result left to right across the whole list, so GCD(a, b, c) becomes GCD(GCD(a, b), c).
The LCM (Least Common Multiple) is the smallest positive integer that is a multiple of every number in the set. It is also called the LCD (Lowest Common Denominator) when the numbers represent the denominators of fractions, because converting each fraction to this denominator lets you add or subtract them directly without distortion. The key relationship connecting the two operations is: LCM(a, b) = |a x b| / GCD(a, b). This formula avoids searching through all multiples and makes computation fast even for large numbers.
Worked example: for the set {4, 6, 12}, GCD(4, 6) = 2, then GCD(2, 12) = 2, so GCD = 2. For the LCM: LCM(4, 6) = 24 / 2 = 12, then LCM(12, 12) = 144 / 12 = 12, so LCM / LCD = 12. If you were adding the fractions 1/4, 1/6, and 1/12, you would rewrite them all over 12 before combining numerators.
FAQ
- What is the least common denominator (LCD)?
- The least common denominator is the smallest whole number that can serve as a common denominator for a group of fractions. It equals the least common multiple (LCM) of the individual denominators. For example, if you want to add 1/4 and 1/6, the LCD is LCM(4, 6) = 12, so you rewrite the fractions as 3/12 and 2/12 before adding them to get 5/12.
- What is the greatest common divisor (GCD)?
- The GCD (also called the greatest common factor, or GCF) is the largest integer that divides all numbers in a set without leaving a remainder. GCD(12, 18) = 6, for example, because 6 goes into both 12 and 18 exactly. It is useful for simplifying fractions: dividing numerator and denominator by their GCD always produces the fraction in its lowest terms.
- How do you find the LCD of several numbers?
- Find the LCM of all the numbers by chaining the pairwise formula LCM(a, b) = |a x b| / GCD(a, b) from left to right across the list. For three numbers a, b, c: compute LCM(a, b) first, then take LCM of that result with c. This calculator performs all those steps automatically and shows each intermediate result.
- What is the relationship between GCD and LCM?
- For any two positive integers a and b, GCD(a, b) x LCM(a, b) = a x b. Rearranging gives LCM(a, b) = (a x b) / GCD(a, b). This identity means you only need to compute the GCD once and can derive the LCM from it, which is exactly what this calculator does internally.
- Can I enter more than two numbers?
- Yes. Type as many whole numbers as you need, separated by commas or spaces. The calculator chains the GCD and LCM operations left to right across the entire list and shows every intermediate step so you can follow the working.
- Is the calculator free and private?
- Yes. Even long lists of numbers are factored entirely on your device, so there are no server round-trips, no account, and no cost. Your inputs never leave the browser tab.