Przejdź do treści
Liczbnik

GCD and LCM Calculator

Enter two positive integers — the calculator returns GCD and LCM using the Euclidean algorithm.

Reviewed byRedakcja Liczbnik
Calculator
ResultGCD (greatest common divisor)4
LCM (least common multiple)
24

How we calculate

GCD uses the Euclidean algorithm: GCD(a, b) = GCD(b, a mod b). LCM = |a × b| / GCD(a, b).

Example: GCD(12, 8)

GCD(12, 8) = 4. LCM(12, 8) = 12×8/4 = 24.

Frequently asked questions

What is GCD?

Greatest Common Divisor — the largest integer that divides both numbers without a remainder.

What is LCM?

Least Common Multiple — the smallest positive integer that is divisible by both numbers.

How is GCD used in fractions?

GCD is used to simplify fractions: divide both numerator and denominator by GCD.

How is LCM used in fractions?

LCM gives the common denominator needed for adding or subtracting fractions.

What is the Euclidean algorithm?

An efficient method: GCD(a,b) = GCD(b, a mod b). Repeat until b=0, then a is the GCD.

What if GCD equals 1?

If GCD(a,b) = 1, the numbers are coprime (no common factors except 1).

Indicative result

For educational purposes.
  • Fraction Calculator

    Calculate addition, subtraction, multiplication and division of fractions online. Result as simplified fraction and decimal. Free.

    Maths