At One Place

GCD and LCM calculator

Greatest common divisor and least common multiple of any set of numbers.

How it works

Finds the greatest common divisor and least common multiple of two or more numbers, with the Euclidean algorithm steps shown.

The Euclidean algorithm is about 2,300 years old and still the method used, because nothing faster has been found for the general case. It works by repeatedly replacing the larger number with the remainder of dividing it by the smaller, until the remainder is zero. The last non-zero remainder is the GCD, and it typically finishes in a handful of steps even for large numbers.

The two are linked: for any pair, GCD × LCM equals the product of the numbers. That is the quickest way to get the LCM once you have the GCD, and it avoids factorising anything.

Where these actually get used: reducing fractions to lowest terms is division by the GCD, and finding a common denominator is the LCM.

This tool runs entirely in your browser. Nothing you enter is sent to a server, logged or stored, and the page keeps working with the network disconnected.

Common questions

What is the relationship between GCD and LCM?
For two numbers, GCD × LCM = the product of the numbers. So the LCM is the product divided by the GCD.
What is the Euclidean algorithm?
Repeatedly replace the larger number with the remainder of dividing it by the smaller. When the remainder hits zero, the previous remainder is the GCD.

Related pages

Sources

  1. Calculated on this page — At One Place

How these figures are compiled and checked