Skip to main content

LCM & GCD Calculator

Least common multiple and greatest common divisor of two or more numbers

Numbers

Quick summary

Enter two or more whole numbers to get both their GCD (greatest common divisor, also called GCF or HCF) and their LCM (least common multiple). For 12 and 18, the GCD is 6 and the LCM is 36. The GCD is the largest number that divides them all evenly — used to reduce fractions; the LCM is the smallest number they all divide into — used to find common denominators.

Reviewed by Simple Calculators TeamLast reviewed

How to use this calculator

  1. Enter the inputs requested by the calculator.
  2. Choose the units or options that match your situation and review the assumptions.
  3. Run or update the calculation to see the result.
  4. Review the result, breakdown, and formulas shown on the page.
  5. Check the inputs, units, dates, and limitations before saving or sharing the result.

Frequently asked questions

What is the difference between LCM and GCD?

The GCD (greatest common divisor) is the largest number that divides all your numbers evenly — for 12 and 18, that's 6. The LCM (least common multiple) is the smallest number all of them divide into evenly — for 12 and 18, that's 36. GCD is about shared factors; LCM is about shared multiples.

How do I find the GCD?

One reliable way is the Euclidean algorithm: repeatedly replace the larger number with its remainder when divided by the smaller, until one becomes zero; the other is the GCD. For more than two numbers, take the GCD of the running result with each next number. This calculator does it instantly.

How do I find the LCM?

Use the relationship LCM(a, b) = a × b ÷ GCD(a, b), applied across the list. For example, LCM(12, 18) = 12 × 18 ÷ 6 = 36. It's the smallest number that every input divides into, which makes it the least common denominator for those fractions.

What are LCM and GCD used for?

GCD reduces fractions to lowest terms (divide numerator and denominator by their GCD) and simplifies ratios. LCM finds the least common denominator when adding or comparing fractions, and solves 'when do cycles line up' problems. Both are core to arithmetic and number theory.

Key terms

GCD / GCF / HCF
Greatest common divisor — the largest number dividing all inputs.
LCM
Least common multiple — the smallest number all inputs divide into.
Euclidean Algorithm
An efficient method to compute the GCD via remainders.

Methodology, sources & limitations

This page shows the formula, assumptions, and limitations used for this estimate. Rates, thresholds, and other time-sensitive inputs can change, so verify them against the relevant official source before relying on a result.

For our review approach and the primary sources we consult, see the methodology and source policy. If you spot an outdated figure or formula, please contact us with a correction.