Math & Statistics
GCD & LCM Calculator โ Find Greatest Common Divisor & Least Common Multiple
Use our free GCD & LCM Calculator to quickly calculate the greatest common divisor (GCD) and least common multiple (LCM) of two or more numbers. Perfect for students and math enthusiasts.
Understanding GCD & LCM
The Greatest Common Divisor (GCD), also called HCF, is the largest number that divides two or more numbers without a remainder. The Least Common Multiple (LCM) is the smallest positive number that is a multiple of all given numbers.
Key relationship: For any two numbers a and b, GCD(a, b) ร LCM(a, b) = a ร b. The GCD is found using the Euclidean algorithm (repeated division), and the LCM can be derived from it. Both are essential for simplifying fractions, finding common denominators, and solving divisibility problems.
How to Use This Calculator
- Enter two or more positive integers separated by commas
- Click Calculate GCD & LCM
- View the GCD, LCM, Euclidean steps, and prime factorizations
- Use Clear to reset and enter new numbers
Common Use Cases
- Simplifying fractions
- Finding common denominators
- Scheduling & cycles
- Ratio & proportion
- Number theory homework
- Tiling & measurement
Common GCD & LCM Examples
| Numbers | GCD | LCM | GCD ร LCM | Product |
|---|---|---|---|---|
| 12, 18 | 6 | 36 | 216 | 216 โ |
| 8, 12 | 4 | 24 | 96 | 96 โ |
| 15, 25 | 5 | 75 | 375 | 375 โ |
| 7, 13 | 1 | 91 | 91 | 91 โ |
| 24, 36, 48 | 12 | 144 | โ | |
| 6, 10, 15 | 1 | 30 | โ | |
Methods to Find GCD
| Method | How It Works | Example (GCD of 48, 18) |
|---|---|---|
| Euclidean Algorithm | Repeatedly divide and take remainder | 48 = 2ร18 + 12 โ 18 = 1ร12 + 6 โ 12 = 2ร6 + 0 โ GCD = 6 |
| Prime Factorization | Factor both, multiply common primes | 48 = 2โดร3, 18 = 2ร3ยฒ โ common: 2ร3 = 6 |
| Listing Divisors | List all divisors, find largest common | 48: {1,2,3,4,6,8,12,16,24,48} โฉ 18: {1,2,3,6,9,18} โ 6 |
FAQ โ GCD & LCM Calculator
What is GCD (Greatest Common Divisor)?
The GCD, also known as the HCF (Highest Common Factor), is the largest number that divides two or more numbers without leaving a remainder. Example: GCD of 12 and 18 is 6.
What is LCM (Least Common Multiple)?
The LCM is the smallest positive number that is a multiple of two or more numbers. Example: LCM of 4 and 5 is 20. It's used to find common denominators when adding fractions.
How are GCD and LCM related?
For any two numbers a and b: GCD(a, b) ร LCM(a, b) = a ร b. This means if you know one, you can calculate the other. This relationship only holds directly for two numbers.
What is the Euclidean algorithm?
The Euclidean algorithm finds the GCD by repeatedly dividing the larger number by the smaller and taking the remainder, until the remainder is 0. The last non-zero remainder is the GCD. It's one of the oldest algorithms in mathematics.
Can this calculator handle more than two numbers?
Yes. Enter any number of positive integers separated by commas. The calculator finds the GCD and LCM of all numbers by applying the algorithm pairwise across the entire set.
What if the GCD is 1?
When GCD = 1, the numbers are called "coprime" or "relatively prime." They share no common factors other than 1. Example: 8 and 15 are coprime. Their LCM equals their product (8 ร 15 = 120).
Why is GCD useful for simplifying fractions?
To simplify a fraction, divide both numerator and denominator by their GCD. Example: 12/18 โ GCD(12,18) = 6 โ 12รท6 / 18รท6 = 2/3. The result is the fraction in lowest terms.
Why is LCM useful for adding fractions?
To add fractions with different denominators, find the LCM of the denominators (the LCD). Example: 1/4 + 1/6 โ LCM(4,6) = 12 โ 3/12 + 2/12 = 5/12.
What if one of the numbers is zero?
GCD(0, n) = n because any number divides 0. LCM(0, n) = 0 because 0 has no positive multiples. This calculator requires positive integers.
Can I use decimals or negative numbers?
GCD and LCM are defined for positive integers only. For decimals, multiply by a power of 10 to convert to integers first. For negatives, use the absolute values.