GCF and LCM Calculator

Type two or more whole numbers separated by commas or spaces to get their greatest common factor and least common multiple instantly.

  • Runs on your device
  • Keyboard-first
  • Free, no sign-up

Separate with commas, spaces or new lines. Example: 12, 18, 30

Greatest common factor (GCF)

—

Least common multiple (LCM)
—
Numbers
—

Calculated on your device. Nothing you type is sent anywhere.

Cite
APA: Mr. Behairy. (2026). GCF and LCM Calculator. Anubis Calc. https://calculatoranubis.com/en/gcf-lcm-calculator
MLA: Mr. Behairy. "GCF and LCM Calculator." Anubis Calc, 2026, https://calculatoranubis.com/en/gcf-lcm-calculator.
Embed

Copy this snippet to embed this calculator on your site or blog for free:

<iframe src="https://calculatoranubis.com/en/embed/gcf-lcm-calculator" width="100%" height="520" style="border:0;border-radius:18px" loading="lazy" title="GCF and LCM Calculator"></iframe>
<p><a href="https://calculatoranubis.com/en/gcf-lcm-calculator" rel="noopener">GCF and LCM Calculator — Anubis Calc</a></p>

How it works

The greatest common factor (GCF, also called the greatest common divisor GCD or highest common factor HCF) is the largest whole number that divides every number in the list. The least common multiple (LCM) is the smallest positive number that every number in the list divides into.

GCF by Euclid’s algorithm: gcd(a, b) = gcd(b, a mod b), until the remainder is 0 lcm(a, b) = |a × b| ÷ gcd(a, b)  ·  for a list, apply pair by pair

Worked example. For 12, 18 and 30: gcd(12, 18) = 6 and gcd(6, 30) = 6, so GCF = 6. lcm(12, 18) = 216 ÷ 6 = 36, and lcm(36, 30) = 1,080 ÷ 6 = 180. Check with prime factors: 12 = 2² × 3, 18 = 2 × 3², 30 = 2 × 3 × 5. GCF takes the lowest powers (2 × 3 = 6); LCM takes the highest (2² × 3² × 5 = 180).

Euclid’s algorithm step by step

To find gcd(48, 18): 48 = 2 × 18 + 12 → gcd(18, 12); 18 = 1 × 12 + 6 → gcd(12, 6); 12 = 2 × 6 + 0 → the answer is 6. It is fast even for very large numbers, which is why calculators and computers use it.

Where you use them

  • Simplifying fractions: divide top and bottom by the GCF. 18/30 → divide by 6 → 3/5.
  • Adding fractions: the LCM of the denominators is the lowest common denominator. 1/12 + 1/18 → denominator 36.
  • Scheduling: buses every 12 and 18 minutes leave together every 36 minutes (the LCM).
  • Tiling and cutting: the largest square tile that fits a 48 × 18 floor exactly is 6 × 6 (the GCF).

Special cases

If the GCF is 1, the numbers are coprime, and their LCM is their product. Zero is not accepted, and the LCM of large lists can grow beyond what can be shown exactly — the calculator tells you when that happens.

Working with fractions? Use the fraction calculator. For averages of a list, try the average calculator, and for equations the quadratic formula calculator.

Sources & assumptions

Whole numbers other than zero; negatives use their absolute value; 2 to 20 numbers; LCM shown only while it is an exact integer.

Reviewed by: Mr. Behairy (Accountant, Financial Auditor & Tax Specialist) · Editorial policy · Formulas reviewed:

Frequently asked questions

How do I find the GCF of two numbers?

Use Euclid’s algorithm: replace the larger number with the remainder of dividing it by the smaller, until the remainder is 0.

How do I find the LCM of two numbers?

Multiply them and divide by their GCF. lcm(12, 18) = 216 ÷ 6 = 36.

Is GCF the same as GCD and HCF?

Yes. Greatest common factor, greatest common divisor and highest common factor are the same thing.

What is the GCF of 12 and 18?

6.

What is the LCM of 4 and 6?

12.

What does it mean if the GCF is 1?

The numbers are coprime: they share no factor other than 1, and their LCM is their product.