1. Home
  2. Everyday math
  3. Least Common Multiple Calculator
Everyday math

Least Common Multiple Calculator

Find the smallest common multiple of two whole numbers.

Your numbers

Results update as you type. Nothing you enter is sent anywhere.

Result

36

LCM = (a ÷ gcd(a,b)) × b; zero if either value is zero. Non-negative safe integers; result must also be a safe integer.

Formula used

LCM = (a ÷ gcd(a,b)) × b; zero if either value is zero

The least common multiple of two whole numbers is the smallest number both divide into evenly. You need it to find a common denominator when adding fractions, to work out when two repeating schedules line up, and in gear and pattern problems. Enter two non-negative integers and the calculator returns their LCM.

How to use the Least Common Multiple calculator

  1. Enter the two whole numbers in First integer and Second integer. Decimals and negative numbers are not accepted.
  2. If either number is 0, the calculator returns 0, following the usual convention in number theory.
  3. Read the LCM. To find the LCM of three numbers, take the LCM of the first two, then the LCM of that answer and the third.

How the least common multiple calculation works

FormulaLCM = (a ÷ gcd(a,b)) × b; zero if either value is zero

How the calculator finds it

Listing multiples works for small numbers: multiples of 15 are 15, 30, 45, 60…, multiples of 20 are 20, 40, 60…, and 60 is the first match. It becomes slow for numbers like 1,386 and 2,145. The calculator instead uses the identity LCM(a, b) = a × b ÷ GCD(a, b), finding the greatest common divisor with Euclid's algorithm.

It divides before multiplying, computing (a ÷ GCD) × b, so intermediate values stay small. If the final LCM is larger than about 9 quadrillion, the largest integer a browser stores exactly, you get an error instead of a rounded result.

Prime factorization method

Teachers often ask for the factor-tree approach. Break each number into primes, then take every prime at its highest power. For 12 = 2² × 3 and 18 = 2 × 3², the LCM is 2² × 3² = 36. Matching your factor-tree answer with the calculator is a quick way to catch a missed factor.

A useful shortcut: if two numbers share no common factor other than 1, their LCM is simply their product. The LCM of 8 and 15 is 120, because 8 = 2³ and 15 = 3 × 5 have no prime in common.

Worked example

When do buses every 15 and 20 minutes leave together again?

First integer: 15 · Second integer: 20

  1. GCD by Euclid: 20 mod 15 = 5, then 15 mod 5 = 0, so GCD = 5.
  2. Divide first: 15 ÷ 5 = 3.
  3. Multiply by the other number: 3 × 20 = 60.
  4. If both leave at 8:00, the next shared departure is 60 minutes later, at 9:00.

Result: 60

Assumptions and limits

Non-negative safe integers; result must also be a safe integer.

Formula and worked examples last checked November 20, 2026. Spotted a problem? Report an error.

Frequently asked questions

What is the LCM of 6 and 8?

The LCM is 24. Multiples of 8 are 8, 16, 24, and 24 is the first one that 6 also divides. Using the formula, 6 × 8 ÷ GCD(6, 8) = 48 ÷ 2 = 24.

What is the difference between LCM and GCD?

The GCD is the largest number that divides both values, and the LCM is the smallest number both values divide into. For 12 and 18, the GCD is 6 and the LCM is 36. Their product always equals the product of the two numbers: 6 × 36 = 12 × 18 = 216.

How is the LCM used to add fractions?

The LCM of the denominators is the least common denominator. For 5/12 + 7/18, the LCM of 12 and 18 is 36, so rewrite as 15/36 + 14/36 = 29/36. The Fraction Calculator does the addition directly.

How do I find the LCM of three numbers?

Work in pairs. For 4, 6 and 10: LCM(4, 6) = 12, then LCM(12, 10) = 60. Enter the pairs here one after the other.

Sources