LCM & GCF Calculator — Least Common Multiple & Greatest Common Factor
Enter two or more positive whole numbers to instantly find both their Least Common Multiple (LCM) and Greatest Common Factor (GCF).
🔢 Enter Whole Numbers
fa-chart-simple Result
Disclaimer: This tool performs standard mathematical calculations for educational and reference purposes. Always double-check results independently for graded coursework, exams, or safety-critical applications.
LCM and GCF Explained
The Greatest Common Factor (GCF) — also called the Greatest Common Divisor (GCD) — is the largest number that divides evenly into all of your input numbers. The Least Common Multiple (LCM) is the smallest number that all your input numbers divide into evenly. They're two sides of the same coin and both come up constantly when simplifying fractions, finding common denominators, and scheduling repeating events.
How This Calculator Solves It
GCF is computed using the Euclidean algorithm (repeated division with remainder), which is far faster than listing every factor for large numbers. LCM is then derived from GCF using the identity LCM(a,b) = |a × b| / GCF(a,b), extended across all your numbers pairwise.
Worked Example
Find the LCM and GCF of 12, 18, and 24.
- Step 1 — GCF: GCF(12,18) = 6, then GCF(6,24) = 6, so the overall GCF = 6
- Step 2 — LCM: LCM(12,18) = 36, then LCM(36,24) = 72, so the overall LCM = 72
A Second Worked Example: Four Numbers and a Coprime Pair
Enter 14, 21, 35, 70. The calculator folds the numbers together one pair at a time. The GCF is 7, because 7 divides every one of them and nothing larger does. The LCM is 210: LCM(14,21) = 42, LCM(42,35) = 210, and LCM(210,70) = 210. A quick check confirms it, since 210 ÷ 14 = 15, 210 ÷ 21 = 10, 210 ÷ 35 = 6 and 210 ÷ 70 = 3, all whole numbers.
Now try 15, 28. These share no factor other than 1, so the GCF is 1 and the LCM is simply their product, 420. Numbers like these are called coprime. Also try 8, 12, 20: the GCF is 4 and the LCM is 120.
Common Mistakes
- Mixing up the two answers. GCF can never be larger than the smallest input, and LCM can never be smaller than the largest. If your result breaks either rule, you have swapped them.
- Entering decimals, zero or negative numbers. The tool accepts only positive whole numbers, so convert fractions first (for example, work with 25 and 40 rather than 2.5 and 4.0).
- Multiplying all the numbers to get a common multiple. That does give a common multiple, but usually not the least one. For 14, 21, 35 and 70 the product is over 1.4 million, while the true LCM is 210.
- Using the shortcut LCM = product ÷ GCF with three or more numbers. The identity holds for two numbers only. For larger sets you must apply it pairwise, as the calculator does.
- Separating numbers with the wrong characters. Use commas or spaces. A stray letter makes the entry invalid.
Where You Would Use This
- Fractions: using the LCM of the denominators as a common denominator, and the GCF to reduce a fraction to lowest terms.
- Scheduling: finding when buses that run every 12 and 18 minutes next leave together.
- Cutting and tiling: choosing the largest equal square size that fits a 120 cm by 84 cm sheet without waste (the GCF is 12).
- Homework and exam checks: confirming a hand-worked factorisation.