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 evenly into two or more numbers. The least common multiple (LCM) is the smallest whole number that all of them divide into. For 12 and 18 the GCF is 6 and the LCM is 36. The two are closely linked and appear whenever you simplify fractions, add fractions with different denominators, or work out repeating cycles. This calculator finds both for any list of whole numbers.

How they're calculated

The quickest way to find the GCF is the Euclidean algorithm: divide the larger number by the smaller, replace the larger with the remainder, and repeat until the remainder is zero; the last non-zero value is the GCF. The LCM then follows from a simple relationship: for two numbers, LCM = (a x b) divided by GCF. For longer lists, apply the operation two numbers at a time. You can also read both off the prime factorisation: the GCF multiplies the shared primes at their lowest powers, the LCM uses every prime at its highest power. See our Prime Factorization Calculator.

Example

Take 12 and 18. The factors of 12 are 1, 2, 3, 4, 6, 12 and of 18 are 1, 2, 3, 6, 9, 18; the largest shared factor is 6, so the GCF is 6. The LCM is (12 x 18) divided by 6 = 216 divided by 6 = 36, the smallest number that both 12 and 18 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 difference between GCF and LCM?+

The GCF is the largest number that divides into them all; the LCM is the smallest number they all divide into.

What is the GCF of two coprime numbers?+

It is 1; numbers like 3 and 5 share no common factor other than 1, and their LCM is just their product, 15.

How do I find the LCM from the GCF?+

For two numbers, LCM = (a x b) divided by GCF.

Is GCF the same as GCD?+

Yes; greatest common factor and greatest common divisor are two names for the same thing.

How are GCF and LCM used with fractions?+

The GCF simplifies a fraction to lowest terms; the LCM gives the common denominator when adding or subtracting fractions. See our Fraction Calculator.

Can I find the GCF and LCM of more than two numbers?+

Yes, this calculator handles any list of whole numbers.

What is the GCF of a number and itself?+

The number itself; the GCF of 8 and 8 is 8.

Do GCF and LCM work with prime factorisation?+

Yes; the GCF takes shared primes at the lowest power, the LCM takes every prime at the highest power. See our Prime Factorization Calculator.