Worked examples
Grade 7: 48 and 36
48 = 36×1 + 12, 36 = 12×3 + 0, so the GCD is 12 and the LCM is 144
Grade 7: 12, 18, 30
GCD 6, LCM 180
Grade 7: 17 and 5
GCD 1 (coprime), LCM 85
How to use it
- Enter two or more whole numbers. The third and fourth boxes may stay empty.
- Read the GCD and the LCM.
- The division steps are shown for the first two numbers.
What this calculates
The greatest common divisor is the largest number that divides all of them, and the least common multiple is the smallest number that all of them divide. Divide the larger by the smaller, then keep dividing by the remainder (the Euclidean algorithm); the last non-zero remainder is the GCD. For two numbers, a × b = GCD × LCM always holds.
The formulas
- Euclidean algorithm a = b × q + r → gcd(a, b) = gcd(b, r), stop when r = 0
- Least common multiple lcm(a, b) = a × b ÷ gcd(a, b)
- Three or more gcd(a, b, c) = gcd(gcd(a, b), c), and the same for lcm
Reference table
| Numbers | GCD | LCM |
|---|---|---|
| 12, 18 | 6 | 36 |
| 24, 36 | 12 | 72 |
| 15, 28 | 1 | 420 |
| 48, 60 | 12 | 240 |
| 9, 27 | 9 | 27 |
| 35, 49 | 7 | 245 |
Good to know
- To see the prime-factor method, use the Prime Factorization Calculator.
- For reducing and adding fractions, try the Fraction Calculator.
Sources
Frequently asked questions
What does a GCD of 1 mean?
The two numbers share no divisor except 1, and such numbers are called coprime. Then the LCM is simply their product.
Where is the LCM used?
In problems like "when do two buses leave together" and in finding a common denominator when adding fractions.
Can I enter 0?
The first two boxes need whole numbers of 1 or more. If the third and fourth boxes are empty they are ignored.
Can I use more than two numbers?
Yes, up to four. They are combined two at a time from the front.
What about very large numbers?
Each number can go up to 10^15 and the LCM is computed exactly. Very long results are shortened for display.
Are my numbers stored?
No. Everything is calculated in your browser and nothing is sent to a server or saved.
Last updated 2026-12-02 · For reference only; not investment, tax or legal advice.