LCM & GCF Calculator: Greatest Common Factor & Least Multiple

Find the greatest common factor and least common multiple of two or more numbers instantly with step-by-step Euclidean logic.

Reviewed for Mathematical Accuracy Last updated: 2026
GCF (Greatest Common Factor)
-
LCM (Least Common Multiple)
-

Understanding Greatest Common Factor and Least Common Multiple

The Greatest Common Factor (GCF), also known as the Greatest Common Divisor (GCD), represents the largest positive integer that divides evenly into every number in a specified list. In contrast, the Least Common Multiple (LCM) represents the smallest positive integer that is divisible by every number in that list.

While GCF identifies the maximum shared building block between numbers, LCM identifies the earliest point where repeating intervals or multiples converge.

The Euclidean Algorithm for GCF Calculation

Rather than listing every factor manually, mathematicians use the Euclidean algorithm. For any two positive integers a and b (where a ≥ b):

GCD(a, b) = GCD(b, a mod b)

The calculation divides a by b, takes the remainder, and repeats until the remainder reaches zero. The final non-zero divisor is the GCF. For sets of three or more numbers, the calculator applies this principle associatively: GCD(a, b, c) = GCD(GCD(a, b), c).

The Relationship Connecting LCM and GCF

For any two numbers, their product equals the product of their GCF and LCM. This fundamental theorem allows the direct calculation of LCM once GCF is established:

LCM(a, b) = (|a × b|) / GCF(a, b)

Multiplying a and b creates a common multiple, but includes duplicated shared prime factors. Dividing by the GCF removes the duplicate factor, producing the lowest possible multiple.

Step-by-Step Worked Example (12, 18, 24)

  1. GCF Calculation: First evaluate 12 and 18: 18 / 12 = 1 remainder 6. Then 12 / 6 = 2 remainder 0. The GCD of (12, 18) is 6. Next, evaluate that result with 24: GCD(6, 24) = 6. The overall GCF is 6.
  2. LCM Calculation: First find LCM(12, 18) = (12 × 18) / 6 = 216 / 6 = 36. Next find LCM(36, 24): GCD(36, 24) is 12, so LCM(36, 24) = (36 × 24) / 12 = 864 / 12 = 72. The overall LCM is 72.

Practical Applications of GCF and LCM

Common Mistakes When Solving GCF and LCM

A common error is confusing the two concepts: remembering that GCF is always smaller than or equal to the smallest input, while LCM is always larger than or equal to the largest input. Another mistake is attempting to compute the LCM of three numbers at once using the formula (a × b × c) / GCF(a, b, c). That formula is only mathematically valid for pairs; sets of three or more numbers must always be evaluated pairwise.

Frequently Asked Questions

What is the difference between GCF and LCM?

The Greatest Common Factor (GCF) is the largest positive integer that divides evenly into every number in a given set. The Least Common Multiple (LCM) is the smallest positive integer that is a multiple of every number in that set.

How does the Euclidean algorithm calculate the greatest common factor?

The Euclidean algorithm repeatedly replaces the larger number with the remainder of dividing the larger by the smaller: GCD(a, b) = GCD(b, a mod b). The process continues until the remainder reaches zero, at which point the last non-zero divisor is the GCF.

What is the mathematical formula connecting LCM and GCF?

For any two positive integers a and b, the product of their LCM and GCF equals the product of the numbers: LCM(a, b) * GCF(a, b) = a * b. Rearranged, LCM(a, b) = (a * b) / GCF(a, b).

How does this calculator solve LCM and GCF for three or more numbers?

The calculator uses pairwise reduction. It computes the GCF of the first two numbers, then computes the GCF of that result with the third number, continuing across all elements. The identical associative reduction applies to LCM.

What happens when numbers share no common factors (coprime)?

When numbers share no common divisor other than 1, they are coprime (relatively prime). Their GCF is 1, and their LCM is equal to their direct mathematical product.

How are GCF and LCM used to simplify fractions and find common denominators?

GCF simplifies fractions to lowest terms by dividing both the numerator and denominator by their greatest common divisor. LCM finds the lowest common denominator (LCD) needed to add or subtract fractions with unlike denominators.