How to Calculate LCM
Find the Least Common Multiple of two or more numbers.
The Formula
LCM(a,b) = |a×b| / GCD(a,b)The lcm formula uses the mathematical relationship: LCM(a,b) = |a×b| / GCD(a,b). Each variable in the formula represents a measurable quantity that affects the final result.
What Each Variable Means
Every value in the lcm formula, what it measures, and the value used in the worked example on this page:
| Variable | Type | Example value |
|---|---|---|
| Number A | Input (you provide) | 12 |
| Number B | Input (you provide) | 18 |
| GCD (a, b) | Result (calculated) | — |
| LCM (a, b) | Result (calculated) | — |
Step-by-Step Method
- 1Write down the values you know: Number A, Number B.
- 2Substitute your known values into the formula: LCM(a,b) = |a×b| / GCD(a,b).
- 3Work through the arithmetic in the standard order of operations — parentheses first, then exponents, then multiplication and division, then addition and subtraction.
- 4Check that your result carries the correct unit and falls in a reasonable range for the problem.
- 5Verify your answer with the interactive LCM Calculator — it solves the same formula instantly.
Worked Example
Take a concrete case: number a = 6, with the other inputs at the typical values from the variables table above. Substituting into the formula gives gcd (a, b) = 6, lcm (a, b) = 18. These numbers are solved by the same engine that powers the LCM calculator, so you can reproduce them exactly by entering the same inputs there.
| Number A | GCD (a, b) | LCM (a, b) |
|---|---|---|
| 1 | 1 | 18 |
| 6 | 6 | 18 |
| 9 | 9 | 18 |
| 10 | 2 | 90 |
| 20 | 2 | 180 |
| 30 | 6 | 90 |
| 40 | 2 | 360 |
| 50 | 2 | 450 |
How each result changes as number a changes, holding the other inputs constant.
Practice Problems
1. 12 and 18: Given Number A 12, Number B 18, what does it come out to?
Answer: With Number A 12, Number B 18, the results are GCD (a, b) 6, LCM (a, b) 36.
2. You enter Number A 9, Number B 5 — what does the calculator return?
Answer: Entering Number A 9, Number B 5 gives GCD (a, b) 1, LCM (a, b) 45.
Frequently Asked Questions
What is the formula for lcm?
The formula is: LCM(a,b) = |a×b| / GCD(a,b). Find the Least Common Multiple of two or more numbers.
What values do I need to calculate lcm?
You need number a, number b. The calculator produces gcd (a, b), lcm (a, b) from those inputs.
What is the lcm when number a is 6?
With number a = 6, the result is gcd (a, b) = 6, lcm (a, b) = 18. This is worked through in full in the example on this page.
Related Topics
Use the Interactive Calculator
Skip the manual math — get instant results with our free LCM calculator.
