GCD & LCM Calculator
Enter two to six positive integers to see their GCD and LCM, Euclidean steps, prime factors and the reduced fraction for a pair.
Equal groups and shared schedules are different jobs
A teacher has 42 pencils and 56 erasers and wants the largest number of identical supply kits with nothing left over. The answer, 14 kits, comes from the GCD. If two maintenance checks repeat every 8 and 12 days, their next shared date is 24 days away; that is an LCM question. The same pair of operations handles division into equal groups and alignment of repeating cycles, but the required result is not interchangeable.
The greatest common divisor is the largest positive integer that divides every input exactly. The least common multiple is the smallest positive integer divisible by every input. For 12 and 18 those values are 6 and 36. This distinction matters more than spotting a familiar phrase: decide whether the unknown must divide the given numbers or be a multiple of them.
Remainders reveal the divisor without long factor lists
The Euclidean algorithm turns a large pair into smaller remainders. With 252 and 105, write 252 = 2 × 105 + 42, then 105 = 2 × 42 + 21 and finally 42 = 2 × 21. The last non-zero divisor is 21. A GCD calculator displays the same trail for the first two entries, which makes a wrong copied number easier to notice.
Prime factorisation provides an independent check. Since 72 = 2³ × 3² and 120 = 2³ × 3 × 5, take the shared primes at their lower powers: 2³ × 3 = 24. For an LCM, keep every prime that appears and use its highest power. One factor list can therefore support both calculations without treating GCD and LCM as the same quantity.
The multiple comes from the same number pair
For two positive integers, LCM(a,b) = a / GCD(a,b) × b. Dividing before multiplying limits the intermediate value; 12 / 6 × 18 gives 36. An LCM calculator can also confirm the result from prime powers. The identity GCD(a,b) × LCM(a,b) = a × b is useful for checking a pair, but it does not extend unchanged to the product of three or more inputs.
Lists, fractions and wording clues need separate checks
More than two values are processed one pair at a time. For 24, 36 and 60, first find GCD(24,36) = 12 and then GCD(12,60) = 12. The LCM follows the same reduction pattern. If one number divides another, as 8 divides 24, the smaller number is the GCD and the larger is the LCM.
- “Largest equal groups” or “longest equal pieces” usually asks for a common divisor.
- “First time together” or “smallest shared total” points to a common multiple.
- Reducing a fraction uses the GCD of its numerator and denominator.
These clues help with GCD and LCM problems, though the requested relationship is the final test. For 84/126, dividing both terms by 42 produces 2/3. If the GCD is 1, the fraction is already in lowest terms. Common denominators use an LCM instead: denominators 6 and 8 can first be rewritten over 24.
You may see this described as a “GCD LCM calculator tool”; use it to confirm the arithmetic after you have chosen the operation. This page accepts two to six positive integers from 1 to 999,999,999 and rejects zero, negatives, decimals and stray characters. It returns both values, Euclidean steps, prime factors and, for a pair, the reduced fraction.
Frequently Asked Questions About the GCD & LCM Calculator
GCD is the greatest positive integer dividing every input. LCM is the least positive integer divisible by every input. For 12 and 18, GCD is 6 and LCM is 36.
For finding the GCD, use the Euclidean algorithm: divide the larger number by the smaller and continue with the remainders. The last non-zero divisor is the result.
For two positive integers, use LCM(a,b) = a / GCD(a,b) × b. Finding the LCM by prime factors means taking every factor at its highest exponent.
Largest equal groups usually indicate GCD. First shared time, repeated cycles or the least shared total usually indicate LCM. Check whether a common divisor or multiple is required.
Couldn't find the answer you were looking for?
Explore all our tools and get the fastest answer to your question.