The formula: LCM = (a × b) ÷ GCF
For 12 and 18, the GCF is 6 (found via the Euclidean algorithm). The LCM is (12 × 18) ÷ 6 = 216 ÷ 6 = 36 — the smallest number that both 12 and 18 divide into evenly.
A second example
For 8 and 12, the GCF is 4, so the LCM is (8 × 12) ÷ 4 = 96 ÷ 4 = 24.
Why the LCM formula depends on the GCF
The formula works because any common multiple must be divisible by everything both numbers share — dividing out that shared part (the GCF) before multiplying avoids double-counting it. This is why LCM and GCF are always computed together rather than independently — one formula naturally produces both.