GCF & LCM Calculator

The GCF simplifies fractions and splits things into equal groups, and the LCM finds common denominators and repeating cycles. 24 and 36 have a GCF of 12 and an LCM of 72. The GCF answers how big equal groups can be: 24 and 36 items can both be split into groups of 12.

The LCM answers when two cycles line up again: events repeating every 24 and 36 days coincide every 72.

GCF & LCM Calculator: inputs

Calculated result
Greatest common factor12
Least common multiple72

GCF & LCM Calculator: First number sensitivity

GCF & LCM Calculator: First number and Greatest common factor5 calculations vary the “First number” input while holding the other entered inputs constant.1912222412262291

GCF & LCM: worked example

First number24
Second number36
Greatest common factor12
Least common multiple72

GCF & LCM: formula

GCF via the Euclidean algorithm; LCM = (a × b) ÷ GCF

Wolfram MathWorld: GreatestCommonDivisor · Least Common Multiple: Wolfram MathWorld

Enter two whole numbers. The greatest common factor is the largest number dividing both, found with the Euclidean algorithm, and the least common multiple is the smallest number both divide into, equal to their product divided by the GCF. Use positive integers; zero is a special case.

If you have more than two numbers, compute in pairs, since the GCF and LCM of a set can be built one pair at a time.

GCF & LCM: changing First number

First numberGreatest common factorLeast common multiple
191684
222396
24 (example)1272
262468
2911,044

GCF & LCM: compare input ranges

InputTested fromToGreatest common factor: low inputGreatest common factor: high inputSwing
First number2226220
Second number3240880

GCF & LCM: individual input comparisons

InputValueGreatest common factorLeast common multiple
First number191684
222396
241272
262468
2911,044
Second number291696
32896
361272
408120
4311,032

GCF & LCM: combined input changes

First number / Second number293643
19111
22121
241121
26121
292911

GCF & LCM: values and definitions

Quantity and definitionValue used
First number24
Second number36
Greatest common factor12
Least common multiple72

Common error: Using LCM when a fraction needs simplifying, or GCF when a common denominator is needed. The two numbers solve different problems, and swapping them produces an answer that doesn't fit the task at hand.

The GCF of two numbers that share no factors is 1, so they are coprime, and their LCM is their product. Large numbers are handled quickly by the Euclidean algorithm, though prime factorization is slower. Negative numbers are treated by absolute value.

The tool handles two numbers at a time.

Number Theory & Precision calculators: Prime Factorization Calculator, Scientific Notation Calculator, Percent Error Calculator, Number Base Converter Calculator, Factorial Calculator, Modulo Calculator.

GCF and LCM solve two different practical problems that happen to use related math. GCF is what simplifies a fraction to its lowest terms, while LCM is what finds a common denominator for adding or comparing fractions with different denominators, and confusing which one a specific task calls for produces the wrong kind of answer entirely.

Identify which task you're solving, simplifying a fraction calls for GCF, finding a common denominator calls for LCM, before reading which of the two numbers applies.

Reduce fractions on the fraction simplifier, add them on the fraction calculator, and see the primes behind the factors on the prime factorization page. The ratio simplifier and modulo calculator use the same ideas. The proportion calculator scales quantities.

GCF & LCM Calculator: quantities and terminology

What is the difference between GCF and LCM?

For positive integers, the GCF divides both. Choose the largest such divisor. The LCM is a multiple of both integers.

Choose the smallest positive one when both inputs are nonzero; a shared divisor and a shared multiple answer different questions.

How are GCF and LCM related?

For positive integers, GCF × LCM equals their product. Divide that product by the GCF to obtain the LCM. Keep the zero-input convention separate, since dividing by a zero GCF cannot establish a result.

Where do I use the LCM?

The LCM supplies a common denominator for adding fractions. It also identifies when repeating events coincide, provided their periods use matching units and both cycles start together. A timing offset changes that scheduling question.