GCD & LCM Calculator
Find the Greatest Common Divisor (GCD / HCF) and Least Common Multiple (LCM) with complete step-by-step division and prime factor breakdowns.
Prime Factorization Method
Euclidean Algorithm (Division Steps)
Euclidean Steps vs. Prime Factors
For small numbers, prime factor trees (like 24 = 2³ × 3) are quick to write down and compare. For much larger numbers, prime factoring takes a long time, but Euclid's division method finds the GCD in just a handful of remainder steps regardless of how large the numbers are.
Frequently Asked Questions
What is the Greatest Common Divisor (GCD or HCF)?
The GCD (also known as the Highest Common Factor or HCF) is the largest positive integer that divides two or more given numbers without leaving a remainder. For example, GCD(48, 180) = 12.
What is the Least Common Multiple (LCM)?
The LCM is the smallest positive integer that is divisible by all given numbers. For example, LCM(48, 180) = 720.
How does the Euclidean algorithm find the GCD?
The Euclidean algorithm divides the larger number by the smaller number and takes the remainder. It repeats by dividing the previous divisor by the remainder until the remainder is 0. The final non-zero divisor is the GCD.
What is the relationship between GCD and LCM?
For any two positive integers a and b, their product equals the product of their GCD and LCM: a × b = GCD(a, b) × LCM(a, b). This means LCM(a, b) = (a × b) ÷ GCD(a, b).