Number Theory & Precision · Formula v1.0

GCF & LCM Calculator

Use the GCF & LCM Calculator to calculate the greatest common factor and least common multiple of two numbers.

GCF is useful for simplifying fractions; LCM is useful for common denominators. At the worked-example inputs, the greatest common factor is 12. The GCF simplifies fractions and splits things into equal groups, and the LCM finds common denominators and repeating cycles. On the example, 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. It returns greatest common factor, least common multiple.

FreeNo sign-upInputs stay in-browserCSV exportReviewed August 28, 2026
LAST REVIEWEDAugust 28, 2026Inputs stay in your browser
Live calculation

Enter your numbers

Calculated result
Greatest common factor12
Least common multiple72
Sensitivity check

What if first number changes?

-10% input2
0% input12
+10% input2

Transparent method

The formula

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

Worked example

Greatest common factor12
Least common multiple72

Example inputs

First number24
Second number36

How to interpret the result

GCF and LCM solve two different practical problems that happen to use related math. GCF is what actually 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.

Before you rely on it

What to check

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

The common error

Where people go wrong with GCF & LCM calculator

Using LCM when a fraction actually 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.

Sensitivity evidence

How first number changes the greatest common factor

GCF & LCM Calculator: greatest common factor and least common multiple across a range of first number, every other input held at the worked-example value.
First numberGreatest common factorLeast common multiple
191684
222396
24worked example1272
262468
2911,044

Every input, tested

Which input moves the greatest common factor most

GCF & LCM Calculator: greatest common factor with each input moved on its own, every other input held at the worked-example value.
InputTested fromToGreatest common factor at each endSwing
First number22262 to 2none
Second number32408 to 8none

Two variables at once

Greatest common factor by first number and second number

GCF & LCM Calculator: greatest common factor at each combination of first number (rows) and second number (columns).
First number \ Second number293643
19111
22121
241121
26121
292911

Step by step

The worked example, input by input

Worked-example inputs and the results they produce for the GCF & LCM calculator.
InputValue used
First number24
Second number36
Greatest common factor12
Least common multiple72

Where the inputs come from

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.

When the result stops applying

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.

What to compare it with

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.

People also ask

Frequently asked questions

What is the difference between GCF and LCM?

The GCF is the largest number that divides both, while the LCM is the smallest number that both divide into.

How are GCF and LCM related?

For two numbers, GCF times LCM equals the product of the numbers, so the LCM is their product divided by the GCF.

Where do I use the LCM?

To find common denominators when adding fractions and to work out when repeating events will coincide.

Common number theory & precision questions

Sources and evidence