🔢

GCD & LCM Calculator

Find the greatest common divisor and least common multiple

GCD & LCM Calculator

About This Calculator

A GCD and LCM calculator finds the Greatest Common Divisor and Least Common Multiple of two or more numbers — two fundamental operations in number theory with wide practical applications. The GCD (also called Greatest Common Factor or Highest Common Factor) is the largest number that divides all given numbers evenly, calculated efficiently using the Euclidean algorithm: GCD(a, b) = GCD(b, a mod b), repeated until the remainder is 0. The LCM is the smallest number that all given numbers divide into evenly, and is related to GCD by the formula LCM(a, b) = |a × b| / GCD(a, b). For example, GCD(24, 36) = 12 and LCM(24, 36) = 72. These calculations are used for simplifying fractions (GCD divides both numerator and denominator), finding common denominators (LCM), solving scheduling problems (when will two recurring events coincide?), gear ratio calculations, and music theory (rhythm patterns). The Euclidean algorithm makes this calculator efficient even for very large numbers. Enter two or more numbers to instantly see both GCD and LCM along with the prime factorization of each number.

How to Use

  1. 1
    Enter your numbers
    Input two or more integers you want to analyze.
  2. 2
    Click Calculate
    Press Calculate to find the GCD and LCM.
  3. 3
    View the solution
    See the GCD, LCM, and prime factorization of each number.

Frequently Asked Questions

Q. What is the easiest way to find the GCD?
The Euclidean algorithm is the fastest method: repeatedly divide the larger number by the smaller and replace the larger with the remainder. For GCD(48, 18): 48 ÷ 18 = 2 remainder 12, then 18 ÷ 12 = 1 remainder 6, then 12 ÷ 6 = 2 remainder 0. The last non-zero remainder (6) is the GCD.
Q. How do I find the LCM of two numbers?
The easiest formula is LCM(a, b) = (a × b) / GCD(a, b). For example, LCM(12, 18) = (12 × 18) / GCD(12, 18) = 216 / 6 = 36. For three or more numbers, find the LCM of the first two, then find the LCM of that result with the next number, and continue until all numbers are included.
Q. What is the difference between GCD and LCM?
GCD finds the largest number that divides into all your numbers (going down), while LCM finds the smallest number that all your numbers divide into (going up). GCD is always less than or equal to the smallest number, while LCM is always greater than or equal to the largest. They are inversely related: GCD × LCM = a × b for two numbers.
Q. When do I need GCD and LCM in real life?
GCD helps simplify fractions (e.g., reducing 24/36 to 2/3), split items into equal groups, and determine tile sizes for flooring. LCM solves scheduling problems (two buses departing every 12 and 18 minutes meet every 36 minutes), finding common denominators for adding fractions, and synchronization problems.

Disclaimer: Results are for informational purposes only and do not constitute professional advice. Always consult qualified professionals for important decisions.