Math

GCF and LCM Calculator

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


GCF and LCM Calculator

Advertisement

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 by

J. Adeyemi

Statistics writer

J. Adeyemi writes the statistics and probability calculators, from descriptive summaries through to distributions and conditional probability. The recurring theme is scope: each page states precisely which question it answers, because most statistical mistakes come from applying a correct formula to the wrong question. Related-but-different measures get separate pages rather than being quietly merged.

Reviewed by

T. Okafor

Calculator reviewer — mathematics

T. Okafor reviews the mathematics calculators, verifying algebraic correctness and, just as importantly, behaviour at the edges — division by zero, undefined results, and the floating-point cases where a formula technically returns a number that should be reported as undefined. Every test case is recomputed independently rather than taken on trust.

How we write and review

Related calculators