GCF Calculator

Find the greatest common factor of two numbers with the prime factorisation of each, plus their LCM and whether they are coprime.

Greatest common divisor 12
GCD via the Euclidean algorithm; LCM = (a × b) ÷ GCD
Least common multiple 720
Prime factors of the first 2 × 2 × 2 × 2 × 3
Prime factors of the second 2 × 2 × 3 × 3 × 5
Coprime? No

Everything you type here is processed on your own device. No input is sent to a server, logged, or stored.

What the GCF Calculator does

This GCF calculator will find the greatest common factor of two numbers with the prime factorisation of each, plus their LCM and whether they are coprime. Fill in all 2 fields and the result updates as you type — there is no Calculate button to press and no page reload. It is most often used for simplifying a fraction to its lowest terms. The companion to this one is our circle calculator.

How to use it

  1. Enter two whole numbers.
  2. The GCD is the largest number that divides both exactly.
  3. The LCM is the smallest number both divide into.
  4. The prime factorisations show where the common factors come from.

When to use it

  • Simplifying a fraction to its lowest terms.
  • Finding a common denominator for adding fractions.
  • Working out when two repeating cycles will coincide.

Common mistakes to avoid

  • Multiplying the two numbers to get an LCM — that gives a common multiple, but not the least one unless the numbers are coprime.

Frequently asked questions

What does coprime mean?

Two numbers are coprime when their only common factor is 1. For coprime numbers the LCM is simply their product, and a fraction built from them is already in lowest terms.

How is the GCD calculated?

By the Euclidean algorithm: repeatedly replace the larger number with the remainder of dividing it by the smaller, until the remainder is zero. It is over two thousand years old and still the fastest practical method.

Related tools

See all math & statistics calculators →