← All Calculators

GCD & LCM

Greatest common divisor and multiple

GCD & LCM
Greatest common divisor and multiple

GCD and LCM: meaning, relationship, and example

The greatest common divisor (GCD) is the largest positive whole number that divides both inputs evenly. The least common multiple (LCM) is the smallest positive whole number that both inputs divide into evenly. They are useful for simplifying fractions, matching repeating cycles, and finding common denominators.

Worked example: 12 and 18

The largest shared factor of 12 and 18 is 6. The multiples of 12 are 12, 24, 36, … and multiples of 18 are 18, 36, …, so their least common multiple is 36.

A useful relationship

For nonzero integers, LCM(a, b) = |a × b| ÷ GCD(a, b). The absolute value makes the LCM nonnegative even if an input is negative. This calculator expects whole numbers and rejects zero inputs; it does not calculate GCD or LCM for decimals.

To simplify a fraction, divide its numerator and denominator by their GCD. To find when two repeating schedules with integer intervals coincide, their LCM can identify the first shared interval. These methods assume exact whole-number values.

Tips for accurate results

The greatest common divisor is the largest number that divides all your inputs, which is what you use to simplify fractions. The least common multiple is the smallest number all of them divide into, which is what you need for common denominators and repeating schedules. For 12 and 18, the GCD is 6 and the LCM is 36.

Common mistakes and limits

For two numbers, GCD times LCM equals the product of the numbers, which is a handy check: 6 × 36 = 216 = 12 × 18. The concepts apply to positive whole numbers, so decimals and negatives should be converted or handled separately. Zero has special rules, and the GCD of 0 and any number is that number.

About AllCalc

AllCalc is a free calculator hub. Everything runs in your browser — no accounts, no downloads, no clutter. Results are for reference only and are not a substitute for professional financial, medical, or legal advice.

Read more →

Privacy

Calculator inputs are processed in your browser. See the Privacy Policy for details about local storage, third-party advertising, and contact-form submissions.

Read the full policy →

Terms

AllCalc provides general reference calculations. Verify important results independently. Use is at your own risk.

Read the full terms →