LCM & GCD Calculator

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

Separate with commas or spaces. Decimals are rounded to whole numbers.

Greatest common divisor
Least common multiple
Numbers used
Also known as
GCF · HCF
Sum

Works on positive whole numbers. Zeros and non-numbers are ignored.

Two sides of the same idea

The greatest common divisor is the biggest number that fits evenly into all your values; the least common multiple is the smallest number they all fit into. They are closely linked and often used together.

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

For a longer list, the calculator combines the numbers in pairs — carrying the running GCD or LCM forward — so the final answer reflects every value you entered.

Worked example

For 12, 18 and 24 the greatest common divisor is 6 — the largest number dividing all three — and the least common multiple is 72, the smallest number they all divide into.

Everyday uses

GCD quietly powers fraction simplification and dividing things into equal groups. LCM is the trick behind finding common denominators and working out when repeating schedules coincide — buses that come every 12 and 18 minutes next meet after the LCM, 36 minutes.

Quick checks

  • GCD ≤ smallest value. It cannot exceed any number in the list.
  • LCM ≥ largest value. It is a multiple of every number.
  • Coprime? If the GCD is 1, the LCM is simply the product.

Frequently asked questions

What is the difference between GCD and LCM?
The GCD (also called GCF or HCF) is the largest number that divides every value evenly. The LCM is the smallest number that every value divides into without remainder.
How are they calculated?
The GCD uses Euclid’s algorithm, applied across the list. The LCM of two numbers is their product divided by their GCD, extended to the whole list.
Where are they useful?
GCD simplifies fractions and shares things into equal groups; LCM finds common denominators and lines up repeating cycles, like events that recur on different intervals.
Do they work with more than two numbers?
Yes. Enter as many integers as you like — the calculator combines them two at a time to give the GCD and LCM of the whole set.