LCM & GCD Calculator

Find the Least Common Multiple (LCM) and Greatest Common Divisor (GCD / HCF) of two or more positive integers with exponential prime factorizations.

Category: Math

How to Use LCM & GCD Calculator

  1. Enter two or more positive whole integers separated by commas, spaces, or newlines (e.g., 24, 36, 60).
  2. Click Calculate to run the iterative BigInt Euclidean algorithm across your numbers.
  3. Review the Least Common Multiple (LCM), Greatest Common Divisor (GCD / HCF), coprime check, and exponential prime factorization for each integer.

Related Math Tools

  • Prime Number Checker

    Test if an integer up to 10¹² is prime, composite, or a multiplicative unit, list all positive divisors, find prime factorizations, and locate adjacent primes.

  • Fraction Calculator

    Add, subtract, multiply, and divide fractions with Euclidean GCD simplification to lowest terms, mixed numbers, decimals, and percentages.

  • Ratio Calculator

    Simplify integer or decimal ratios (A:B) to lowest terms, solve unknown X in proportions (A:B = C:X), and calculate unit ratios and percentage shares.

  • Square Root Calculator

    Find principal square roots (√x), cube roots (∛x), and Nth roots (ⁿ√x) with exact simplified radical form (aⁿ√b) and perfect root verification.

  • Scientific Calculator

    Evaluate complex mathematical expressions with Degrees (DEG) and Radians (RAD) trigonometry, logarithms, roots, exponents, and factorials.

Frequently Asked Questions

What is the difference between LCM and GCD (HCF)?

The Greatest Common Divisor (GCD), also called Highest Common Factor (HCF), is the largest positive integer that divides every number in your set without a remainder. The Least Common Multiple (LCM) is the smallest positive integer that is evenly divisible by every number in your set.

How does the calculator compute GCD and LCM for multiple numbers?

Our engine applies the Euclidean algorithm iteratively across your list using 64-bit arbitrary-precision BigInt arithmetic: gcd(a, b, c) = gcd(gcd(a, b), c) and lcm(a, b) = (a ÷ gcd(a, b)) × b. Dividing by the GCD before multiplying prevents integer overflow on large lists.

How do you find LCM and GCD using prime factorization?

Break each integer down into prime powers (for example, 24 = 2³ × 3¹ and 36 = 2² × 3²). The GCD takes the minimum exponent of each shared prime (2² × 3¹ = 12), whereas the LCM takes the maximum exponent of every prime factor present (2³ × 3² = 72).

What does it mean when two or more numbers are Coprime (Relatively Prime)?

Integers are coprime (or mutually relatively prime) when their Greatest Common Divisor (GCD) equals 1, meaning they share no prime factors in common (for example, 8, 15, and 49 have GCD = 1).

Why must inputs to the LCM & GCD Calculator be positive integers?

In elementary number theory, prime factorization and least common multiples are defined over positive integers (1, 2, 3, ...). Zero has no positive multiples other than 0, and decimals must be converted to fractions before common denominators are found.