GCD and LCM Calculator

Home › Math Calculators › GCD and LCM Calculator

Find the greatest common divisor and least common multiple of two whole numbers.

How the calculation works

The calculator uses the Euclidean algorithm to find the GCD, then uses it to compute the LCM.

Formula used

LCM(a, b) = a × b ÷ GCD(a, b)

Example

For 12 and 18 the GCD is 6 and the LCM is 36.

About GCD and LCM

GCD

The greatest common divisor, also called the greatest common factor, is the largest number that divides both numbers exactly. It is used to simplify fractions.

LCM

The least common multiple is the smallest number that both numbers divide into. It is used to find common denominators and to line up repeating cycles.

The link between them

For two numbers a and b, the product of their GCD and LCM equals a times b. The calculator uses this to find the LCM.

Prime factors

The table shows each number as a product of prime numbers. The GCD uses the primes they share and the LCM uses all primes at their highest power.

Frequently asked questions

Where is GCD used?

Simplifying fractions and splitting items into equal groups.

Can I use decimals?

No. Enter whole numbers only.

Results are estimates for general information only and are not professional financial, medical or legal advice.

All Calculators

Every calculator on the site, in 16 categories.