Calculators.Life Calculator
Math

Least Common Multiple (LCM) Calculator

Input Parameters

Scenarios
Enter the first positive integer.
Enter the second positive integer.
Enter an optional third positive integer (or leave 0).
Enter an optional fourth positive integer (or leave 0).

Computed Results

Least Common Multiple (LCM)
4,950
Greatest Common Factor (GCF / GCD)15

The least common multiple calculator determines the smallest positive integer that is evenly divisible by two, three, or four numbers. It also calculates the greatest common factor (GCF) for the provided values, making it easier to solve fraction operations, align schedules, or simplify mathematical expressions.

Practical Use Cases

Finding the least common multiple is a fundamental mathematical operation used in various practical scenarios. It is essential when adding or subtracting fractions with different denominators, as the LCM serves as the least common denominator. Additionally, the LCM helps determine when periodic events will coincide. For example, if two machines require maintenance on different schedules, the LCM indicates the next time both machines will need maintenance simultaneously.

Formula & Explanation

The calculator uses the relationship between the greatest common factor (GCF) and the least common multiple (LCM) to compute the result. For any two positive integers, a and b, the formula is:

LCM(a, b) = (a × b) ÷ GCF(a, b)

When calculating the LCM for three or four numbers, the calculator processes them sequentially. It first finds the LCM of the first two numbers, then finds the LCM of that result and the third number, and so on. The GCF is calculated using the Euclidean algorithm, which repeatedly divides the larger number by the smaller number until the remainder is zero.

Verified Scenario Walkthroughs

Here are examples of how the calculator processes different sets of numbers:

Two Small Prime Numbers

If you input 7 and 13 (leaving the third and fourth inputs as 0), the calculator determines the LCM is 91 and the GCF is 1. Because both numbers are prime, their LCM is simply their product (7 × 13).

Three Standard Composite Numbers

For the numbers 12, 18, and 24, the calculator finds an LCM of 72 and a GCF of 6. The number 72 is the smallest integer divisible by all three inputs.

Four Large Numbers with Common Factors

When evaluating 120, 240, 360, and 480, the LCM is 1440 and the GCF is 120. The visual chart will display the comparison between these two results.

Mixed Sequence with One Large Outlier

If the inputs are 5, 10, 20, and 1000, the LCM is 1000 and the GCF is 5. Since 1000 is a multiple of 5, 10, and 20, it serves as the least common multiple for the entire set.

How to Use the Calculator

Follow these steps to find the LCM and GCF:

  1. Enter your first positive integer into the "First Number" field.
  2. Enter your second positive integer into the "Second Number" field.
  3. If needed, enter a third positive integer. If you only have two numbers, leave this field as 0.
  4. If needed, enter a fourth positive integer. Leave as 0 if not applicable.
  5. Review the calculated Least Common Multiple (LCM) and Greatest Common Factor (GCF) in the results section.

Inputs & Outputs

The table below summarizes the data used and generated by the calculator.

FieldTypeDescription
First NumberInputThe first positive integer.
Second NumberInputThe second positive integer.
Third Number (Optional)InputAn optional third positive integer (leave as 0 if unused).
Fourth Number (Optional)InputAn optional fourth positive integer (leave as 0 if unused).
Least Common Multiple (LCM)OutputThe smallest positive integer divisible by all provided numbers.
Greatest Common Factor (GCF / GCD)OutputThe largest positive integer that divides all provided numbers evenly.

Frequently Asked Questions

What is the difference between LCM and GCF?

The least common multiple (LCM) is the smallest number that is a multiple of all the given numbers. The greatest common factor (GCF) is the largest number that divides evenly into all the given numbers.

Can I calculate the LCM for just two numbers?

Yes, simply enter your two numbers in the first and second fields, and leave the third and fourth fields as 0.

Why is the LCM of two prime numbers just their product?

Prime numbers have no common factors other than 1. Therefore, their greatest common factor (GCF) is 1, and according to the formula, their LCM is simply the product of the two numbers.

Author portrait
About the Author
Arnab Biswas

Calculator developer and SEO strategist who builds practical online calculators and tests calculation logic, input handling, and expected results using real-world scenarios.