GCF and LCM Calculator

Enter two or more whole numbers to get their greatest common factor and least common multiple, with prime factorizations.

GCF and LCM Calculator
GCF · LCM

How to Find the GCF and LCM

Both come from prime factorization. Break each number into primes, then: the GCF takes each shared prime at its lowest power, while the LCM takes every prime that appears at its highest power. For two numbers, the Euclidean algorithm (repeated remainders) finds the GCF even faster, and the LCM follows from the identity below.

GCF: shared primes at lowest powers · LCM: all primes at highest powers
LCM(a, b) = (a × b) ÷ GCF(a, b)
Worked example

For 12 and 18: 12 = 2² × 3 and 18 = 2 × 3². Shared primes at lowest powers: 2 × 3 = GCF 6. All primes at highest powers: 2² × 3² = LCM 36. Check: 6 × 36 = 216 = 12 × 18. ✓

Typical Uses

  • Simplifying fractions: divide top and bottom by their GCF — 18/24 ÷ 6 = 3/4.
  • Adding fractions: the least common denominator of 1/12 and 1/18 is their LCM, 36.
  • Scheduling: events every 6 and 8 days coincide every LCM(6, 8) = 24 days.
  • Splitting into groups: 36 apples and 60 oranges make at most GCF(36, 60) = 12 identical gift bags.

Frequently Asked Questions

What is the greatest common factor (GCF)?

The largest whole number that divides evenly into all the given numbers. The GCF of 12 and 18 is 6. It is also called the greatest common divisor (GCD) or highest common factor (HCF).

What is the least common multiple (LCM)?

The smallest positive number that is a multiple of all the given numbers. The LCM of 4 and 6 is 12, because 12 is the first number that appears in both the 4-times and 6-times tables.

How are GCF and LCM related?

For any two positive numbers, GCF × LCM = the product of the numbers. For 12 and 18: GCF 6 × LCM 36 = 216 = 12 × 18. This gives a quick way to find one when you know the other.

When do I actually use GCF and LCM?

GCF simplifies fractions and splits things into the largest equal groups. LCM finds common denominators for adding fractions and answers “when do two repeating events line up?” — like buses every 12 and 18 minutes departing together every 36 minutes.

Cite This Calculator

Using this calculator in an assignment, article or lesson? Copy a ready-made citation — or the link snippet if you're referencing it from a web page.

The CalculatorsGuide Editorial Team. (2026). GCF and LCM Calculator. CalculatorsGuide. Retrieved from https://www.calculatorsguide.com/math/gcf-lcm-calculator/

The CalculatorsGuide Editorial Team — Calculator authors and reviewers

Every calculator on this site is built from published formulas, checked against worked reference examples, and covered by automated tests that re-verify its output on every update. Our full process is documented on the methodology page. Read our methodology →