GCF and LCM Calculator
Find the greatest common factor and least common multiple of 2–20 integers.
Content updated August 1, 2026
Signs are ignored because factors and multiples are reported as non-negative values. If any input is zero, the LCM is zero.
The greatest common factor is the largest non-negative integer that divides every entered value. The least common multiple is the smallest non-negative multiple shared by them.
Enter between two and twenty whole numbers. Signs are ignored for factor and multiple calculations, while zero follows the documented conventions shown with the results.
The GCF and LCM formula
gcd(a,b) = gcd(b, a mod b); lcm(a,b) = |a × b| ÷ gcd(a,b)Apply each pairwise formula across the list. The LCM is defined as zero when either paired value is zero.
Worked example
For 24, 36, and 60, pairwise Euclidean reduction gives GCF = 12. Pairwise least-common-multiple reduction gives LCM = 360.
Assumptions, rounding, and limitations
Assumptions
- Inputs are integers and signs are ignored.
- GCF and LCM are reported as non-negative integers.
- gcd(0, a) = |a|, gcd(0, 0) = 0, and any LCM containing zero is 0.
Rounding: No rounding occurs because parsing, division, remainder, GCF, and LCM operations use exact integer arithmetic.
Limitations
- Accepts 2–20 integers with at most 50 digits each.
- Stops when an LCM would exceed the 200-digit display limit and does not factor the inputs into primes.
Extending GCF and LCM across a list
The Euclidean algorithm repeatedly replaces a pair with the second number and their remainder until the remainder is zero. The last nonzero value is the pair's GCF.
For more than two inputs, calculate pair by pair: combine the first two, then combine that result with the next value. LCM uses |ab|/gcd(a,b) for nonzero pairs and becomes zero if any input is zero.
Frequently asked questions
▶What is the GCF of 24, 36, and 60?
The greatest common factor is 12 because 12 divides all three values and no larger positive integer does.
▶What is the LCM of 24, 36, and 60?
The least common multiple is 360, the smallest positive integer divisible by all three values.
▶Do negative signs affect GCF or LCM?
No. This calculator uses absolute values and reports non-negative factors and multiples.
▶What happens when an input is zero?
The LCM is zero if any input is zero. gcd(0, a) is |a|, and this calculator defines the all-zero list's GCF as zero.
Related calculators
Reduce one integer fraction to lowest terms and see its mixed-number and decimal forms.
Open calculator →Convert a finite decimal to an exact fraction in lowest terms without floating-point approximation.
Open calculator →Add, subtract, multiply, or divide two fractions and get the simplified result plus its decimal value.
Open calculator →Disclaimer: GCF and LCM Calculator results are estimates for general information and education only, and are not financial, tax, legal or medical advice. Verify important decisions with a qualified professional.