GCF and LCM Calculator

A GCF calculator finds the largest number that divides all your numbers, and the LCM is the smallest number they all divide into. For 48 and 18, GCF = 6 and LCM = 144. The two are linked: GCF × LCM = 48 × 18 = 864.

Inputs

Separate with commas or spaces. Each must be a whole number from 1 to 1,000,000,000,000.
Result
–

Results are calculated in your browser for convenience. Double-check important figures before relying on them.

How do you find the GCF (greatest common factor)?

The GCF (also called the HCF, highest common factor, or GCD) is the largest whole number that divides every number in your list with no remainder. There are two reliable methods.

1. Prime factorization: write each number as primes and multiply the primes they share, using the lowest power. 48 = 2⁴ × 3 and 18 = 2 × 3². The shared part is 2 × 3 = 6.

2. Euclid's algorithm: divide the larger by the smaller and keep the remainder, repeating until the remainder is 0. The last non-zero remainder is the GCF.

48 = 2 × 18 + 12 18 = 1 × 12 + 6 12 = 2 × 6 + 0 → GCF = 6

How do you find the LCM (least common multiple)?

The LCM is the smallest number that every number in the list divides into evenly. Using primes, take the highest power of every prime that appears.

LCM of 48 and 18 = 2⁴ × 3² = 144 For two numbers: LCM = (a × b) ÷ GCF = (48 × 18) ÷ 6 = 144

Three numbers: for 12, 18 and 30 the GCF is 6 and the LCM is 180.

When do you use GCF and LCM?

  • Simplify fractions: divide the top and bottom by the GCF. 48/18 becomes 8/3.
  • Add fractions: the LCM of the denominators is the least common denominator.
  • Scheduling: if one bus runs every 12 minutes and another every 18, they meet every LCM = 36 minutes.
  • Sharing equally: the GCF tells you the biggest group size that divides each set evenly.

Two numbers with a GCF of 1 are called coprime. See the fraction calculator and prime factorization calculator for related tools.

Complete guide to the GCF and LCM Calculator

How to use the GCF and LCM Calculator, step by step

  1. Enter two or more whole numbers, separated by commas.
  2. Read the GCF and the LCM.
  3. Check the prime factorizations.
  4. Read the Euclid’s algorithm steps for the first two numbers.

Common mistakes to avoid

  • Mixing up GCF and LCM.
  • Using decimals or negative numbers.
  • Forgetting that coprime numbers have a GCF of 1.

Key terms explained

GCF / HCF / GCD
Greatest common factor, highest common factor, greatest common divisor.
LCM
Least common multiple.
Coprime
Numbers whose GCF is 1.
Euclid’s algorithm
Repeated division with remainders to find the GCF.

Frequently asked questions

How do I find the GCF of two numbers?

List the prime factors of each, multiply the ones they share, or use Euclid’s algorithm of repeated division with remainders. The last non-zero remainder is the GCF.

How do I find the LCM of two numbers?

Divide the product of the numbers by their GCF: LCM = (a × b) ÷ GCF. Or take the highest power of each prime in their factorizations.

What is the GCF of 48 and 18?

It is 6. The LCM of 48 and 18 is 144.

Is GCF the same as HCF or GCD?

Yes. Greatest common factor (GCF), highest common factor (HCF) and greatest common divisor (GCD) all mean the same thing.

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

Yes. Enter up to 12 numbers separated by commas. The calculator applies the method step by step across the list.

Related calculators

Guides worth reading