GCF and LCM Calculator

Find the greatest common factor and least common multiple of two or more numbers, with the calculation steps shown.

Please enter at least two positive whole numbers, separated by commas.

Greatest common factor (GCF)
Least common multiple (LCM)

How GCF and LCM are calculated

GCF(a, b) via the Euclidean algorithm: repeatedly replace the larger number with the remainder of dividing it by the smaller, until the remainder is 0
LCM(a, b) = (a × b) ÷ GCF(a, b)
For more than two numbers, apply both formulas pairwise across the whole list

The Euclidean algorithm finds the GCF of two numbers efficiently without listing every factor: divide the larger by the smaller, take the remainder, and repeat with the smaller number and that remainder until the remainder hits zero — the last non-zero remainder is the GCF. Once you have the GCF, the LCM follows directly from a simple formula, since the two are mathematically linked.

Worked example — 12, 18, and 30

GCF(12, 18) = 6. GCF(6, 30) = 6. So GCF(12, 18, 30) = 6.

LCM(12, 18) = (12 × 18) ÷ 6 = 36. LCM(36, 30) = (36 × 30) ÷ 6 = 180. So LCM(12, 18, 30) = 180.

Worked example — scheduling and grouping problems

Scheduling (LCM): Bus Route A repeats every 8 days; Bus Route B repeats every 12 days. Both ran today. GCF(8, 12) = 4, so LCM(8, 12) = (8 × 12) ÷ 4 = 96 ÷ 4 = 24. Both routes will next run on the same day again in 24 days.

Grouping (GCF): A caterer has 24 apples and 36 oranges and wants the largest possible number of identical fruit baskets with no fruit left over. GCF(24, 36) = 12, so the caterer can make 12 baskets, each with 24 ÷ 12 = 2 apples and 36 ÷ 12 = 3 oranges.

Where GCF and LCM show up in practice

GCF is what you use to simplify a fraction to its lowest terms — divide the numerator and denominator by their GCF. LCM is what you use to find a common denominator when adding or comparing fractions with different denominators. Both also come up in scheduling problems (like figuring out when two repeating events next coincide) and in dividing items into equal groups.

GCF and LCM of common number pairs

NumbersGCFLCM
4, 6212
6, 9318
8, 12424
12, 18636
24, 361272

Common mistakes when finding GCF and LCM

Frequently asked questions

What is the greatest common factor (GCF)?

The largest number that divides evenly into every number in a set — the GCF of 12 and 18 is 6.

What is the least common multiple (LCM)?

The smallest number that every number in a set divides into evenly — the LCM of 4 and 6 is 12.

How is GCF used to simplify fractions?

Divide the numerator and denominator by their GCF — 18/24 simplifies to 3/4 by dividing both by 6.

How is LCM used to add fractions?

The LCM of the denominators becomes the common denominator before adding.

How is LCM used for scheduling repeating events?

The LCM of the two intervals gives the days until both coincide again. Routes every 8 and 12 days next align in LCM(8,12) = 24 days.

How is GCF used to divide items into equal groups?

The GCF gives the largest number of identical groups possible. 24 apples and 36 oranges make GCF(24,36) = 12 baskets of 2 apples and 3 oranges each.

Related calculators

Note: Works with positive whole numbers. Last reviewed: September 2026.