LCM Calculator Formula
Understand the math behind the lcm calculator. Each variable explained with a worked example.
Formulas Used
Lcm Val
lcm_val = abs(a * b) / gcd(a, b)Gcd Val
gcd_val = gcd(a, b)Product
product = a * bVariables
| Variable | Description | Default |
|---|---|---|
a | Number A | 12 |
b | Number B | 18 |
How It Works
Least Common Multiple (LCM)
Definition
The LCM of two numbers is the smallest positive integer that is divisible by both numbers.
Formula
LCM(a, b) = |a × b| / GCD(a, b)
Example
LCM(12, 18):
Worked Example
Find LCM(12, 18).
a = 12b = 18
- 01GCD(12, 18) = 6
- 02LCM = (12 × 18) / 6
- 03= 216 / 6
- 04= 36
Ready to run the numbers?
Open LCM Calculator