What this calculator does
Two whole numbers share factors and multiples, and the largest shared factor and smallest shared multiple are useful in fractions, scheduling, and ratio problems. This calculator finds both with the Euclidean algorithm, then shows the product check: for any two positive whole numbers, GCD x LCM equals the product. That identity is a quick way to catch an error. Fractions reduce with the GCD, and denominators combine with the LCM.
How to use it
- Enter the first whole number.
- Enter the second whole number.
- Read the greatest common divisor.
- Read the least common multiple.
- Check that GCD x LCM equals the product.
How it works
Example calculations
Example 1: 12 and 18
The largest shared divisor is 6, and the smallest shared multiple is 36. The check is 6 x 36 = 216, which equals 12 x 18.
Example 2: 24 and 36
The GCD is 12, so 12 divides both evenly. The LCM is 24 / 12 x 36 = 72. The check is 12 x 72 = 864, equal to 24 x 36.
Example 3: 7 and 13
Both are prime and share no factor except 1, so the GCD is 1 and the numbers are coprime. The LCM is 7 x 13 = 91, and the check is 1 x 91 = 91.
What the result means
The GCD answers how numbers can be split into equal groups, which is why it reduces fractions: divide the numerator and denominator by their GCD. The LCM answers when two repeating events line up, and it is the common denominator when adding fractions. The identity GCD x LCM = a x b holds for every pair of positive whole numbers, so it is a fast self-check: if the answers do not multiply to the product, one is wrong. The identity also explains why the LCM is the product when the numbers are coprime. Zero is excluded because every number divides zero.
Common mistakes
- Swapping the GCD and the LCM in the results.
- Assuming the LCM is always a x b, which is true only when the GCD is 1.
- Reducing a fraction with the LCM instead of the GCD.
- Entering decimals or negative numbers.
- Stopping the Euclidean algorithm before the remainder reaches zero.
Assumptions and limits
- Both inputs are positive whole numbers.
- The numbers are small enough to display exactly.
- Standard definitions of GCD and LCM are used.
- Zero and negative values are out of scope.
- The product check uses ordinary multiplication.
Frequently asked questions
What is the difference between GCD and LCM?
The GCD is the largest number that divides both inputs evenly. The LCM is the smallest number both inputs divide evenly. For 12 and 18, they are 6 and 36.
What does coprime mean?
Two numbers are coprime when their only shared factor is 1, so their GCD is 1. 7 and 13 are coprime, and their LCM is their product, 91.
Why does GCD x LCM equal the product?
Write both numbers as the GCD times coprime partners. The LCM is the GCD times those partners, so the results multiply back to the original product.
How does the Euclidean algorithm work?
Divide the larger number by the smaller and keep the remainder, then repeat with the smaller number and the remainder. The last nonzero remainder is the GCD.
Can I find the GCD or LCM of more than two numbers?
This page takes two at a time. For a list, repeat the process pairwise: the GCD of a running result, and the same for the LCM.
Why use the LCM for fractions?
The LCM of the denominators is the smallest common denominator, so adding or subtracting fractions needs the fewest conversions.
Sources
2026 update
How to use the professional output
This page is not just a formula box. The result is designed to be checked, compared, and taken away.
- Professional worksheet. The result includes the inputs used, the method and scope, and a one-variable sensitivity check for finance calculators.
- A/B scenarios. Save two input sets in the browser and compare the primary, secondary, and breakdown figures side by side.
- Print / PDF and CSV. Print a branded worksheet, or export the year-by-year table when the calculator produces one.
The formulas and assumptions above still govern the number. The worksheet makes the estimate auditable; it does not make it a lender quote, tax return, or personalized advice.
Go deeper
