GCD LCM Calculator – Greatest Common Divisor and Least Multiple

Use the free GCD LCM Calculator below: your data never leaves your browser — all work happens on your device, and nothing is uploaded to any server.

What GCD and LCM Mean

The greatest common divisor (GCD) of two numbers is the largest number that divides both of them exactly. The GCD of 48 and 180 is 12: 12 divides 48 and it divides 180, and no larger number divides both. The least common multiple (LCM) is the smallest positive number that both numbers divide. The LCM of 48 and 180 is 720: both 48 and 180 divide 720, and no smaller positive number works.

These two ideas are partners. GCD is about splitting things down: cutting ropes into the longest equal pieces, or simplifying a fraction to its lowest terms. LCM is about lining things up: finding when two repeating events coincide, or finding a common denominator for two fractions. If you can find one, you can find the other, because GCD × LCM always equals the product of the two numbers.

How to Use This Calculator

Enter two whole numbers, a and b, then press Calculate GCD and LCM. The tool shows the GCD, the LCM, and every step of the Euclidean algorithm: the ancient division method that finds the GCD without factoring either number. For 48 and 180, you will see 180 = 48 × 3 + 36, then 48 = 36 × 1 + 12, then 36 = 12 × 3 + 0. The last non-zero remainder, 12, is the GCD. Then the LCM follows from the formula |a × b| / GCD.

The tool accepts negative numbers and zero, with one exception: GCD(0, 0) is not defined, because every number divides zero, so there is no greatest one. In that case the tool says so plainly instead of guessing.

The Euclidean Algorithm, Step by Step

The algorithm is over two thousand years old and still the fastest way to find a GCD by hand. Divide the larger number by the smaller and keep the remainder. Then divide the previous divisor by that remainder, and keep going. Each step shrinks the numbers, so the process must end, and it ends when a remainder hits zero. The last divisor you used is the GCD.

Why does this work? Any common divisor of the two starting numbers must also divide every remainder in the chain, and the final divisor is the largest such number. It is a beautiful piece of reasoning: instead of factoring two large numbers, which can be very hard, you just divide repeatedly, which is easy. That is why the algorithm survived for millennia.

A Worked Example: Two Buses

Suppose one bus leaves every 48 minutes and another every 180 minutes, and both leave now. When will they leave together again? That is an LCM problem: the next shared departure is LCM(48, 180) = 720 minutes, or 12 hours, from now. Try it in the tool and follow the Euclidean steps to the GCD of 12, then check that 48 × 180 / 12 = 720.

Now suppose you have two ropes, 48 metres and 180 metres, and you want the longest equal pieces you can cut with nothing left over. That is a GCD problem: cut each rope into pieces of 12 metres, giving 4 pieces from the first and 15 from the second. Same two numbers, same GCD, different question.

Common Mistakes

A common mistake is confusing GCD with LCM, especially under time pressure. A quick check helps: the GCD is never larger than either number, and the LCM is never smaller than either number. If your “GCD” is bigger than both inputs, you have actually found something else. Another mistake is forgetting the absolute value in the LCM formula when a number is negative; the LCM is always positive by definition.

People also sometimes list multiples or factors by hand for large numbers and miss one. The Euclidean steps in the tool remove that risk: follow the remainders, and the answer is forced.

Where GCD and LCM Appear

Beyond buses and ropes, GCD and LCM show up in fraction arithmetic, in music (rhythms that line up), in gear ratios, and in computer science, where the Euclidean algorithm sits inside cryptography. Simplifying 48/180 to 4/15 is a GCD step. Adding 1/48 and 1/180 needs the LCM 720 as a common denominator. Learn these two ideas well and a surprising amount of everyday mathematics gets easier.

Related tools

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top