Find the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of two or more positive integers.
GCD & LCM Calculator - Greatest Common Divisor and Least Common Multiple
Find the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of two or more positive integers.
Parameters
Enter data for calculations
💡 Fill in all required fields to unlock the calculate button
How the GCD & LCM Calculator Works
Enter two or more numbers separated by commas. The calculator finds both the Greatest Common Divisor (GCD) and the Least Common Multiple (LCM) using the Euclidean algorithm. It shows the step-by-step solution and prime factorization of each number.
GCD vs LCM - Definitions and Comparison
GCD and LCM are inverse concepts. One finds the largest shared factor, the other finds the smallest shared multiple:
| Concept | Full Name | Definition | Example (12, 18) |
|---|---|---|---|
| GCD | Greatest Common Divisor | Largest number that divides all inputs evenly | 6 (12=6x2, 18=6x3) |
| LCM | Least Common Multiple | Smallest number divisible by all inputs | 36 (36/12=3, 36/18=2) |
Key relationship: GCD(a,b) x LCM(a,b) = a x b. For 12 and 18: 6 x 36 = 216 = 12 x 18. This formula lets you find one from the other.
The Euclidean Algorithm - Step by Step
The fastest method to find GCD, used since 300 BC. Repeatedly divide and take the remainder until it reaches zero:
| Step | Division | Remainder |
|---|---|---|
| 1 | 48 = 2 x 18 + 12 | 12 |
| 2 | 18 = 1 x 12 + 6 | 6 |
| 3 | 12 = 2 x 6 + 0 | 0 (stop) |
The last non-zero remainder is the GCD: GCD(48, 18) = 6. Then LCM = (48 x 18) / 6 = 144.
Practical Examples
Real-World Applications
| Application | Uses GCD or LCM? | Example |
|---|---|---|
| Simplifying fractions | GCD | 36/48 = (36/12)/(48/12) = 3/4 |
| Adding fractions | LCM | 1/6 + 1/8 = LCD is LCM(6,8)=24 |
| Scheduling problems | LCM | Bus A every 12 min, B every 18 min - both arrive together every LCM(12,18)=36 min |
| Tiling floors | GCD | Room 12x18 ft - largest square tile is GCD(12,18)=6 ft |
| Cryptography (RSA) | GCD | Key generation requires GCD(e, phi) = 1 (coprime check) |
| Gear ratios | GCD | Gears with 48 and 36 teeth - ratio simplifies by GCD(48,36)=12 to 4:3 |
FAQ
Related Tools
Logarithm Calculator
Calculate logarithms with any base - log10, ln, log2 and custom - Open calculator
Area Calculator
Calculate the area of squares, rectangles, triangles, circles and more - Open calculator
Fraction Calculator
Add, subtract, multiply and divide fractions with step-by-step solutions - Open calculator
Average Calculator
Calculate arithmetic, weighted and geometric average - Open calculator
Percentage Calculator
Find percentages, percentage change and ratios - Open calculator