Quick Tools Logo Quick Tools

LCM & GCD Calculator

Find the Least Common Multiple and Greatest Common Divisor.

GCD (Greatest Common Divisor)
โ€”
Also called HCF
LCM (Least Common Multiple)
โ€”

Formulas

GCD Relationship
LCM(a,b) ร— GCD(a,b) = a ร— b
Finding LCM
LCM(a,b) = (a ร— b) / GCD(a,b)

๐Ÿ“˜ How It Works

1

Euclidean Algorithm

GCD uses Euclidean algorithm: repeatedly divide larger by smaller, GCD is last non-zero remainder.

2

LCM Formula

LCM(a,b) = (a ร— b) รท GCD(a,b). This relationship makes LCM easy once GCD is known.

3

Multiple Numbers

For 3+ numbers, calculate GCD/LCM pairwise. GCD(a,b,c) = GCD(GCD(a,b), c) and same for LCM.

4

Mathematical Relationship

LCM ร— GCD = Product of the numbers. This is a useful verification check.

5

Input Handling

Enter comma-separated positive integers. At least 2 numbers required for calculation.

๐Ÿ’ก Common Use Cases

Fraction Addition

Find LCM of denominators to get common denominator. 1/4 + 1/6 = 3/12 + 2/12 (LCM of 4,6 is 12).

Fraction Simplification

Divide numerator and denominator by GCD to reduce fractions. 24/36 รท GCD(12) = 2/3.

Scheduling Problems

Find when events sync up. If buses run every 12 and 18 minutes, they sync every LCM(12,18)=36 minutes.

Circular Track Problems

When do runners meet again? Use LCM of lap times to find when they return to start together.

Tile Pattern Calculation

Find smallest square that can be tiled by rectangles of different sizes. Use LCM of dimensions.

Computer Science

GCD and LCM are used in algorithms for cryptography, timing, and resource allocation.

Related Math & Calculators Tools