LCM / GCD Calculator

Enter two whole numbers. For example, 12 and 18 give GCD 6 and LCM 36.

Whole numbers only (1, 2, 3 …)

Whole numbers only (1, 2, 3 …)

Result

LCM 36 · GCD 6

GCD
6
LCM
36

GCD of 12 and 18 is 6; LCM is 36.

How this was calculated
  1. By Euclid, GCD(12, 18) = 6; LCM = 12 × 18 ÷ 6 = 36

How to use

  1. Enter two whole numbers.
  2. See the GCD and LCM together.

Formulas

What Formula Example
GCD Euclid’s method GCD(12, 18) = 6
LCM a × b ÷ GCD 12 × 18 ÷ 6 = 36

Examples

12 and 18: GCD 6, LCM 36.

5 and 7: GCD 1, LCM 35.

More: where they are used

LCM aligns denominators when adding fractions; GCD simplifies them. LCM also tells when repeating events coincide.

Frequently asked questions

What are LCM and GCD?

GCD is the largest number dividing both; LCM is the smallest multiple of both. For 12 and 18, GCD is 6 and LCM is 36.

What is the formula?

LCM = (a × b) ÷ GCD. GCD comes from Euclid's method with remainders.

Do fractions work?

No — enter positive whole numbers only.

What is the LCM of two primes?

For two primes the GCD is 1 and the LCM is their product. For 5 and 7: GCD 1, LCM 35.

How does GCD simplify a fraction?

Divide the numerator and denominator by the GCD. For 12/18 the GCD is 6, so it simplifies to 2/3.

Also searched as

lcm gcd finder · least common multiple