GCD & LCM Calculator

Find the Greatest Common Divisor and Least Common Multiple of two numbers instantly. A perfect utility for math homework, proportions, and coding algorithms.

GCD (Divisor)

6

LCM (Multiple)

36

Formula Relationship: The product of two numbers is equal to the product of their GCD and LCM.
12 × 18 = 6 × 36 = 216

About the GCD & LCM Calculator

Enter two whole numbers to get their GCD (also called HCF) and LCM instantly, with the rule that links the two.

Everything you enter is processed in your browser; nothing is uploaded or stored.

How to use it

  1. Enter the first number.
  2. Enter the second number.
  3. Read the GCD (HCF) and the LCM.

How GCD/HCF and LCM are calculated

The GCD uses Euclid’s algorithm: replace the larger number by the remainder of dividing it by the smaller, and repeat until the remainder is 0. The last non-zero number is the GCD.

LCM(a, b) = (a × b) ÷ GCD(a, b)

This works because the product of two numbers always equals the product of their GCD and LCM.

Example

For 84 and 36: 84 ÷ 36 leaves 12, 36 ÷ 12 leaves 0, so GCD (HCF) = 12. LCM = 84 × 36 ÷ 12 = 252. Check: 12 × 252 = 3,024 = 84 × 36.

Tips

  • For three numbers, find the HCF of the first two, then the HCF of that result and the third (the same works for LCM).
  • If the HCF is 1 the numbers are co-prime, and their LCM is simply their product.

Frequently asked questions

Is HCF the same as GCD?

Yes. HCF (highest common factor) and GCD (greatest common divisor) are two names for the same number.

How do I find the LCM of two numbers?

Divide their product by their HCF: LCM(12, 18) = 216 ÷ 6 = 36.

Where is LCM used?

Adding fractions (common denominators), and problems like when two bells ringing at different intervals ring together again.