HYPECALC

GCD and LCM Calculator

Need a reliable GCD and LCM calculator with steps? Enter two or more positive integers above to find their greatest common divisor and least common multiple instantly. This tool provides clean, worked steps using both prime factorization and Euclidean division.

Understanding GCD and LCM

The Greatest Common Divisor (GCD)—also known as the Greatest Common Factor (GCF)—is the largest positive integer that divides two or more numbers without leaving a remainder. The Least Common Multiple (LCM) is the smallest positive integer divisible by every number in your set.

Finding common factors and factor pairs helps simplify fractions, scale recipe ratios, and sync recurring cycles. When two values share no common divisors other than 1, they are classified as coprime numbers (GCD = 1). In such cases, their LCM is simply their direct product.

The Formulas Behind GCD and LCM

Our GCD calculator with solution (show work) computes results through the classic Euclidean algorithm. By taking continuous remainders, the algorithm isolates the largest common factor in record time:

GCD(a, b) = GCD(b, a mod b), where GCD(a, 0) = a

Once you have the GCD, you can easily find GCD and LCM of two numbers using the product relationship theorem:

LCM(a, b) = (|a × b|) / GCD(a, b)

How to Calculate GCD and LCM Step-by-Step

1. Identify Your Numbers: Start with your integers, such as 24 and 36.

2. Apply the Prime Factorization Method: Break each number down into prime products:
• 24 = 2³ × 3¹
• 36 = 2² × 3²

3. Extract the GCD: Multiply the lowest exponent of every shared prime factor:
• GCD = 2² × 3¹ = 4 × 3 = 12

4. Compute the LCM: Multiply the highest power of all prime factors present:
• LCM = 2³ × 3² = 8 × 9 = 72

5. Handling 3 Numbers: Need an LCM calculator for 3 numbers (e.g., a, b, c)? Apply the associative rule: compute LCM(a, b), then calculate LCM of that result with c.

Frequently Asked Questions

What is the difference between GCD and LCM?

The Greatest Common Divisor (GCD), or GCF, is the largest whole number that divides into all given numbers without a remainder. The Least Common Multiple (LCM) is the smallest positive integer that all the given numbers divide into evenly.

How do you find the GCD and LCM of two numbers?

You can use prime factorization or the Euclidean algorithm. Write down the prime factorization of each number. For the GCD, multiply the lowest powers of shared factors. For the LCM, multiply the highest powers of all prime factors, or use the formula: LCM(a, b) = (a × b) / GCD(a, b).

What is the relationship between GCD and LCM?

For any two positive integers a and b, the product of their GCD and LCM is equal to the product of the original numbers: GCD(a, b) × LCM(a, b) = a × b.

Is LCM always greater than GCD?

Yes, for any set of positive integers, the LCM is always greater than or equal to the GCD. They are only equal when all numbers in the set are identical (e.g., for 15 and 15, both GCD and LCM are 15).

GCD & LCM Calculator

3 Numbers
* Accepts 2 or more positive integers separated by commas, spaces, tabs, or semicolons.
Evaluated Numbers:24, 36, 60
Greatest Common Divisor (GCD)
12

Largest whole number that divides into all inputs with zero remainder.

Least Common Multiple (LCM)
360

Smallest positive multiple divisible by all evaluated numbers.

Prime Factor DecompositionExponential Form
Number 24:2^3 × 3
Number 36:2^2 × 3^2
Number 60:2^2 × 3 × 5
📐 Euclidean Algorithm Steps (for First Pair: 24 & 36)
Repeated Division Remainder Rule:

36 = 24 × 1 + 12

24 = 12 × 2 + 0

* Greatest Common Divisor (GCD) is computed via Euclidean modulo division. Least Common Multiple (LCM) is calculated by multiplying factors and dividing by common divisors: LCM(a,b) = (a × b) / GCD(a,b).