LCM & GCD Calculator

Enter two or more whole numbers separated by commas or spaces.

What’s wrong?

Add this calculator to your website or blog

Copy this code and paste it into your page (in the HTML editor). Free, and it adjusts its height automatically.

How it is calculated

GCD by Euclid’s algorithm: gcd(a, b) = gcd(b, a mod b) until the remainder is zero.

lcm(a, b) = a × b ÷ gcd(a, b)

For several numbers, apply the operation in turn.

Worked example

84 and 120: 120 = 84 × 1 + 36, 84 = 36 × 2 + 12, 36 = 12 × 3 + 0, so gcd = 12 and lcm = 84 × 120 ÷ 12 = 840.

Frequently asked questions

When do I use the LCM?
To find a common denominator, or when two repeating events coincide.
And the GCD?
To simplify fractions or split things into the largest equal groups.
What are coprime numbers?
Numbers whose GCD is 1, such as 8 and 15.

Popular searches

  • LCM calculator
  • GCD calculator
  • HCF calculator
  • least common multiple
  • greatest common factor