GCD & LCM Calculator
Find the Greatest Common Divisor and Least Common Multiple of two integers. Fast, free, and fully client-side.
Calculator Inputs
How the GCD & LCM Calculator Works
The Greatest Common Divisor (GCD) is the largest positive integer that divides two or more numbers without leaving a remainder. The Least Common Multiple (LCM) is the smallest positive integer that is divisible by both numbers, essential for finding common denominators when adding or subtracting fractions.
Formula
LCM(a, b) = (|a × b|) / GCD(a, b)
Computed using the Euclidean algorithm for GCD and dividing the absolute product by the greatest common divisor.
Calculation Example
For numbers 24 and 36: GCD is 12 (largest number dividing both), and LCM is (24 × 36) / 12 = 72.
Frequently Asked Questions
What is the Euclidean Algorithm?
An efficient division-based algorithm for finding the greatest common divisor of two integers by repeatedly replacing the larger number with the remainder of their division.
What are coprime numbers?
Two numbers are coprime (or relatively prime) if their greatest common divisor is 1.
