Calculate Least Common Multiple (LCM) and Greatest Common Divisor (GCD) of two numbers with detailed steps
Enter two positive integers to calculate their LCM and GCD
Fundamental Relationship
GCD(a, b) × LCM(a, b) = a × b for any two positive integers.
LCM from GCD
LCM(a, b) = |a × b| / GCD(a, b)
GCD(a, b) × LCM(a, b) = a × b
Where: GCD = Greatest Common Divisor, LCM = Least Common Multiple
Our LCM and GCD Calculator helps you find the Least Common Multiple and Greatest Common Divisor of two numbers with step-by-step solutions. These fundamental concepts in number theory are essential for various mathematical operations and real-world applications.
The GCD of two or more integers is the largest positive integer that divides each of the integers without a remainder. It is also known as the Greatest Common Factor (GCF) or Highest Common Factor (HCF).
The LCM of two or more integers is the smallest positive integer that is divisible by each of the integers. It represents the smallest number that both numbers can divide into evenly.
For any two positive integers a and b, the following relationship holds:
GCD(a, b) × LCM(a, b) = a × b
This relationship allows us to calculate LCM from GCD and vice versa, making it a cornerstone of number theory.
Example 1: GCD(12, 18) and LCM(12, 18)
Factors of 12: 1, 2, 3, 4, 6, 12
Factors of 18: 1, 2, 3, 6, 9, 18
GCD = 6, LCM = 36
👉 Verification: 6 × 36 = 216, and 12 × 18 = 216 ✓
Example 2: GCD(7, 9) and LCM(7, 9)
7 and 9 are co-prime (no common factors except 1)
GCD = 1, LCM = 63
👉 Verification: 1 × 63 = 63, and 7 × 9 = 63 ✓
Q1. What is the difference between GCD and LCM?
A: GCD finds the largest number that divides both numbers, while LCM finds the smallest number that both numbers divide into.
Q2. How do you calculate GCD manually?
A: Use the Euclidean algorithm: repeatedly divide the larger number by the smaller one and replace with the remainder until you reach zero.
Q3. What does it mean when GCD is 1?
A: When GCD(a, b) = 1, the numbers are called co-prime or relatively prime, meaning they share no common factors other than 1.
Q4. Can LCM be smaller than the numbers?
A: No, LCM is always greater than or equal to the larger of the two numbers (unless one divides the other).
Q5. What if one number is zero?
A: GCD with zero is defined as the absolute value of the non-zero number. LCM with zero is undefined.
For further understanding and validation of the formulas used above, we recommend exploring these authoritative resources: