Maths & numbers

Least common multiple calculator

Find the smallest non-negative common multiple of two integers.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your numbers and select Calculate.

Behind the numbers

How this calculation works

The LCM uses the greatest common divisor to avoid unnecessary intermediate multiplication. If either input is zero, this tool returns zero by convention.

THE FORMULAlcm(a, b) = |a ÷ gcd(a, b) × b|

A worked example

The least common multiple of 12 and 18 is 36.

Good to know

Uses the stated formula and assumptions. Displayed decimal values are rounded; use consistent units for all inputs.

A little curiosity

Shared cycles meet at a common multiple

An event every 12 days and another every 18 days will next align after 36 days if they start together. Multiples of 12 include 12, 24 and 36; multiples of 18 include 18 and 36. Their first positive overlap is the least common multiple.

The GCD links this problem to divisibility: for positive integers, gcd(a, b) × lcm(a, b) = a × b. Dividing by the GCD before multiplying helps keep intermediate numbers smaller.

An LCM does not solve every scheduling problem

The cycle example assumes both events share the same starting point and continue at exact integer intervals. If their first occurrences are offset, the next meeting time needs those offsets as well; an LCM alone is not enough.

This tool returns zero if either input is zero, a common programming convention. It rejects results beyond the safe-integer range instead of pretending a rounded count is exact.

A few questions, answered

Can the LCM be smaller than an input?

For two positive integers, the LCM is at least as large as the larger input.

What if one number divides the other?

The larger positive number is already a multiple of both, so it is the LCM.

Find your calculator

Start typing to explore the library.