GCD & LCM Calculator

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

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

This calculator finds the greatest common divisor (GCD) and least common multiple (LCM) of any list of whole numbers. The GCD — also called the highest common factor (HCF) — is the largest number that divides every value exactly; the LCM is the smallest number that every value divides into. Both are essential for simplifying fractions, finding common denominators, and scheduling repeating events.

How it works

The tool reads your input, splits it on commas or spaces, keeps only whole non-zero numbers, then computes both results in one pass:

  • GCD uses the Euclidean algorithm: repeatedly replace the larger number with the remainder of dividing the two, until one becomes zero; the other is the GCD. For several numbers it folds them pairwise — GCD(a, b, c) = GCD(GCD(a, b), c).
  • LCM is derived from the GCD using LCM(a, b) = |a × b| ÷ GCD(a, b), chained across the list.

Negative inputs use their absolute value, and at least two non-zero numbers are required.

Example

Enter 12, 18, 24:

  • GCD: GCD(12, 18) = 6, then GCD(6, 24) = 6
  • LCM: LCM(12, 18) = 36, then LCM(36, 24) = 72

So 6 divides all three numbers, and 72 is the smallest number all three divide into.

NumbersGCDLCM
12, 18636
12, 18, 24672
8, 151120

Everything runs in your browser, so nothing you enter is uploaded.

Ad placeholder (rectangle)