GCD & LCM Calculator | FistHost Tools

Search Engine Optimization
  1. Home
  2. Math Tools
  3. GCD & LCM Calculator
Share: Report

GCD & LCM Calculator

100% free · Runs 100% in your browser · Step-by-step Euclidean algorithm · No signup needed

Greatest common divisor (GCD)—
Least common multiple (LCM)—

The GCD comes from the Euclidean algorithm: divide, take the remainder, and repeat with the remainder until it reaches zero — the last non-zero remainder is the GCD. LCM(a, b) = a × b / GCD(a, b). Example check: GCD(48, 180) = 12, and LCM(48, 180) = 48 × 180 / 12 = 720. Inputs are integers only — decimals and zero are refused rather than answered with an invented result.

Try an example: GCD and LCM of 48 and 180

About GCD & LCM Calculator

The GCD and LCM Calculator is a free online tool that finds the greatest common divisor and the least common multiple of two numbers in seconds. You type in two whole numbers, and the tool shows both answers together, along with the step-by-step working that produced them. It is built for students, teachers, programmers, and anyone who needs a quick, reliable answer to a fractions, ratio, or scheduling problem, and it runs entirely in your browser with no sign-up and no download.

The greatest common divisor, or GCD, is the largest whole number that divides both of your numbers exactly, with no remainder. It is also called the greatest common factor, and it is the number you need when you simplify a fraction, split a set of items into equal groups, or find the largest tile that fits two lengths exactly. The least common multiple, or LCM, is the smallest whole number that both of your numbers divide into exactly. It is the number you need when you add fractions with different denominators, line up repeating events, or find when two cycles meet again.

The tool finds the GCD using the Euclidean algorithm, a method that has been in use for more than two thousand years and is still the fastest reliable way to do the job by hand. The idea is simple: divide the larger number by the smaller one and keep the remainder, then divide the previous divisor by that remainder, and keep going until the remainder is zero. The last non-zero remainder is the GCD. Because the tool shows every division and every remainder, you can follow the logic yourself and use the same steps in an exam or homework answer.

Here is the worked example the tool uses. To find the GCD of 48 and 180, divide 180 by 48, which gives 3 with a remainder of 36. Then divide 48 by 36, which gives 1 with a remainder of 12. Then divide 36 by 12, which gives 3 with a remainder of 0. The last non-zero remainder is 12, so GCD(48, 180) = 12. The tool shows each of these steps in order, so the answer never appears from nowhere and you can check every line of working.

Once the GCD is known, the LCM follows from a simple formula: LCM(a, b) = a times b divided by GCD(a, b). Using the same worked example, LCM(48, 180) = 48 times 180 divided by 12, which is 8640 divided by 12, which equals 720. You can check this yourself, because 720 divided by 48 is 15 and 720 divided by 180 is 4, both whole numbers, and no smaller positive number is divisible by both. The tool shows this calculation too, so the link between the GCD and the LCM is clear.

The Euclidean algorithm is worth learning because it stays fast even with large numbers, where listing all the factors of each number would take far too long. Listing factors works for small numbers, but for numbers in the hundreds or thousands it becomes slow and error-prone. The Euclidean method cuts the numbers down quickly with each division, so even large inputs are solved in a handful of steps. That is why the same algorithm sits inside computer programs, cryptography, and fraction simplification routines all over the world.

Using the tool is straightforward. Type your first number into the first box and your second number into the second box, then press calculate. The tool instantly shows the GCD and the LCM, plus the full step-by-step Euclidean remainders and the LCM formula with your own numbers filled in. The two-number input covers the most common cases, and the design can be extended to a list of numbers, where the GCD of a list is found by applying the same method pair by pair. You can recalculate as often as you like, which makes it easy to test examples from a textbook or check homework answers.

The tool is honest about what it accepts. Inputs are integers only, so the tool refuses decimals and zero rather than inventing a result. A greatest common divisor of a decimal is not defined in the usual sense, and a GCD involving zero needs special handling that would confuse more than it helps, so the tool asks you to enter two positive whole numbers instead. If you type a decimal, a negative number, or a zero, you will see a clear warning explaining the problem, and you can correct the input and try again.

The GCD and LCM show up in more places than most people realise. When you simplify a fraction, you divide the top and bottom by their GCD. When you add fractions, the LCM of the denominators gives you the common denominator. When two buses leave on different schedules, the LCM of their intervals tells you when they next leave together. When you cut a length of wood or fabric into equal pieces with no waste, the GCD tells you the largest piece size that works. Programmers use the same ideas to reduce ratios, schedule tasks, and work with repeating patterns in code.

Students get the most from the tool by using it to check, not to replace, their own working. Try the problem on paper first, then enter the same numbers and compare your steps with the tool step by step. If your remainder differs at some line, that is where the error is, and you can fix it and move on. Teachers can use the tool to generate worked examples for the classroom, and parents can use it to help with homework without guessing at the method. The step-by-step display turns a bare answer into a lesson.

Another way to understand the two ideas is through prime factors. Every whole number can be broken into prime factors, and the GCD takes the lowest power of each prime shared by both numbers, while the LCM takes the highest power of each prime that appears in either number. For 48, the prime factors are 2 to the power of 4 times 3, and for 180 they are 2 squared times 3 squared times 5. The shared primes give a GCD of 2 squared times 3, which is 12, and the highest powers give an LCM of 2 to the power of 4 times 3 squared times 5, which is 720. The Euclidean method reaches the same answers faster, but the prime factor view explains why the answers are what they are, and it is a useful check when you are learning the topic for the first time.

While you are here, take a moment to look at what FistHost can do for your own website. FistHost shared hosting starts from just $0.99/month, which makes it easy to put a blog, a business site, or a personal project online without a large upfront cost. Every plan comes with the tools you need to get started quickly, including one-click installs for popular platforms, free SSL security, and friendly support when you need a hand. The annual plan also includes a free domain, so your site can have a proper address from day one without paying extra for the name.

Starting a website with FistHost is straightforward even if you have never done it before. Pick a plan, choose your free domain with the annual plan, and you can have a site live the same day for only $0.99/month to begin. FistHost shared hosting is built for speed and reliability, so your pages load quickly for visitors on any device. Whether you want a maths tutoring blog, a homework help site, or a small business page, FistHost gives you an affordable home for it, with a free domain included when you choose the annual plan.

To keep working with numbers, try the Fraction Calculator to add, subtract, multiply, and divide fractions with simplification, and the Percentage Calculator for quick percentage problems. Both tools are free, run in your browser, and pair naturally with the GCD and LCM, because simplifying fractions and finding common denominators is exactly where these answers get used most.

User Reviews

No reviews yet. Be the first to review this tool!

Write a Review

★★★★★

Captcha

Reviews are protected by captcha and moderated before they appear.


Pro

Built for Creators

Fast hosting for blogs,
stores and portfolios

Create Now
FistHost Blazing-Fast Web Hosting Plans from $0.99/mo · Free domain included Get Hosting