GCF & LCM Calculator

Enter two or more whole numbers to find their greatest common factor (GCF) and least common multiple (LCM).

Reviewed by the WorldCalcs team · Methodology · Last reviewed: June 2026

Result

Numbers: 12, 18

GCF = 6

LCM = 36

What are the GCF and LCM?

The greatest common factor (GCF), also called the greatest common divisor, is the largest whole number that divides into every number in your list with no remainder. The least common multiple (LCM) is the smallest whole number that every number in your list divides into evenly. They are used to reduce fractions, find common denominators, and solve timing and grouping problems.

How they are calculated

The GCF is found with the Euclidean algorithm: repeatedly replace the larger number with the remainder of dividing it by the smaller, until one number reaches zero; the other is the GCF. The LCM of two numbers is their product divided by their GCF: LCM(a, b) = (a × b) ÷ GCF(a, b). For more than two numbers, the GCF and LCM are built up one pair at a time.

Example

For 12 and 18, the GCF is 6 (the largest number dividing both) and the LCM is (12 × 18) ÷ 6 = 36. For 4, 6 and 10, the GCF is 2 and the LCM is 60 — the smallest number all three divide into.

All calculations happen in your browser. Nothing is sent, stored, or tracked.

Results are estimates and may contain errors — for general information only, not professional advice. Always verify before relying on them. Disclaimer

How to use

Type two or more positive whole numbers separated by commas, spaces or new lines.

The calculator shows the greatest common factor and the least common multiple, using the Euclidean algorithm for the GCF and the pairwise-product method for the LCM.

Frequently asked questions

What is the greatest common factor?+

The GCF is the largest whole number that divides every number in the list with no remainder. For 12 and 18 it is 6.

What is the least common multiple?+

The LCM is the smallest whole number that each number in the list divides into evenly. For 12 and 18 it is 36.

How are the GCF and LCM related?+

For two numbers, the GCF times the LCM equals the product of the numbers: GCF(a, b) × LCM(a, b) = a × b.

What if the numbers share no common factor?+

If the only common factor is 1, the numbers are 'coprime'; their GCF is 1 and their LCM is simply their product. For 3 and 5, GCF = 1 and LCM = 15.

Why are the GCF and LCM useful?+

The GCF reduces fractions to lowest terms, while the LCM gives the least common denominator for adding fractions and solves repeating-cycle problems.