Skip to content
CalculatorAtlas

LCM Calculator

Tested

Find the least common multiple (LCM).

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

Results

Enter your values and press Calculate. Results appear here.

  • • Result

Quick answer

The least common multiple (LCM) of two or more whole numbers is the smallest positive number that every one of them divides into. This calculator uses lcm(a, b) = a ÷ gcd(a, b) × b, applied pair by pair for longer lists: the LCM of 4 and 6 is 12.

Enter positive whole numbers separated by commas. Results above 9,007,199,254,740,991 (2^53 − 1) are rejected instead of being rounded, so every answer shown is exact.

Related tools: Slope Calculator: Slope, angle, distance and line equation through two points. Factor Calculator: List every factor of a positive whole number. Quadratic Formula Calculator: Solve ax² + bx + c = 0, including complex roots.

How to use the LCM Calculator

  1. Type numbers, for example 12, 18, 24.
  2. Press Calculate to see the result, and use Reset to start again.
Inputs of the LCM Calculator
InputWhat to enterAllowed values
NumbersText, such as 12, 18, 24—

Formula and method

Formula

lcm(a, b) = a ÷ gcd(a, b) × b

IEEE-754 double precision; shown to at most 6 decimal places.

Computed pairwise using the GCD; results above 2^53 are rejected rather than rounded.

Worked examples

These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.

Example 1

Inputs: Numbers = 4, 6.

Results of example 1
ResultValue
Least common multiple12

Example 2

Inputs: Numbers = 3, 5, 7.

Results of example 2
ResultValue
Least common multiple105

Example 3

Inputs: Numbers = 12, 18, 24.

Results of example 3
ResultValue
Least common multiple72

The first line is the headline result (least common multiple). IEEE-754 double precision; shown to at most 6 decimal places.

Three ways to find an LCM

Prime factorization: write each number as primes and take the highest power of each prime. 12 = 2² × 3 and 18 = 2 × 3², so the LCM is 2² × 3² = 36.

GCD shortcut: lcm(a, b) = a × b ÷ gcd(a, b). The greatest common divisor of 12 and 18 is 6, so the LCM is 12 × 18 ÷ 6 = 36. For more numbers apply it repeatedly: lcm(a, b, c) = lcm(lcm(a, b), c).

Listing multiples works for small numbers: the multiples of 4 are 4, 8, 12 and of 6 are 6, 12, so 12 is the first shared one.

Where an LCM is used

Adding fractions with different denominators uses the least common denominator, which is the LCM of the denominators: 1/4 + 1/6 needs 12 (see the fraction calculator). Scheduling uses it too: two events that repeat every 4 and every 6 days coincide every 12 days.

LCMs of sample lists

Every figure in this table comes from running this calculator, so it matches what the form returns.

LCMs of sample lists
NumbersLeast common multiple
4, 612
12, 1836
6, 8, 1224
7, 1391

What happens with invalid input

These messages are produced by the calculator itself, so you know what to fix.

  • Numbers: entering "4" shows "Enter at least 2 numbers." beside that field and no result.

Choosing between the LCM Calculator and similar calculators

Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.

Choosing between the LCM Calculator and similar calculators
CalculatorYou enterIt returns
[Slope Calculator](/math/slope-calculator/)x₁, y₁ and x₂Slope
[Factor Calculator](/math/factor-calculator/)numberFactors
[Quadratic Formula Calculator](/math/quadratic-formula-calculator/)a, b and cRoots
[Log Calculator](/math/log-calculator/)number x and base blog base 2 of 8
[GCF Calculator](/math/gcf-calculator/)numbersGreatest common factor

Background: algebra

Many algebra calculators rest on the same ideas: write the problem in a standard form, identify the coefficients, apply the formula and check the answer by substituting it back. For a quadratic ax² + bx + c = 0 the roots are (−b ± √(b² − 4ac)) ÷ 2a, and the discriminant b² − 4ac decides the kind of roots: positive gives two real roots, zero gives one repeated root and negative gives two complex conjugate roots.

If a = 0 the equation is linear, not quadratic. A sign slip on the −b term shifts both roots by the same amount, so substitute your roots back to check.

Assumptions and limitations

  • Results above 9,007,199,254,740,991 are rejected
  • Positive whole numbers only

If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for numbers to confirm this.

Frequently asked questions

What is the LCM of two prime numbers?

Their product, because primes share no factor other than 1. For example the LCM of 7 and 13 is 91.

What does the LCM Calculator calculate?

Least common multiple of two or more numbers. It returns Least common multiple.

What formula does the LCM Calculator use?

lcm(a, b) = a ÷ gcd(a, b) × b. Computed pairwise using the GCD; results above 2^53 are rejected rather than rounded.

What do I need to enter in the lCM Calculator?

You enter Numbers.

How is the result rounded or limited?

IEEE-754 double precision; shown to at most 6 decimal places. Results above 9,007,199,254,740,991 are rejected.

What are the limits of this calculator?

Results above 9,007,199,254,740,991 are rejected. Positive whole numbers only.

What is an example of a lCM result?

With numbers 4, 6, the least common multiple is 12.

Sources

  • OpenStax, Prealgebra 2e (Rice University): fractions, decimals, percents, ratios and rounding

Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.