GCD and LCM Calculator

Calculate the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of two or more numbers. Free.

Find the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of two or more integers. Useful for simplifying fractions, scheduling problems, and number theory.

What GCD and LCM mean

The GCD (also called HCF — Highest Common Factor) is the largest number that divides all given numbers evenly. The LCM is the smallest number that all given numbers divide into evenly. For example, GCD(12, 18) = 6 and LCM(12, 18) = 36.

Real-world uses

  • GCD — simplifying fractions (divide numerator and denominator by GCD), splitting items evenly into groups
  • LCM — finding a common denominator for fractions, scheduling repeating events (e.g., two buses with different intervals)

How it is calculated

The calculator uses the Euclidean algorithm for GCD — repeatedly replace the larger number with the remainder of dividing the two. LCM is then computed as (a × b) ÷ GCD(a, b). This approach is efficient even for large numbers.

Frequently Asked Questions

Related Calculators