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
GCD and LCM examples
| Numbers | GCD | LCM |
|---|---|---|
| 12, 18 | 6 | 36 |
| 8, 12 | 4 | 24 |
| 17, 5 | 1 | 85 |
| 100, 75, 50 | 25 | 300 |
| 21, 6 | 3 | 42 |
Formula
gcd(a, b) = gcd(b, a mod b); lcm(a, b) = a / gcd(a, b) x b
How the gcd and lcm works
- 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.
- Step twoThe tool applies Euclid's method to find the greatest common divisor.
- 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.