Skip to content
LoveToCalc

Identity — what does that mean?

The product of the GCD and the LCM

Multiply the greatest common divisor of two numbers by their least common multiple and you get the two numbers multiplied together.

In Swedish: SGD gånger MGM

gcd(a, b) lcm(a, b)=ab

a
First number
b
Second number
Show why the formula is true
  1. Least common multiple: lcm(a, b)=abgcd(a, b).

    gcd(a, b) lcm(a, b)=gcd(a, b)·abgcd(a, b)

  2. Ordinary algebra: no rule about sine, cosine or tangent is used in this step.

    gcd(a, b)·abgcd(a, b)=ab

Practice questions

Work out

gcd(27, 18) lcm(27, 18)

Why it holds

Write both numbers as products of primes. The greatest common divisor takes each prime to the lower of its two powers and the least common multiple to the higher, and the lower plus the higher is the two powers added. So gcd times lcm has every prime to the power it has in a · b. With 84 = 2² · 3 · 7 and 36 = 2² · 3²: gcd = 12, lcm = 252, and 12 · 252 = 3 024 = 84 · 36.

Using it

Once the gcd is known, the lcm needs no factorising: lcm(a, b) = a · b / gcd(a, b). Euclid’s algorithm gives the gcd in a few lines even for large numbers, and this is then the quickest way to the common denominator of two fractions when the numbers are too big to list multiples of.

Last reviewed October 20, 2026 ·How pages are reviewed

Calculate it in practice

ArithmeticAll formulas