The LCM & GCF calculator above finds both the least common multiple and the greatest common factor (also called the highest common factor, or HCF) for two or more numbers at once. Add as many numbers as you need, and the tool shows its work using two different methods β prime factorization and the Euclidean algorithm β so you can see exactly how each answer was reached, not just the final number.
LCM and GCF are two of the most practically useful ideas in elementary number theory: one tells you the smallest number that all your inputs divide into evenly, and the other tells you the largest number that divides evenly into all of them. Arb Digital built this calculator as part of a free set of study tools so you can check homework, plan schedules, or simplify fractions without redoing the arithmetic by hand every time.
What This LCM & GCF Calculator Does
Enter two or more whole numbers β use the "Add Another Number" button if you need more than two β and the calculator returns both values at once. The Least Common Multiple (LCM) is the smallest positive number that every one of your inputs divides into evenly. The Greatest Common Factor (GCF), also known as the Greatest Common Divisor (GCD) or Highest Common Factor (HCF) depending on which textbook you use, is the largest positive number that divides evenly into every one of your inputs. The tool shows both the prime-factorization approach and the Euclidean algorithm approach for the GCF, plus a verification check confirming that for two numbers, LCM Γ GCF equals the product of those two numbers.
How to Use It
- Enter your first two numbers. Whole positive numbers only β LCM and GCF are defined for positive integers.
- Add more numbers if needed. Click "+ Add Another Number" as many times as necessary; the tool handles any amount of inputs, not just two.
- Click Calculate. The headline result shows the LCM, and the boxes below show the GCF, the product of all your numbers, a verification figure, and how many numbers you entered.
- Read the sub-line for a plain-language summary of both results together.
- Use the explanation sections below to see the prime-factorization breakdown and the Euclidean algorithm steps in detail for your specific numbers' method.
Method 1: The Prime-Factorization Approach
The most intuitive way to find both LCM and GCF is to break every number down into its prime factors first. Take 48 and 18: 48 = 2β΄ Γ 3, and 18 = 2 Γ 3Β². Once you have both factorizations, the GCF is found by taking the lowest power of every prime that appears in both lists β here, the lowest power of 2 shared is 2ΒΉ (since 18 only has one factor of 2), and the lowest power of 3 shared is 3ΒΉ (since 48 only has one factor of 3). Multiplying those together, 2 Γ 3 = 6, gives GCF(48, 18) = 6.
The LCM works the opposite way: take the highest power of every prime that appears in either list. Here that's 2β΄ (from 48) and 3Β² (from 18), so LCM = 2β΄ Γ 3Β² = 16 Γ 9 = 144. This method extends cleanly to three or more numbers β you just compare the lowest (for GCF) or highest (for LCM) power of each prime across every number's factorization at once, rather than combining them two at a time. For a formal reference on these definitions, Math Is Fun's LCM explainer is a clear, reliable source.
Method 2: The Euclidean Algorithm (Faster for GCF)
The prime-factorization method is easy to follow, but factoring large numbers by hand gets slow. The Euclidean algorithm, one of the oldest algorithms in mathematics, finds the GCF directly without ever factoring anything, using a simple repeated-division rule: GCF(a, b) = GCF(b, a mod b), repeated until the remainder is 0 β at which point the GCF is whatever number you divided by last.
Walking through 48 and 18: divide 48 by 18, giving a quotient of 2 and a remainder of 12 (48 = 18Γ2 + 12). Now repeat with 18 and 12: 18 = 12Γ1 + 6. Repeat again with 12 and 6: 12 = 6Γ2 + 0. The remainder is now 0, so the algorithm stops, and the GCF is the last non-zero remainder, which was 6 β matching the answer from prime factorization. Once you have the GCF, the LCM follows immediately from the identity LCM(a, b) = (a Γ b) / GCF(a, b), so LCM(48, 18) = (48 Γ 18) / 6 = 864 / 6 = 144, again matching. The Euclidean algorithm's real advantage shows up with large numbers, where factoring by hand is impractical but repeated division stays fast β it's the method computers actually use internally, as documented in resources like the Khan Academy's explanation of the Euclidean algorithm.
Where Each Method Is Used in Real Life
LCM and GCF aren't just classroom exercises β both show up constantly in practical problems once you know to look for them. Fractions are the most common: to add or subtract fractions with different denominators, you need a common denominator, and the LCM of the denominators gives you the smallest one, avoiding messy oversized numbers. To simplify a fraction to lowest terms, you divide both the numerator and denominator by their GCF β for example, 48/18 simplifies to 8/3 by dividing both by their GCF of 6.
Scheduling problems lean on LCM heavily: if one event repeats every 4 days and another every 6 days, they'll next coincide on day LCM(4, 6) = 12 β this is exactly how transit planners, shift schedulers, and even traffic-light timing systems figure out when repeating cycles will align again. Gear ratios and mechanical design use GCF and LCM together: engineers designing gear trains often need the GCF to reduce a ratio to its simplest form, and the LCM to determine how many rotations must occur before two gears return to their starting alignment β a detail that affects wear patterns and noise in real mechanical systems.
- Adding and subtracting fractions (LCM of denominators)
- Simplifying fractions and ratios to lowest terms (GCF)
- Scheduling recurring events that must eventually align (LCM)
- Gear ratio design and rotational alignment problems (both)
- Dividing items into equal groups with no leftovers (GCF)
- Cryptography-adjacent number theory coursework (Euclidean algorithm)
GCF vs. HCF vs. GCD β Same Idea, Different Names
If you've seen "HCF" (Highest Common Factor) in one textbook and "GCD" (Greatest Common Divisor) in another, don't worry β they're all exactly the same concept as GCF, just named differently depending on the region or curriculum. British and some Commonwealth math courses tend to favor "HCF," American courses often use "GCF," and more advanced or computer-science-oriented material tends to use "GCD." This calculator treats all three as identical and interchangeable, since mathematically there's no difference at all.
Arb Digital builds fast, high-converting websites and content β from calculator tools like this one to complete marketing sites. If you want something similar built for your business, reach out.
Talk to Arb Digital All Free ToolsExtending Both Methods to Three or More Numbers
Everything above works cleanly for two numbers, but real problems often involve three, four, or more. For prime factorization, the principle doesn't change: list every prime that appears in any of the numbers, then take the lowest shared power across all of them for the GCF, or the highest power appearing anywhere for the LCM. For example, with 12, 18, and 30 β factored as 2Β²Γ3, 2Γ3Β², and 2Γ3Γ5 β the GCF takes the lowest power of each prime present in every number (2ΒΉ and 3ΒΉ, since 5 isn't in all three), giving GCF = 6, while the LCM takes the highest power seen anywhere (2Β², 3Β², and 5ΒΉ), giving LCM = 180.
The Euclidean algorithm extends differently: since it's fundamentally a two-number method, you apply it pairwise and carry the result forward. To get the GCF of three numbers, first find GCF(a, b), then find GCF of that result with c β the order of the numbers doesn't affect the final answer. LCM works the same way in reverse, chaining LCM(a, b) with c. This calculator automates that chaining internally so you never have to track intermediate results by hand, no matter how many numbers you add.
Common Mistakes to Avoid
- Confusing LCM and GCF. LCM is always the same size or larger than your biggest input; GCF is always the same size or smaller than your smallest input. If your answer breaks that rule, something went wrong.
- Forgetting a shared prime factor. When comparing factorizations by hand, it's easy to miss a prime that appears in both numbers with different exponents β always list every prime present in either number, using an exponent of zero where it's absent.
- Applying the two-number LCM formula to three or more numbers directly. LCM(a,b) = (aΓb)/GCF(a,b) only works for exactly two numbers at a time; for three or more, you must combine them pairwise (LCM of the first two, then LCM of that result with the third) or use full prime factorization across all numbers at once.
- Stopping the Euclidean algorithm too early. Keep dividing until the remainder is exactly 0 β the GCF is the last non-zero remainder, not the first small number you happen to see.
- Using 0 as an input. LCM and GCF are defined for positive whole numbers; 0 doesn't fit the standard definitions and will produce meaningless results.
Related Free Tools From Arb Digital
This calculator pairs naturally with the Fraction Calculator, since finding a common denominator relies directly on LCM. The Prime Number Checker is useful if you want to verify the factorizations used here, and the Factorial Calculator covers a related area of number theory. For rounding needs, see the Significant Figures Calculator, and for chance-based problems, try the Probability Calculator. You can also check the Mean, Median & Mode Calculator or browse our full free online tools hub.
Frequently Asked Questions
LCM (Least Common Multiple) is the smallest number that all your inputs divide into evenly. GCF (Greatest Common Factor) is the largest number that divides evenly into all your inputs. LCM is always at least as large as your biggest input; GCF is always at most as large as your smallest input.
GCF is also called HCF (Highest Common Factor) or GCD (Greatest Common Divisor). These are all the same concept, just named differently depending on region or curriculum.
Break each number into its prime factors, then take the highest power of every prime that appears in any of the numbers, and multiply those together.
It's a fast method for finding the GCF of two numbers by repeated division: divide the larger by the smaller, then repeat using the smaller number and the remainder, until the remainder reaches 0. The last non-zero remainder is the GCF.
LCM is used to find common denominators when adding fractions, to schedule recurring events so they align again, and in gear ratio and rotational alignment calculations in mechanical design.
Yes. This calculator supports any number of inputs by comparing prime factorizations across all of them at once, taking the highest shared powers for LCM and the lowest shared powers for GCF.
This tool runs entirely in your browser using built-in JavaScript. Nothing you enter is uploaded, stored, or sent to any server.