
LCM & GCF Calculator
Least common multiple and greatest common factor of two numbers.
GCF (greatest common factor)
6
LCM = 36
LCM
36
GCF
6
AI Breakdown & Smart Takeaway
Plain-English insight on your numbers
Get a personalized explanation of what these results mean — and how to improve them.
How the LCM & GCF Calculator works
The LCM & GCF Calculator instantly finds the Least Common Multiple and Greatest Common Factor of two numbers, making it an essential tool for students, teachers, and anyone working with fractions, ratios, or number theory problems.
The calculator uses two classical algorithms working in tandem. To find the Greatest Common Factor (GCF) — also called the Greatest Common Divisor (GCD) or Highest Common Factor (HCF) — it applies the Euclidean algorithm, one of the oldest and most efficient methods in mathematics. This algorithm repeatedly divides the larger number by the smaller, replacing the larger with the remainder, until the remainder reaches zero. The last non-zero remainder is the GCF. For example, to find the GCF of 48 and 18: 48 ÷ 18 = 2 remainder 12; 18 ÷ 12 = 1 remainder 6; 12 ÷ 6 = 2 remainder 0 — so the GCF is 6.
Once the GCF is known, the calculator derives the Least Common Multiple using the fundamental relationship between LCM and GCF: LCM(a, b) = (a × b) / GCF(a, b). This identity means the tool never needs to list all multiples of both numbers and search for the first overlap — an approach that would be slow for large numbers. Instead, a single division gives the exact LCM in one step. This is why the two results are calculated together so efficiently, and why understanding GCF is often the key to understanding LCM.
The size and prime structure of your input numbers are the main factors that shape the results. If two numbers share many prime factors (like 12 and 18, which both contain 2 and 3), their GCF will be large and their LCM will be relatively small compared to their product. If the numbers are coprime — sharing no common factor other than 1 — the GCF is 1 and the LCM equals their full product. This matters practically: when adding or subtracting fractions, you want the LCM of the denominators (the Least Common Denominator), and when simplifying fractions, you divide numerator and denominator by their GCF.
A common mistake is confusing LCM with GCF or assuming the LCM of two numbers is always their product. The LCM equals the product only when the GCF is 1 (i.e., the numbers are coprime). Another error is applying these operations to more than two numbers incorrectly — for three numbers, you should calculate GCF or LCM pairwise and then apply the operation again to the intermediate result. For instance, LCM(a, b, c) = LCM(LCM(a, b), c). This calculator focuses on two numbers, so for three or more, chain the calculations step by step.
Formula
LCM(a,b) = |a·b| / GCF(a,b)
Pro tips
- Use the GCF first to simplify fractions before performing any arithmetic — divide both numerator and denominator by their GCF to get the fraction in its lowest terms instantly.
- When adding or subtracting fractions with different denominators, enter the two denominators into this calculator to find the LCD (which is their LCM), saving you from trial-and-error.
- If the calculator returns a GCF of 1, your two numbers are coprime — this tells you immediately that the fraction formed by those numbers is already fully simplified and the LCM is simply their product.
- For word problems involving repeating events (e.g., two buses with different intervals arriving together), the LCM gives you the answer directly — just enter the two cycle lengths.
- Always double-check your inputs for typos on large numbers; a single wrong digit will produce a completely different GCF and LCM because the prime structure of the number changes entirely.
Key terms
- Least Common Multiple (LCM)
- — The smallest positive integer that is divisible by both of two given numbers without a remainder.
- Greatest Common Factor (GCF)
- — The largest positive integer that divides both of two given numbers evenly, also known as the Greatest Common Divisor (GCD) or Highest Common Factor (HCF).
- Euclidean Algorithm
- — An efficient method for computing the GCF by repeatedly replacing the larger number with the remainder of dividing the two numbers, until the remainder is zero.
- Coprime Numbers
- — Two numbers whose only common factor is 1, meaning their GCF equals 1 and their LCM equals their product.
- Prime Factorization
- — Expressing a number as a product of its prime factors, which provides an alternative method for finding both LCM and GCF by comparing shared and unique prime factors.
- Least Common Denominator (LCD)
- — The LCM of the denominators of two or more fractions, used to add or subtract fractions with unlike denominators.



