GCD and LCM Calculator

Calculate the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of numbers.

Inputs

GCD and LCM Calculator

About GCD & LCM

Calculate the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of numbers.

Results

Embed This Calculator

laqayt logo

Share this tool with your audience. 100% free and fully responsive.

How the GCD and LCM Calculator Works

LCM(a,b) = |a x b| / GCD(a,b) | Euclidean algorithm: GCD(a,b) = GCD(b, a mod b)

The Greatest Common Divisor (GCD) is the largest number that divides both numbers evenly. The Least Common Multiple (LCM) is the smallest positive number divisible by both. These concepts are fundamental in simplifying fractions and number theory.

  1. 1

    Enter First Number

    Input the first positive integer

  2. 2

    Enter Second Number

    Input the second positive integer

  3. 3

    Calculate GCD

    The calculator uses the Euclidean algorithm to find GCD

  4. 4

    Calculate LCM

    LCM is computed using: LCM = |a x b| / GCD

Use Cases

Simplifying Fractions

Divide numerator and denominator by their GCD to reduce fractions

Finding Common Denominators

Use LCM to find the least common denominator when adding fractions

Scheduling Problems

Determine when periodic events will coincide

Number Theory

Solve problems in algebra and cryptography

Tips

  • 1

    GCD is always less than or equal to the smaller number

  • 2

    LCM is always greater than or equal to the larger number

  • 3

    GCD(a,b) x LCM(a,b) = |a x b|

  • 4

    If GCD = 1, the numbers are coprime (relatively prime)

Common Mistakes

  • Confusing GCD and LCM - GCD divides the numbers, numbers divide LCM

  • Using GCD/LCM with negative numbers - always use absolute values

  • Assuming LCM = a x b always - this is only true when GCD = 1

  • Forgetting that GCD(a, 0) = a

Frequently Asked Questions

What is the Greatest Common Divisor (GCD)?
The GCD of two numbers is the largest positive integer that divides both without remainder. Example: GCD(12, 18) = 6.
What is the Least Common Multiple (LCM)?
The LCM is the smallest positive integer divisible by both numbers. Example: LCM(4, 6) = 12.
What is the Euclidean algorithm?
A method to find GCD: GCD(a,b) = GCD(b, a mod b), repeat until remainder is 0. Example: GCD(48,18) = GCD(18,12) = GCD(12,6) = GCD(6,0) = 6.
How are GCD and LCM related?
GCD(a,b) x LCM(a,b) = a x b. You can calculate one from the other.
What does coprime mean?
Two numbers are coprime if their GCD is 1, meaning they share no common factors. Example: 8 and 15 are coprime.

Support Our Project

Our site is completely free, you can support us to help us stay online and develop new tools.

Buy me a coffee