Menu

Language

Units

Changes the symbol and formatting. It does not convert amounts.

Theme

Suggest a tool

Greatest common factor and lowest common multiple

Both at once, for as many numbers as you like, with each one broken into primes alongside. Which is where you see why the answers are what they are.

Percentages Whole numbers and fractions No sign-up

Your figures

Whole positive numbers. Two is enough, but it takes as many as you like.

Result

Greatest common factor 6
Lowest common multiple
72
Numbers entered
3
Smallest
12
Largest
24

Each number, broken into primes

Each number, broken into primes
NumberPrime factorsThe LCM holds it this many times
12 2^2 × 3 6
18 2 × 3^2 4
24 2^3 × 3 3

What we assume

  • Takes whole numbers only, and works on their absolute value.
  • Zero is excluded: it has no proper divisors and collapses the LCM.
  • Prime factorisation is exact up to the browser’s largest safe integer.
  • With more than two numbers, GCF and LCM are chained two at a time.

How it is calculated

The greatest common factor is the largest number that divides all of them with no remainder. The lowest common multiple is the smallest number they all divide into.

Using prime factors

Break each number into primes and both answers can be read straight off:

  • The GCF takes each shared prime at its lowest power.
  • The LCM takes every prime at its highest power.

With 12 = 2^2 × 3 and 18 = 2 × 3^2: the GCF is 2 × 3 = 6 and the LCM is 2^2 × 3^2 = 36.

How this page works it out

With Euclid’s algorithm, which needs no factorisation at all: divide the larger by the smaller and repeat with the remainder until it hits zero. The last non-zero remainder is the GCF. It is the oldest non-trivial algorithm still in use, about 2,300 years old, and still the fastest way to do this.

The LCM comes from the GCF:

LCM(a, b) = a / GCF(a, b) × b

That order matters. Multiplying first and dividing after gives the same answer on paper, but with large numbers the product exceeds the largest exact integer a browser can hold and the result starts lying without warning. Dividing first, that cannot happen.

What they are actually for

The GCF, for simplifying fractions: dividing numerator and denominator by it gives the fraction in lowest terms in a single step. The LCM, for adding them, which is where a common denominator is needed.

Outside the classroom they turn up the same way: splitting 12 pencils and 18 erasers into identical kits with nothing left over gives 6 kits (GCF), and two buses leaving every 12 and every 18 minutes coincide again after 36 (LCM).

An example

For 12, 18 and 24: the GCF is 6 and the LCM is 72. The factorisations are 2^2 × 3, 2 × 3^2 and 2^3 × 3, so the GCF takes 2 × 3 and the LCM takes 2^3 × 3^2.

Frequently asked questions

Is it true that GCF × LCM equals the product of the two numbers?

For two numbers, always: 12 × 18 = 216, and 6 × 36 = 216 as well. With three or more it stops holding, so it is no use as a general check.

What if the numbers share nothing?

Then they are coprime, the GCF is 1 and the LCM is their product. Note they do not have to be prime numbers themselves: 8 and 9 are both composite and still coprime, because they share no factor.

What about negative numbers?

They are taken at their absolute value, which is the usual convention: the GCF of −12 and 18 is 6. A negative divisor would divide just as well, but by agreement the positive one is taken.

How many numbers can I enter?

As many as you like, one per line. GCF and LCM are associative, so they are chained: first the two leading numbers, then that result with the third, and so on.

Keep calculating

All tools →

Updated on 2026-09-11. Calculations run in your browser; nothing you type is sent to a server.

move · open · Esc close Missing one?