GCF and LCM Calculator

Reviewed by CalcMulti Editorial Team·Last updated: ·Algebra Hub

The Greatest Common Factor (GCF) — also called the Greatest Common Divisor (GCD) or Highest Common Factor (HCF) — is the largest positive integer that divides all the given numbers without a remainder. The Least Common Multiple (LCM) is the smallest positive integer that is divisible by all the given numbers.

This calculator finds the GCF and LCM of 2 or 3 integers using both prime factorization and the Euclidean algorithm. Each step of the working is shown so you can learn the method and reproduce it by hand.

GCF and LCM are connected by the formula: GCF(a, b) × LCM(a, b) = a × b. This means once you find the GCF, you can compute LCM = (a × b) / GCF without a separate calculation. For three numbers, find GCF(GCF(a, b), c) and LCM(LCM(a, b), c) by applying the pairwise formula twice.

Real-world uses: GCF simplifies fractions to lowest terms (divide numerator and denominator by GCF). LCM finds the common denominator when adding or subtracting fractions. GCF also solves tiling problems (largest square tile that fits a rectangle) and scheduling problems (next time two repeating events coincide). Both operations are foundational in number theory and form the basis of the Euclidean algorithm, one of the oldest algorithms in mathematics.

Formula

GCF(a,b) × LCM(a,b) = a × b | Euclidean: GCF(a,b) = GCF(b, a mod b)

GCF
Greatest Common Factor — largest divisor of all given numbers
LCM
Least Common Multiple — smallest multiple of all given numbers
a mod b
remainder when a is divided by b

GCF and LCM Calculator

Enter 2 or 3 positive integers.

GCF and LCM Examples

abGCF(a,b)LCM(a,b)GCF × LCMa × b
1218636216216
24361272864864
1525575375375
8124249696
100752530075007500
60841242050405040
4530159013501350
1421742294294

Disclaimer

This calculator is for educational purposes only and does not constitute professional advice. Results are based on standard mathematical formulas. Always verify critical calculations with a qualified professional before making important decisions.

Frequently Asked Questions