LCM & GCF Calculator
Find the least common multiple and greatest common factor of up to 50 integers, with exact arithmetic and Euclidean steps.
Your result
About this tool
Find the greatest common factor and least common multiple of a list of integers. Exact integer arithmetic preserves large results, while each pairwise step shows how the answer was obtained.
How the calculation works
GCF(a,b) uses repeated Euclidean divisions until the remainder is zero. LCM(a,b) = |a / GCF(a,b) × b| for nonzero inputs. Fold both operations across the list.
Worked example
For 12, 18 and 30, the GCF is 6 and the LCM is 180. For 12 and 18: 18 = 1 × 12 + 6; 12 = 2 × 6 + 0.
Find LCM and GCF using prime factors
For 12, 18 and 30, write each number as a product of primes: 12 = 2² × 3, 18 = 2 × 3² and 30 = 2 × 3 × 5.
The greatest common factor uses only primes that appear in every number, at their lowest shared powers. All three contain 2 and 3 at least once, so the GCF is 2 × 3 = 6.
The least common multiple uses the highest power of each prime found anywhere in the list. Keep 2² from 12, 3² from 18 and 5 from 30. Their product is 180, which is divisible by all three numbers.
Find the least common multiple with the ladder method
Start with 12, 18 and 30 in one row. Choose a prime divisor that divides at least one entry. Divide the entries it divides evenly and copy the others to the next row.
Divide by 2 to get 6, 9, 15, then by 2 again to get 3, 9, 15. Divide by 3 to get 1, 3, 5, then by 3 again to get 1, 1, 5. Divide by 5 to finish at 1, 1, 1.
Multiply the divisors used: 2 × 2 × 3 × 3 × 5 = 180. The ladder keeps the prime factors needed across all inputs. Use positive integers for this method.
Is LCM the same as the lowest common factor?
No. For positive integers, 1 is always a common factor and is the smallest positive common factor. LCM means least common multiple. GCF, also called HCF or GCD, means greatest common factor. For 12 and 18, the GCF is 6 and the LCM is 36.
When do repeating events line up?
If one event repeats every 6 days and another every 8 days, enter 6 and 8. Their LCM is 24, so they coincide again after 24 days when they start together. Use the same time unit; different start offsets require additional reasoning and are not solved by LCM alone.
How many equal groups can I make?
For 24 red items and 36 blue items, the GCF is 12. You can make 12 identical groups with 2 red and 3 blue items in each, using every item. Dividing both counts by 12 also reduces the red-to-blue ratio from 24:36 to 2:3. LCM gives the smallest positive total divisible by each input.
Find the least common denominator of fractions
Choose Least common denominator of fractions and enter values directly, such as 1/6, 2/8 and 3/4. The least common multiple of 6, 8 and 4 is 24. Multiply each numerator and denominator by the same factor to get 4/24, 6/24 and 18/24.
If you simplify 2/8 to 1/4 first, the denominators become 6, 4 and 4. Their least common multiple is 12, giving 2/12, 3/12 and 9/12. Both sets of fractions represent the same values.
Assumptions and limitations
Enter 2–50 integers with at most 30 digits each. Signs are ignored. GCF(0,0) and an all-zero list return 0; any zero makes the LCM 0. No floating-point rounding is used.
LCM helps find common denominators and repeating schedules; GCF helps divide quantities into equal groups. This is distinct from simplifying a two-part ratio.
Sources and editorial responsibility
Maintained by Renvoro Pty Ltd. Sources inform the methods and assumptions shown here; outputs have the limitations described on this page.
Common questions
What is the difference between LCM and GCF?
The greatest common factor divides every input. For nonzero inputs, the least common multiple is the smallest positive number divisible by all of them. For 12 and 18, the GCF is 6 and the LCM is 36.
Do negative signs change LCM or GCF?
This calculator uses absolute values. For example, −12 and 18 give the same answers as 12 and 18.
What happens when one input is zero?
This tool returns zero for the LCM. For the GCF, a zero leaves the factors of the other values unchanged. If all values are zero, the tool returns zero for both.
Guide updated 2026-11-21. Calculation method and source dates remain separate.
Method reviewed 2026-10-13. Calculation standards · Report an issue