Compute the greatest common factor and least common multiple of 2 to 10 positive integers, with step-by-step Euclidean algorithm and prime factorization.
GCF / GCD
Greatest common factor
LCM
Least common multiple
Add at least 2 positive integers to see GCF and LCM.
Prime factorization
Euclidean algorithm (GCF step-by-step)
History
No saved calculations yet.
Frequently asked questions
The GCF (also called GCD or HCF) of two or more integers is the largest positive integer that divides each of them without a remainder. For example, GCF(12, 18) = 6 because 6 divides both 12 and 18 evenly, and no larger integer does. The calculator uses the Euclidean algorithm to compute it quickly for any list of numbers.
The LCM of two or more integers is the smallest positive integer that is a multiple of each of them. For example, LCM(4, 6) = 12 because 12 is the smallest number that both 4 and 6 divide evenly. LCM is especially useful when adding or subtracting fractions with different denominators.
For any two positive integers a and b, the product GCF(a, b) × LCM(a, b) equals a × b. For example, GCF(12, 18) = 6 and LCM(12, 18) = 36, so 6 × 36 = 216 = 12 × 18. This relation works only for pairs; for three or more numbers you need prime factorization.
Given two numbers a and b with a > b, replace a with the remainder of a divided by b, then swap the pair and repeat. Stop when the remainder is 0 — the last non-zero divisor is the GCF. Example for (48, 18): 48 mod 18 = 12, then 18 mod 12 = 6, then 12 mod 6 = 0, so GCF = 6.
Divide the numerator and denominator by their GCF. For 18/24, GCF(18, 24) = 6, so the simplified fraction is (18/6) / (24/6) = 3/4. A fraction is in lowest terms when the GCF of its numerator and denominator is 1.
Use LCM when you need a common denominator for fractions, when two cycles need to synchronize (for example, two buses departing every 15 and 20 minutes will meet again at LCM(15, 20) = 60 minutes), or when scheduling repeating events. Use GCF when simplifying fractions or dividing items into equal groups with no leftovers.
Calculations assume positive integers up to 1,000,000,000. Results are exact.
This calculator finds the greatest common factor (GCF, also called GCD) and the least common multiple (LCM) of up to ten positive integers in a single pass. Add numbers one at a time or paste a comma-separated list, then review the results with full working.
The GCF card shows the largest integer that divides every input evenly, computed with the Euclidean algorithm. The LCM card shows the smallest positive integer that each input divides, computed via prime factorization. Expand the Prime factorization section to see how each number decomposes into primes, with shared primes highlighted; expand the Euclidean algorithm section to walk through every division step.
Examples: GCF(12, 18) = 6 and LCM(12, 18) = 36, useful for simplifying 12/18 to 2/3. GCF(15, 25, 35) = 5 and LCM = 525. For any pair GCF(a,b) x LCM(a,b) = a x b.