General

๐Ÿ”ข GCD & LCM Calculator

Find the greatest common divisor and least common multiple of two numbers, with prime factorization.

What is a GCD & LCM Calculator?

This calculator finds the greatest common divisor (GCD) and least common multiple (LCM) of numbers โ€” used for simplifying fractions and finding when repeating cycles align.

How it's calculated

The Euclidean algorithm finds GCD, and then GCD ร— LCM = the product of the two numbers gives the LCM.

Step-by-step example

Finding the GCD of 48 and 18

Interpretation: The LCM follows directly as (48ร—18)รท6 = 144, once you know the GCD.

A 2,300-year-old algorithm

The Euclidean algorithm, described in Euclid's Elements around 300 BCE, is still exactly the algorithm computers use today. It works by repeatedly replacing the larger number with the remainder of dividing it by the smaller, until the remainder is 0.

48 and 18 โ†’ remainder 12 โ†’ remainder 6 โ†’ remainder 0 โ†’ answer: 6

Good to know

Frequently asked questions

Q. What is GCD used for?

Simplifying fractions, dividing items evenly with nothing left over, and tiling a rectangle with the largest possible squares.

Q. What is LCM used for?

Finding a common denominator for fractions, and calculating when different-length cycles (bus schedules, gears, signal timing) realign.

Q. Can this work for three or more numbers?

Yes. Compute pairwise: GCD(a,b,c) = GCD(GCD(a,b), c).