OhMyCalc

GCD and LCM Calculator

Compute the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of two or more numbers with step-by-step solutions and prime factorizations.

How to Find GCD and LCM

  1. Enter two or more positive integers separated by commas.
  2. Click Calculate to instantly get both the GCD and LCM.
  3. Review the step-by-step Euclidean algorithm breakdown for the GCD.
  4. Check the prime factorization of each number to verify the result.

Riferimento Rapido

DaA
GCD(12, 8)4
LCM(4, 6)12
GCD(15, 25)5
LCM(3, 7)21
GCD(100, 75)25
LCM(12, 18)36

Casi d'Uso

Formula

GCD is found using the Euclidean algorithm: GCD(a, b) = GCD(b, a mod b). LCM(a, b) = |a × b| / GCD(a, b). For multiple numbers, apply the formulas iteratively.

Domande Frequenti

What is the difference between GCD and LCM?
The GCD (Greatest Common Divisor) is the largest number that divides all given numbers evenly. The LCM (Least Common Multiple) is the smallest number that is a multiple of all given numbers.
How does the Euclidean algorithm work?
Repeatedly divide the larger number by the smaller and replace the larger with the remainder. When the remainder is 0, the last non-zero remainder is the GCD. For example, GCD(48, 18): 48 = 2×18 + 12, 18 = 1×12 + 6, 12 = 2×6 + 0, so GCD = 6.
Can I find the GCD/LCM of more than two numbers?
Yes. Compute the GCD or LCM of the first two numbers, then use that result with the next number, and so on. For example, GCD(12, 18, 24) = GCD(GCD(12, 18), 24) = GCD(6, 24) = 6.