GCF and LCM Calculator

GCF and LCM calculator: find the greatest common factor and least common multiple of two or more numbers instantly. Free, runs in your browser, no signup.

Updates automatically as you type.

Calculated in your browser; your inputs are not sent to us. Privacy

Results will appear here.
Calculation details
Every figure above is calculated locally in your browser from the assumptions shown. No inputs are sent anywhere. See the methodology section below for the formulas used.
Use this resultShare the current inputs, or ask ChatGPT to explain the calculation in context.
Ask an AI to explain this result
Share this result

Planning estimate only, not financial, tax, or legal advice. Verify assumptions and current rules before making decisions.

This tool runs in your browser. Your calculator inputs and results are never transmitted to us or to ad/affiliate partners. Ads and sponsored links may set third-party cookies to serve and measure them, but they never receive your calculation values. If you explicitly save a scenario, its permitted fields stay in local browser storage until you clear them. See our Privacy Policy.

Use this result

Share the current inputs or ask ChatGPT to explain the calculation in context.

More options
Report a calculation issue
Direct answer

What does this calculator estimate?

GCF and LCM calculator: find the greatest common factor and least common multiple of two or more numbers instantly. Free, runs in your browser, no signup.

Bar chart ranking GCF and LCM values for 12 and 18
LCM of 12 and 18 is 36, not 216.
Transparent methodology

How this calculator works

Reviewed August 2026 · BoringToolsKit Editorial Team

Formula

GCF: largest integer dividing both numbers (Euclid). LCM = a x b / GCF.

Worked example

For 12 and 18: GCF 6, LCM 36.

Cite this tool

BoringToolsKit. “GCF and LCM Calculator.” boringtoolskit.com/gcf-lcm-calculator/ (reviewed August 2026). Free to reference in articles, syllabi, and answer posts with a link.

Privacy: Inputs and results stay in this browser. Any future sponsored recommendation or advertisement will be clearly labeled and kept separate from the calculation.

Worked example: GCF and LCM of 12 and 18

Enter 12 for a and 18 for b. The page runs the Euclidean algorithm on the pair: divide 18 by 12, remainder 6; divide 12 by 6, remainder 0. The last nonzero remainder is 6, so GCF = 6. No factoring was needed, which is exactly why the algorithm is preferred: it stays fast even when the inputs are large.

The LCM then falls out of the identity LCM = (a x b) / GCF. Here that is (12 x 18) / 6 = 216 / 6 = 36. You can confirm it by listing multiples: 12, 24, 36 and 18, 36, so 36 is the smallest shared one. Note that 36 is smaller than the raw product 216 by a factor of exactly the GCF, which is why dividing by GCF matters: skipping it gives the product, not the least common multiple.

The prime factorization view agrees: 12 = 2^2 x 3 and 18 = 2 x 3^2. Take the lowest power of each shared prime for GCF (2^1 x 3^1 = 6) and the highest power for LCM (2^2 x 3^2 = 36).

Edge cases the input check deliberately blocks

The page requires both values to be integers of at least 1, so a few inputs that have valid mathematics get rejected. GCF(0, 8) is conventionally 8, and GCF of negatives is well-defined via absolute values, but the calculator returns its Check inputs message instead. Treat 0 and negatives as out of scope rather than bugs.

Precision is the practical limit at the top end. JavaScript numbers are 64-bit floats, exact only up to 2^53, which is 9,007,199,254,740,992. Inputs near that ceiling can round silently before the algorithm runs. There is also an overflow risk in the LCM: for a = b = 3,037,000,497 (both prime), the product a x b is about 9.2 x 10^18, above the exact-integer range, so the displayed LCM may be off by a small amount even though GCF = 3,037,000,497 is correct. Keep both inputs under roughly 1 billion if you need the LCM to be trustworthy.

The calculator computes one pair at a time. For three or more numbers, chain it: GCF(24, 36, 60) is GCF(GCF(24, 36), 60) = GCF(12, 60) = 12, and the LCM chains the same way, LCM(LCM(24, 36), 60) = LCM(72, 60) = 360.