Skip to main content

MATH · GCF AND LCM

GCF and LCM Calculator

Find the Greatest Common Factor (GCF) and Least Common Multiple (LCM) of any list of integers using Euclid's algorithm.

Integers (≥ 2)
02 Result
GCF (Greatest Common Factor)4
LCM (Least Common Multiple)24
Count2

About This Calculator

The GCF (Greatest Common Factor) is the largest number that divides all the given integers exactly. The LCM (Least Common Multiple) is the smallest positive integer divisible by all of them. Both are fundamental to fraction arithmetic, ratio simplification, and scheduling problems.

How It Works

Enter at least two integers separated by commas or spaces. The calculator computes the GCF by repeatedly applying Euclid's algorithm (gcd(a, b) = gcd(b, a mod b)) and reduces to find the GCF of all values. LCM is derived from the GCF: LCM(a, b) = (a / GCF) × b, using the division-first form to avoid integer overflow. Negative inputs are treated as their absolute values.

The Formula

GCF = gcd(a, b, …) LCM = (a / GCF) × b × …

gcd
greatest common divisor via Euclid's algorithm

Frequently Asked Questions

What is the GCF used for?
The GCF is used to simplify fractions to their lowest terms — dividing both numerator and denominator by the GCF gives an equivalent fraction in simplest form. It also appears in ratio simplification and number theory.
What happens when one number is zero?
By convention, gcd(0, x) = x. So the GCF of 0 and 5 is 5. The LCM is 0 because 0 is divisible by everything, making any common multiple of 0 and x equal to 0.
Does the order of the numbers matter?
No. GCF and LCM are symmetric — the result is the same regardless of the order of the inputs.