πŸ“ LCM & GCD Calculator

Find the Least Common Multiple and Greatest Common Divisor with full steps.

β€”

GCD

β€”

LCM

How to Use This Calculator

Enter two or more numbers separated by commas in the input field. The calculator returns both the GCD and LCM, and shows the step-by-step Euclidean algorithm for the GCD. For two numbers, it also verifies the result using the identity LCM Γ— GCD = a Γ— b.

1

Type your numbers separated by commas: e.g., 12, 18 or 12, 18, 24 for three numbers at once.

2

Click Calculate. The GCD and LCM appear in large text side by side.

3

Read the step-by-step working below the results to see how the Euclidean algorithm found the GCD.

4

For two numbers, check the verification row: LCM Γ— GCD should equal a Γ— b. This is a good way to check your answer.

GCD and LCM Formulas

GCD(a, b): Euclidean algorithm β€” replace a with b, b with (a mod b), repeat until b = 0 LCM(a, b) = |a Γ— b| / GCD(a, b) For multiple numbers: apply iteratively GCD(12, 18): 18 = 1Γ—12 + 6, 12 = 2Γ—6 + 0 β†’ GCD = 6 LCM(12, 18) = 12Γ—18 / 6 = 36

The GCD is the largest number that divides both values without a remainder. The LCM is the smallest number that both values divide evenly into. These two are linked by the identity LCM(a,b) Γ— GCD(a,b) = a Γ— b, which lets you calculate one from the other quickly.

Worked Examples

GCD(48, 18)48 = 2Γ—18+12 β†’ 18 = 1Γ—12+6 β†’ 12 = 2Γ—6+0 β†’ GCD = 6
LCM(4, 6)LCM = 4Γ—6 / GCD(4,6) = 24 / 2 = 12
GCD(100, 75, 50)GCD(100,75)=25, then GCD(25,50)=25
LCM(3, 4, 5)LCM(3,4)=12, LCM(12,5)=60

Where This Comes Up in Real Life

Adding fractions with different denominators requires the LCM, known in that context as the Lowest Common Denominator (LCD). To add 1/12 + 1/18, you find LCM(12, 18) = 36. Convert both: 3/36 + 2/36 = 5/36. Using any other common multiple (like 216) would work mathematically but give a fraction that is harder to simplify.

Scheduling problems often come down to LCM. Two traffic lights cycle at 45 seconds and 60 seconds respectively. They both turn green at the same moment. When will this happen again? LCM(45, 60) = GCD first: GCD(45, 60) = 15. LCM = 45 Γ— 60 / 15 = 180 seconds, which is 3 minutes. The same reasoning applies to gear train synchronization, bus timetables, and production-line machinery timing.

Frequently Asked Questions

What is the GCD (Greatest Common Divisor)?

The GCD of two numbers is the largest number that divides both evenly. GCD(12, 18) = 6. Also called GCF (Greatest Common Factor) or HCF (Highest Common Factor).

What is the LCM (Least Common Multiple)?

The LCM is the smallest number that is a multiple of both values. LCM(4, 6) = 12 because 12 is the smallest number divisible by both 4 and 6.

How are LCM and GCD related?

LCM(a,b) Γ— GCD(a,b) = a Γ— b. So LCM(12,18) = 12Γ—18/GCD(12,18) = 216/6 = 36.

What is the Euclidean algorithm for GCD?

Repeatedly replace the larger number with the remainder of dividing the larger by the smaller. GCD(48,18): 48=2Γ—18+12 β†’ 18=1Γ—12+6 β†’ 12=2Γ—6+0. So GCD=6.

When is LCM used in real life?

LCM is used to find the LCD (Least Common Denominator) for adding fractions, scheduling repeating events (e.g., when two machines with different cycle times will sync), and gear ratio calculations.