Math

GCF and LCM Calculator

Find both the greatest common factor and least common multiple of two numbers.


GCF and LCM Calculator

Two related number-theory questions answered together, since they’re commonly taught and searched as a pair.

How it works

The GCF is found with the Euclidean algorithm; the LCM is then found by multiplying the two numbers together and dividing by the GCF.

What this does not include

This does not include prime factorization steps shown explicitly — for just the GCF alone with a simpler page, use this site’s GCF calculator instead.

How to use this calculator

  1. Enter both whole numbers.

A worked example

48 and 18: the Euclidean algorithm gives a GCF of 6. LCM = (48 × 18) ÷ 6 = 144.

21 and 6: GCF is 3, so LCM = (21 × 6) ÷ 3 = 42.

What the terms mean

Term Meaning
GCF Greatest common factor — the largest number dividing evenly into both
LCM Least common multiple — the smallest number both divide into evenly

Edge cases worth knowing

Two coprime numbers (sharing no common factor but 1) have a GCF of exactly 1 — a valid, common result, not an error. Their LCM in that case is simply their product.

Any number’s GCF and LCM with itself are that number — GCF(7, 7) = 7 and LCM(7, 7) = 7.

Frequently asked questions

Why does multiplying by GCF and dividing give the LCM?

Because the product of two numbers always equals their GCF times their LCM — a well-known number-theory identity, rearranged here to solve for LCM directly.

What’s a practical use for LCM?

Finding a common denominator when adding fractions, or figuring out when two repeating events (like two bus schedules) will next align.

Can GCF ever be larger than LCM?

No — GCF is always less than or equal to the smaller of the two numbers, while LCM is always greater than or equal to the larger one.

Be the first to rate this

Written and checked by the Calculator Folks editorial team. How we write and review

Related calculators