LCM & GCD Calculator
Least common multiple and greatest common divisor of two or more numbers
Related calculators
All utility & math- Quadratic Equation SolverSolve ax²+bx+c=0 — roots, discriminant, and vertex
- Slope CalculatorSlope, line equation, distance, and midpoint from two points
- Exponent CalculatorRaise any base to any power, including negative and fractional
- Logarithm Calculatorlog base b, natural log (ln), log₁₀, and log₂
- Square Root CalculatorSquare root, cube root, or nth root with simplified radical
- Prime Factorization CalculatorPrime factors, primality check, and all divisors of a number
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
- Enter the inputs requested by the calculator.
- Choose the units or options that match your situation and review the assumptions.
- Run or update the calculation to see the result.
- Review the result, breakdown, and formulas shown on the page.
- 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.