GCD and LCM Calculator

NUMBER THEORY
GCD (greatest common divisor)
LCM (least common multiple)
Count of numbers
Numbers used

Greatest common divisor and least common multiple

The GCD is the largest number that divides every value in your list with no remainder; the LCM is the smallest number that every value divides into. Enter two or more whole numbers and this calculator returns both at once — the two quantities you need for simplifying fractions and syncing repeating cycles.

How they are found

The GCD comes from the Euclidean algorithm: repeatedly replace the larger number by its remainder against the smaller until one becomes zero. The LCM then follows from the identity LCM(a, b) = a times b divided by GCD(a, b), applied across the list one pair at a time.

Where each is used

GCD reduces a fraction to lowest terms — divide top and bottom by it. LCM gives the common denominator for adding fractions, and answers timing puzzles like when two events that recur on different cycles next coincide.

Related tools

To see the prime building blocks behind these, use the prime factorization calculator; for remainders, the modulo calculator.

Worked example

For 12, 18, and 24: the GCD is 6 (the biggest number dividing all three) and the LCM is 72 (the smallest each divides into).

FAQ

Can I enter more than two numbers?

Yes. The calculator folds the GCD and LCM across the whole list, pair by pair, so any count of two or more works.

What if a number is zero or negative?

Use positive whole numbers. Zero has no well-defined LCM here, and signs are ignored for divisibility.

Spotted an error or have a suggestion for this calculator? Let us know →
Scroll to Top

The calculators and tools on Formula Factory are provided for general guidance and informational purposes only. Results are estimates based on standard formulas and the values you enter — they do not constitute professional engineering, electrical, or architectural advice. Always verify calculations with a qualified professional before making decisions for any safety-critical, code-compliance, or commercial application. Formula Factory makes no representations or warranties as to the accuracy or completeness of any result, and accepts no liability for errors, omissions, or any outcomes arising from reliance on this information.