GCD & LCM Calculator
Compute the Greatest Common Divisor and Least Common Multiple.
About GCD & LCM Calculator
The GCD & LCM Calculator computes the Greatest Common Divisor and Least Common Multiple for two or more integers using Euclid's algorithm — one of the oldest numerical algorithms, running in O(log min(a,b)) time. GCD finds the largest integer that divides all inputs evenly, while LCM finds the smallest positive integer divisible by all inputs, computed as LCM(a,b) = |a*b| / GCD(a,b). These operations are foundational in number theory, fraction arithmetic, modular arithmetic, scheduling theory, and digital signal processing.
How to Use
Enter two or more integers separated by commas or spaces in the input field — the tool accepts arbitrarily large integers and negative numbers. Click Calculate to see the GCD and LCM along with a step-by-step breakdown of the Euclidean algorithm showing each division step and remainder, making it useful for both practical calculation and learning the algorithm. Results update automatically when you modify the inputs.
Common Use Cases
- Mathematics students and educators tracing through the Euclidean algorithm step-by-step to understand why GCD computation converges quickly and how each remainder reduction brings the algorithm toward termination
- Developers implementing fraction arithmetic libraries who need to simplify fractions to lowest terms by dividing numerator and denominator by their GCD before display or comparison operations
- Scheduling system engineers calculating the LCM of multiple task periods to find the hyperperiod — the minimum time window after which all periodic tasks repeat in identical phase alignment
- Competitive programmers quickly verifying GCD and LCM results for number theory problems involving modular arithmetic, Bezout coefficients, or Diophantine equations
- Digital signal processing engineers finding the LCM of sample rates when designing rational sample rate converters that must upsample by L and downsample by M with minimal distortion