Greatest Common Divisor/Least Common Multiple Calculator

The Greatest Common Divisor (GCD) of two numbers M & N is calculated by repeatedly dividing the larger of the two numbers by the smaller and replacing the larger with the remainder until the remainder is 0.

The Least Common Multiple (LCM) is then calculated as:

lcm(M,N) = M*N / gcd(M,N)

This particular fact only works for two numbers at a time, but you can use it repeatedly for a larger set:

lcm(M,N,K) = lcm(M, lcm(N,K))

Calculator:

Enter values for M and N and press the "calculate" button to calculate GCD and LCM.

M: N:



Greatest Common Divisor:
Least Common Multiple:


Return to Kerry's home page