ToolNimba Browse

🔢 GCF and LCM Calculator

By ToolNimba Editorial Team · Updated 2026-06-19

GCF (greatest common factor)
-
LCM (least common multiple)
-
Numbers used (n)
-
Values
-

Enter two or more whole numbers to find their GCF and LCM.

This GCF and LCM calculator finds the greatest common factor and the least common multiple of any list of whole numbers. Type two or more numbers separated by commas or spaces and you will instantly see both results, plus the count of numbers used. It is built for homework checking, fraction work, and any time you need to combine or simplify ratios.

What is the GCF and LCM Calculator?

The greatest common factor (GCF), also called the greatest common divisor (GCD), is the largest whole number that divides evenly into every number in your list. For example, the factors shared by 12 and 18 are 1, 2, 3, and 6, so the GCF is 6. The GCF is what you use to reduce a fraction to lowest terms: dividing the top and bottom of 12/18 by 6 gives 2/3.

The least common multiple (LCM) is the smallest positive whole number that every number in your list divides into evenly. The multiples of 4 are 4, 8, 12, 16, and so on, while the multiples of 6 are 6, 12, 18; the first value they share is 12, so the LCM of 4 and 6 is 12. The LCM is what you need to find a common denominator when adding or subtracting fractions.

This tool uses the Euclidean algorithm to find the GCF quickly, then computes the LCM from the relationship lcm(a, b) = a × b ÷ gcd(a, b), folding that across the whole list one pair at a time. The Euclidean algorithm is far faster than listing every factor, which is why the calculator stays instant even for large numbers. Decimals and zeros are ignored, since the GCF and LCM are defined for positive whole numbers.

When to use it

  • Reducing a fraction to lowest terms by dividing the numerator and denominator by their GCF.
  • Finding a common denominator when adding or subtracting fractions, which is the LCM of the denominators.
  • Checking GCF and LCM homework answers and seeing the method behind them.
  • Working out when two repeating events line up again, such as two buses that arrive every 12 and 18 minutes.

How to use the GCF and LCM Calculator

  1. Type two or more whole numbers, separated by commas, spaces, or new lines.
  2. Read the GCF (greatest common factor) and LCM (least common multiple) shown straight away.
  3. Use one of the example buttons to load a sample set, or Clear to start over.
  4. Decimals, negatives signs, and zeros are handled automatically (only positive whole numbers are used).

Formula & method

gcd(a, b) by the Euclidean algorithm: replace (a, b) with (b, a mod b) until b = 0.   lcm(a, b) = a × b ÷ gcd(a, b). For a list, fold each operation across all values.

Worked examples

Find the GCF and LCM of 12 and 18.

  1. GCF by Euclid: gcd(12, 18) = gcd(18, 12) = gcd(12, 6) = gcd(6, 0) = 6
  2. LCM: 12 × 18 ÷ 6 = 216 ÷ 6 = 36

Result: GCF = 6, LCM = 36

Find the GCF and LCM of 8 and 12.

  1. GCF by Euclid: gcd(8, 12) = gcd(12, 8) = gcd(8, 4) = gcd(4, 0) = 4
  2. LCM: 8 × 12 ÷ 4 = 96 ÷ 4 = 24

Result: GCF = 4, LCM = 24

Find the GCF and LCM of three numbers: 12, 18, and 24.

  1. GCF: gcd(12, 18) = 6, then gcd(6, 24) = 6
  2. LCM: lcm(12, 18) = 36, then lcm(36, 24) = 36 × 24 ÷ gcd(36, 24) = 864 ÷ 12 = 72

Result: GCF = 6, LCM = 72

GCF and LCM for common number pairs

NumbersGCFLCM
4 and 6212
8 and 12424
12 and 18636
9 and 12336
6 and 8224
10 and 15530
7 and 11177

Common mistakes to avoid

  • Mixing up the GCF and the LCM. The GCF is never larger than the smallest number you entered, while the LCM is never smaller than the largest. If your answer breaks that rule, you have swapped them.
  • Assuming GCF times LCM equals the product for three or more numbers. The identity GCF × LCM = a × b only holds for exactly two numbers. With three or more, compute the GCF and LCM by folding across the list, as this tool does.
  • Forgetting that coprime numbers have a GCF of 1. When two numbers share no factor other than 1 (such as 7 and 11), the GCF is 1 and the LCM is simply their product. That is correct, not an error.
  • Including zero in the list. Zero is a multiple of every number, so it has no meaningful LCM with other values. This tool ignores zeros and decimals so the result stays well defined.

Glossary

Greatest common factor (GCF)
The largest whole number that divides evenly into every number in a set. Also called the greatest common divisor (GCD).
Least common multiple (LCM)
The smallest positive whole number that every number in a set divides into evenly.
Euclidean algorithm
A fast method for finding the GCD: repeatedly replace the larger number with the remainder of dividing it by the smaller, until the remainder is zero.
Coprime
Two numbers are coprime (relatively prime) when their only common factor is 1, so their GCF is 1.

Frequently asked questions

What is the GCF of two numbers?

The GCF (greatest common factor) is the largest whole number that divides both numbers exactly. For 12 and 18 it is 6, because 6 is the biggest number that goes into both without a remainder.

What is the LCM of two numbers?

The LCM (least common multiple) is the smallest positive number that both numbers divide into evenly. For 4 and 6 it is 12, the first value that appears in both lists of multiples.

What is the difference between GCF and LCM?

The GCF is the largest factor shared by the numbers, so it is at most as big as the smallest input. The LCM is the smallest common multiple, so it is at least as big as the largest input.

How do you find the GCF and LCM together?

Find the GCF first, usually with the Euclidean algorithm, then use lcm(a, b) = a times b divided by the GCF. This calculator does both at once and shows the method.

Can the GCF be 1?

Yes. When two numbers share no common factor other than 1 they are called coprime, so their GCF is 1 and their LCM is simply their product, as with 7 and 11.

Does the calculator work for more than two numbers?

Yes. Enter any list of whole numbers and the tool folds the GCF and LCM across all of them, one pair at a time, to give a single GCF and a single LCM for the whole set.