Skip to content

GCD and LCM Calculator

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

GCD and LCM
Two or more whole numbers.

Greatest common divisor
6
180
Least common multiple
3
Numbers used

Private: Everything runs in this page. Nothing you type is sent anywhere or saved.

On this page
  1. GCD and LCM examples
  2. Formula
  3. How the gcd and lcm works
  4. What this tool does not do
  5. Frequently asked questions
  6. Related tools

GCD and LCM examples

NumbersGCDLCM
12, 18636
8, 12424
17, 5185
100, 75, 5025300
21, 6342

Formula

gcd(a, b) = gcd(b, a mod b); lcm(a, b) = a / gcd(a, b) x b

How the gcd and lcm works

  1. Step oneType two or more whole numbers, separated by commas, spaces, semicolons or line breaks: 12,18,30 and 12, 18, 30 are both three numbers. A comma always separates numbers here, so write 1000, not 1,000.
  2. Step twoThe tool applies Euclid's method to find the greatest common divisor.
  3. Step threeThe least common multiple is worked out from the same numbers.

What this tool does not do

  • It works with whole numbers up to 9,007,199,254,740,991. A comma always separates numbers here, so write 1000, not 1,000.
  • A least common multiple that is larger than that is refused, not rounded.
  • It does not show the working steps.

Frequently asked questions

What is the greatest common divisor used for?

It is the largest number that divides all the numbers exactly. Dividing a fraction's top and bottom by it gives the simplest form.

What is the least common multiple used for?

It is the smallest number that all the numbers divide into. It is the common denominator when you add fractions.

What are the limits?

Whole numbers up to 9,007,199,254,740,991. If the least common multiple would be larger than that, the tool says so instead of showing a wrong number.