Calculate the Greatest Common Divisor (GCD/GCF) and Least Common Multiple (LCM) of two or more numbers. Shows the Euclidean algorithm step-by-step. Free and instant.
Enter numbers separated by commas or spaces
This calculator finds the Greatest Common Divisor (GCD), also known as Greatest Common Factor (GCF) or Highest Common Factor (HCF), and the Least Common Multiple (LCM) of any set of positive integers. It uses the efficient Euclidean algorithm for GCD calculation and displays each step so you can follow the mathematical process. All calculations happen instantly in your browser — no server required.
There is no difference — GCD (Greatest Common Divisor), GCF (Greatest Common Factor), and HCF (Highest Common Factor) all mean the same thing: the largest positive integer that divides all given numbers without a remainder.
The Euclidean algorithm is an efficient method for computing the GCD of two numbers. It works by repeatedly dividing the larger number by the smaller and taking the remainder, until the remainder is zero. The last non-zero remainder is the GCD.
For two numbers a and b: LCM(a, b) = |a × b| / GCD(a, b). For more than two numbers, the LCM is computed iteratively: LCM(a, b, c) = LCM(LCM(a, b), c).
Two numbers are coprime (or relatively prime) if their GCD is 1. This means they share no common factors other than 1. For example, 17 and 19 are coprime.