Skip to content
M2TOOLKIT

Calculators · free tool

LCM and GCF Calculator

Find the least common multiple and greatest common factor of any set of whole numbers.

Use it as often as you like — it's free, with no sign-up and no limits.

  • Calculators
  • Free
  • No sign-up
  • Nothing is sent or stored
  • Updated

Result

Greatest common factor (GCF / GCD / HCF)
6
Least common multiple (LCM)
180
How it was calculated
  1. 12 = 2^2 × 3
  2. 18 = 2 × 3^2
  3. 30 = 2 × 3 × 5

The calculation happens instantly in your browser. The numbers you enter are not sent to our servers or saved.

How to use the LCM & GCF Calculator

  1. Enter two or more whole numbers.
  2. Read the GCF and LCM.
  3. Check the prime factorization of each number in the working.

What does this tool do?

The greatest common factor (also called GCD or HCF) is the biggest number that divides all of your numbers exactly. The least common multiple is the smallest number they all divide into.

You use the GCF to simplify fractions and the LCM to find a common denominator when adding fractions.

Why use it?

  • Works with any number of values, not just two.
  • Shows prime factorizations.
  • Uses exact integer arithmetic.

Example: 12, 18 and 30

12 = 2² × 3, 18 = 2 × 3², 30 = 2 × 3 × 5. The GCF takes the lowest shared powers: 2 × 3 = 6. The LCM takes the highest powers of every prime: 2² × 3² × 5 = 180.

The formula

GCF(a, b) by Euclid: GCF(a, b) = GCF(b, a mod b)
LCM(a, b) = |a × b| ÷ GCF(a, b)

Privacy

The calculation happens instantly in your browser. The numbers you enter are not sent to our servers or saved. There's no account to create and nothing to install.

Frequently asked questions

What's the quickest way to find the LCM of two numbers?

Multiply them and divide by their greatest common factor. For 12 and 18, the GCF is 6, so the LCM is 12 × 18 ÷ 6 = 36.

Are GCF, GCD and HCF the same thing?

Yes. Greatest common factor, greatest common divisor and highest common factor are three names for the same number. Which one you see depends mostly on the country and textbook.

Last reviewed by the M2Toolkit team.

Other tools people use alongside the lcm & gcf calculator.