GCD and LCM calculator
The Euclidean algorithm finds the GCD in a handful of steps even for very large integers, and the LCM follows from it.
Greatest common divisor
12
- Least common multiple
- 720
- Product of the two
- 8640
- First divided by the GCD
- 4
- Second divided by the GCD
- 15
- Coprime 1 when the only common factor is 1.
- 0
Show the working
- First integer = 48
- Second integer = 180
- Greatest common divisor = gcd(48, 180) = 12
- Least common multiple = lcm(48, 180) = 720
- Product of the two = abs(48 * 180) = 8640
- Coprime = 12 == 1 ? 1 : 0 = 0
- First divided by the GCD = 12 != 0 ? 48 / 12 : 0 = 4
- Second divided by the GCD = 12 != 0 ? 180 / 12 : 0 = 15
Values are shown to six significant figures here; the arithmetic itself runs on exact fractions and is only rounded where a number is printed.
Scenarios & local history
Compare a saved scenario
Recent calculations
The formula
- gcd(a,b) x lcm(a,b) = |a x b|