Calculator
Mathematics

GCD & LCM Calculator Calculator

Calculates GCD and LCM of two integers using the Euclidean algorithm, with prime factorizations and step-by-step breakdown.

Tutorial / How it works →

Info

Instantly find the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of any two integers. Calculations use the Euclidean algorithm. Results include the prime factorization of each number and a step-by-step trace of the algorithm. Useful for simplifying fractions, finding common denominators, solving period problems, and calendar calculations.

Where Are GCD and LCM Used?
  • Simplifying fractions: for 18/24, GCD(18,24) = 6, so 18/24 = 3/4.
  • Period problems: if two signals fire every 4 and 6 seconds, LCM(4,6) = 12, so they coincide every 12 seconds.
  • Finding common denominators: for 1/6 + 1/8, the common denominator is LCM(6,8) = 24.
This calculator works with two integers. If both inputs are 0 the result is undefined. Negative numbers are treated by their absolute values.