๐Ÿ”ข LCM & GCD Calculator

Calculate the Least Common Multiple and Greatest Common Divisor.

Calculate Now

What is LCM & GCD Calculator?

Two whole numbers relate to each other in two useful ways: the largest number that divides evenly into both of them (their Greatest Common Divisor) and the smallest number that both of them divide evenly into (their Least Common Multiple). These solve different everyday problems โ€” GCD helps simplify fractions, while LCM helps find common denominators or figure out when two repeating events line up. This calculator computes both at once for any pair of numbers you enter.

Euclidean Algorithm & LCM Formula

GCD is computed using the Euclidean algorithm, which repeatedly replaces the larger number with the remainder of dividing it by the smaller number until the remainder is zero. Once GCD is known, LCM follows directly from it:

LCM(a, b) = (a ร— b) รท GCD(a, b)

Worked Example

Find the GCD and LCM of 18 and 24.

Using the Euclidean algorithm: 24 รท 18 leaves remainder 6; then 18 รท 6 leaves remainder 0 โ€” so GCD(18, 24) = 6.

LCM = (18 ร— 24) รท 6 = 432 รท 6 = 72

So the GCD is 6 and the LCM is 72.

How to Use This Calculator

  1. Enter the first number in the First Number field.
  2. Enter the second number in the Second Number field.
  3. Click Calculate to see both the GCD and LCM.
๐Ÿ’ก Tip: LCM is handy for scheduling problems โ€” for instance, if one event repeats every 18 days and another repeats every 24 days, they will next coincide on day 72 (their LCM), which is exactly the kind of question this calculator answers instantly.

Why the Euclidean Algorithm Works

The Euclidean algorithm relies on a simple fact: the greatest common divisor of two numbers also divides their difference (and therefore their remainder after division). By repeatedly replacing the larger number with the remainder from dividing it by the smaller one, the pair of numbers shrinks quickly while their GCD stays the same, until eventually the remainder hits zero and the last non-zero remainder is the answer. This makes it far faster than listing out every factor of both numbers, especially once the numbers get large.

GCD is also the key step in reducing a fraction to its lowest terms, which is essentially the same math used in our Ratio Calculator.

📅 Last reviewed: July 2026 · Formulas verified against RBI/SEBI/IT Dept guidelines.