GCD & LCM Calculator

Find greatest common divisor and least common multiple with prime factorization.

GCD

12

LCM

72

Prime Factorizations

242^3 × 3
362^2 × 3^2

Use the GCD & LCM Calculator above to calculate your results. Enter your values and see instant results — all calculations run in your browser.

Disclaimer: This calculator is for informational purposes only and does not constitute tax, financial, or legal advice. Results are estimates based on the information you provide and current rates. Always consult a qualified tax professional or financial advisor for advice specific to your situation.

How It Works

Our GCD & LCM Calculator efficiently determines the greatest common divisor and least common multiple of two or more integers using prime factorization. This is crucial for optimizing resource allocation in large-scale projects, such as scheduling 2026's 3,500 planned satellite launches to minimize orbital congestion or synchronizing 2026's 18,000 global financial transactions to prevent system bottlenecks.

The calculator first finds the prime factorization of each input number. For the GCD, it multiplies the common prime factors raised to the lowest power they appear in any factorization. For the LCM, it multiplies all unique prime factors raised to the highest power they appear in any factorization.

Ensure all inputs are positive integers; the concepts of GCD and LCM are typically applied to non-zero natural numbers. A common mistake is to confuse the 'lowest' power for GCD with 'highest', and vice-versa for LCM, leading to incorrect results, especially with numbers containing many shared prime factors.

Example: Optimizing Delivery Routes for 2026

  1. 1 A logistics company in 2026 needs to synchronize delivery routes. One route takes 12 days to complete, another takes 18 days, and a third takes 30 days. We want to find when all three routes will align for maintenance (LCM) and the largest common interval for intermediate checks (GCD).
  2. 2 Prime factorization: 12 = 2^2 * 3; 18 = 2 * 3^2; 30 = 2 * 3 * 5. For GCD, common primes with lowest powers: 2^1 * 3^1. For LCM, all unique primes with highest powers: 2^2 * 3^2 * 5^1.
  3. 3 GCD = 2 * 3 = 6. LCM = 4 * 9 * 5 = 180.
  4. 4 The greatest common divisor (GCD) is 6 days, meaning the largest common interval for intermediate checks across all routes is every 6 days. The least common multiple (LCM) is 180 days, indicating that all three routes will align for major maintenance every 180 days, allowing for efficient resource planning across the company's 2026 operations.

Source: Khan Academy · Last updated: April 2026

Frequently Asked Questions

How do you find the GCD of two numbers?
Use the Euclidean algorithm: divide the larger number by the smaller, then divide the divisor by the remainder, repeating until the remainder is 0. The last nonzero remainder is the GCD. For 48 and 18: 48÷18=2r12, 18÷12=1r6, 12÷6=2r0, so GCD=6.
How do you find the LCM of two numbers?
LCM = (a x b) / GCD(a,b). For 12 and 18: GCD is 6, so LCM = (12 x 18)/6 = 216/6 = 36.
What is GCD used for in real life?
GCD helps simplify fractions (24/36 simplifies by GCD 12 to 2/3), divide items into equal groups, and tile rectangular spaces. LCM is useful for finding common schedules, synchronizing events, and adding fractions with different denominators.