GCD & LCM Calculator — Free Online | EverydayCalcSkip to main content
everydaycalc.

Find calculators and file viewers

Press Esc to close · / or Ctrl+K to open

Home›Math & Scientific›GCD & LCM Calculator
Math & Scientific

GCD & LCM Calculator

Find the greatest common divisor and least common multiple of two nonnegative whole numbers.

✦ INSTANT CALCULATION

GCD & LCM Calculator

YOUR RESULT
—

ⓘ Calculated locally in your browser. Results depend on the values and units you enter.

Interactive mathematical graph

The axes, points and dimensions are recalculated from the values you enter.

What changes if one input changes?

43: 1 GCD · 48: 12 GCD · 53: 1 GCD

How this calculator works

The greatest common divisor (GCD, also called GCF) is the largest whole number that divides both inputs. The least common multiple (LCM) is the smallest nonnegative common multiple. The Euclidean algorithm finds the GCD exactly, then LCM = (a ÷ GCD) × b for two nonzero numbers. GCD(0, 0) is undefined.

Formula and reasoning

gcd(a,0) = a; gcd(a,b) = gcd(b, a mod b)

  1. 1. Start with the measurements
    First whole number48Second whole number180
  2. 2. Substitute into the formula

    First whole number = 48 ? Second whole number = 180

  3. 3. Check the computed answer

    Result for the sample inputs12 GCD

Worked example

GCD(48, 180) = 12 and LCM(48, 180) = 720.

Frequently asked questions

Are decimal numbers accepted?

No. GCD and LCM operate on whole numbers; enter nonnegative integers.

What if one number is zero?

The GCD is the nonzero number and the LCM is zero. Both zero is rejected as undefined.

Results are informational and assume the stated inputs and formulas. Double-check critical financial or engineering decisions with a qualified professional.

Add this calculator to your website

Share a working calculator on your blog or website. Choose a fixed size or let the height fit the content.

Fixed height

Works on websites that accept iframe HTML.

Responsive height

Automatically adjusts the height. Your website must allow scripts.

Open calculator preview ↗

Powered by EverydayCalc