MarketsLoading...live dataMarketsLoading...live dataMarketsLoading...live dataMarketsLoading...live data
Free tool · every step shown · no sign-up

GCF and LCM Calculator

Find the greatest common factor and least common multiple of two numbers, with every step shown.

Find the GCF and LCM of two numbers

whole number
whole number
Result
—

GCF and LCM, with the working shown — free, no sign-up

The greatest common factor (GCF, also called GCD) is the largest number that divides both numbers evenly. The least common multiple (LCM) is the smallest number that both divide into evenly. This tool finds both using the Euclidean algorithm, shows every division step for free, and needs no account or app.

Frequently asked questions

How is the GCF calculated?

Using the Euclidean algorithm — repeatedly dividing the larger number by the smaller and keeping the remainder, until the remainder is 0. The last non-zero remainder is the GCF. It's the same method shown step by step below, not just the final answer.

How is the LCM calculated from the GCF?

LCM(a, b) = (a × b) ÷ GCF(a, b). Once you have the GCF, the LCM follows directly from that one formula.

Does this work for any two whole numbers?

Yes, for any two positive whole numbers. Enter them in either order — the result is the same.

Is this free with no sign-up?

Yes — completely free, runs in your browser, no account needed.

Explore more free tools

Loans, savings, percentages, BMI and more.

See all calculators →

Two questions, two different numbers

The greatest common factor asks for the largest whole number that divides each input without a remainder. The least common multiple asks for the first positive whole number that each input divides into. The distinction matters when reducing a fraction or scheduling repeated events.

Work through 18 and 24

Euclid's algorithm divides 24 by 18 and leaves remainder 6. Dividing 18 by 6 leaves remainder 0, so the greatest common factor is 6. The least common multiple is 18 × 24 ÷ 6 = 72. The page's working steps let you check this without trusting a single unexplained result.

For the fraction 18/24, divide both terms by the GCF to get 3/4. For events repeating every 18 and 24 days, 72 is the first positive number of days at which both periods line up again, assuming they started together.

Try inputs with different relationships

For 7 and 11, no factor above 1 divides both, so GCF is 1 and LCM is 77. For 6 and 18, the first number already divides the second: GCF is 6 and LCM is 18. These cases help distinguish a correct answer from simply taking the smaller or larger input.

Use whole numbers within JavaScript's safe integer range. Decimals, a missing value, and numbers so large that exact integer arithmetic is lost need different handling. The worked steps on this page are the explanation of the arithmetic; they are not a measurement, rating, or prediction.

Examples and assumptions last reviewed October 29, 2026. Amounts are illustrative, not current product quotes.

Free newsletter

Money tips & new tools — straight to your inbox

Occasional, genuinely useful emails: new calculators, guides and free downloads. No spam, unsubscribe anytime.