Skip to content
FiftyCalc Free calculators for all 50 states

LCM Calculator

Test cases replayed : 3 of 3 match · Methodology · No outside source listed

Enter two to four whole numbers to get their least common multiple.

Result

Sample figures

Least common multiple (LCM)—

Greatest common divisor (GCD) —

  • LCM ÷ first number—
  • LCM ÷ second number—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

LCM Calculator (Least Common Multiple)

First whole number: enter a number. Prefilled example: 12.

Second whole number: enter a number. Prefilled example: 18.

Third whole number (optional, 0 to leave out): enter a number. Prefilled example: 30.

Fourth whole number (optional, 0 to leave out): enter a number. Prefilled example: 0.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. First whole number: enter a number.
  2. Second whole number: enter a number.
  3. Third whole number (optional, 0 to leave out): enter a number.
  4. Fourth whole number (optional, 0 to leave out): enter a number.
  5. Read the result: Least common multiple (LCM); the panel also shows Greatest common divisor (GCD), LCM ÷ first number and LCM ÷ second number.

How this calculator works

For two numbers, lcm(a, b) = |a × b| ÷ gcd(a, b), where the greatest common divisor comes from Euclid's algorithm (Euclid's Elements, Book VII). For more numbers the rule is applied step by step: lcm(a, b, c) = lcm(lcm(a, b), c).

Decimals are rounded to the nearest whole number first. A zero in the third or fourth box is left out.

Worked example

First whole number12
Second whole number18
Third whole number (optional, 0 to leave out)30
Fourth whole number (optional, 0 to leave out)0
Least common multiple (LCM)180
Greatest common divisor (GCD)6
LCM ÷ first number15
LCM ÷ second number10

Frequently asked questions

What is the LCM of 12, 18 and 30?

180. It is the smallest number that 12, 18 and 30 all divide: 180 = 12 × 15 = 18 × 10 = 30 × 6.

What is the LCM of 4 and 6?

12, since gcd(4, 6) = 2 and 4 × 6 ÷ 2 = 12.

What is the LCM used for?

Finding a common denominator to add fractions, and working out when repeating cycles line up again.

Related calculators