Skip to calculator
lcmcalculator.co

LCM of Two Numbers Calculator

When you only have two numbers, you get access to the fastest shortcut in arithmetic: multiply the two numbers together and divide by their Greatest Common Factor. Enter your pair below to see the exact solution and every step.

Exact BigInt math
LCM of Two Numbers Result
LCM(12, 18) = 36
Greatest Common Factor: GCF(12, 18) = 6
Check the answer (every division leaves a remainder of 0):
36 ÷ 12 = 336 ÷ 18 = 2

Show the Working (Step-by-Step)

Switch method in one click:

Step 1: Break each number down into its prime factors.

Write each input as a product of prime numbers, then group matching primes with exponents.

12 = 2 × 2 × 3
= 2² × 3
18 = 2 × 3 × 3
= 2 × 3²

Step 2: For each prime, pick the highest exponent that appears in any single number.

PrimeIn 12In 18Highest Power
22²2¹2² = 4
33¹3²3² = 9

Step 3: Multiply those highest prime powers together to get the LCM.

LCM = 2² × 3² = 4 × 9 = 36

Three Instant Cases When Comparing Two Numbers

Before you even write down a factor tree for two numbers a and b, check which of these three buckets your pair falls into:

Case 1: One Divides the Other

If the larger number is a multiple of the smaller one—like —then GCF = 6 and LCM = 18. You are done in one second.

Case 2: No Shared Factors (GCF = 1)

If your two numbers are primes or consecutive integers—like —they share no factors greater than 1. Multiply them straight across: 7 × 8 = 56.

Case 3: Partial Overlap (GCF > 1)

For composites like , divide one number by their shared factor (15 ÷ 5 = 3) and multiply by the other (3 × 20 = 60).

Have a third number to include? Switch to the LCM of Three Numbers Calculator or our Main LCM Calculator (up to 10 numbers).