GCF and LCM Calculator
Find the greatest common factor (also called GCD) and the least common multiple of two or more integers, and see each number’s prime factors.
Enter integers
Limits
- Whole numbers only, at most 20 at a time.
- Prime factorization is trial division for modest integers.
- Results are exact integers, not decimal approximations.
GCF, LCM, and factors
How to use GCF and LCM
- Type at least two integersSeparate them with commas or spaces. Up to 20 numbers.
- Read GCF and LCMGCF uses the Euclidean algorithm pairwise. LCM uses |a × b| / GCF(a, b).
- Check the factor tablePrime factors are found by trial division, which is intended for modest integers.
Limits and how it works
- Whole numbers only, at most 20 at a time.
- Prime factorization is trial division for modest integers.
- Results are exact integers, not decimal approximations.
How GCF and LCM are computed
The greatest common factor (also called GCD) is computed with the Euclidean algorithm: repeatedly replace (a, b) with (b, a mod b) until the remainder is 0. For more than two integers, GCF is reduced pairwise. The least common multiple uses LCM(a, b) = |a × b| / GCF(a, b), also reduced pairwise. Factorization is trial division and is meant for modest integers.
Frequently asked questions
What about 0?
GCF(0, n) is |n|. LCM(0, n) is 0.
Do negative numbers change the result?
Signs are ignored. GCF and LCM are reported as non-negative integers.
Is anything uploaded?
No. Nothing leaves your browser.
Related tools
All toolsFraction Calculator
Add, subtract, multiply and divide fractions, and convert decimals.
Percentage Calculator
Calculate percentages, percent change, discounts, and markups fast.
Scientific Calculator
Trigonometry, logs, factorials and expressions, in degrees or radians.
Average Calculator
Mean, median, mode and range, or a weighted average.