AskANumber.com

GCD & LCM Calculator

For the defaults, GCD(24, 36) = 12 and LCM(24, 36) = 72. The greatest common divisor (GCD) is the largest integer that divides both numbers evenly, and the least common multiple (LCM) is the smallest positive integer both numbers divide into; the GCD comes from the Euclidean algorithm, and the LCM follows from the identity LCM = |a·b| ÷ GCD.

GCD
12
LCM
72
Inputs
gcd & lcm of and
Use the GCD to reduce fractions
GCD 12 means the fraction 24/36 reduces to 2/3 — divide the numerator and denominator by their greatest common divisor.
GCD and LCM multiply to a × b
The identity GCD × LCM = a × b holds here: 12 × 72 = 864. That relationship is exactly how the LCM is computed from the GCD.
Ask a follow-up
Uses your inputs above
12 gcd. Want to try a variation?

The math

Reviewed 2026
Formula
GCD: Euclidean algorithm; LCM = |a·b| / GCD

Related calculators

Example: how gcd / lcm is calculated

Step-by-step with default inputs

Suppose you put the default values into GCD & LCM Calculator:

A
24
B
36

Plug those into the formula GCD: Euclidean algorithm; LCM = |a·b| / GCD and the result is:

GCD
12

How does the gcd & lcm calculator work?

GCD & LCM Calculator uses the formula shown in the math card and is computed from first principles. Inputs are validated for sensible ranges; results are computed client-side for instant feedback and do not leave your browser.

Last reviewed July 2, 2026 · Editorial policy

Frequently asked questions

How do you find the GCD of two numbers by hand?

Use the Euclidean algorithm: divide the larger number by the smaller and keep the remainder, then repeat with the smaller number and that remainder until the remainder is 0. For 36 and 24: 36 ÷ 24 leaves 12, then 24 ÷ 12 leaves 0, so the GCD is 12.

How are GCD and LCM related?

Their product equals the product of the two numbers: GCD × LCM = |a × b|. For 24 and 36 that is 12 × 72 = 864 = 24 × 36, which is why the calculator can get the LCM directly from the GCD without factoring either number.

What does it mean if the GCD is 1?

The two numbers are coprime — they share no factor larger than 1, like 8 and 15. In that case the LCM is simply the product of the two numbers, and a fraction built from them is already in lowest terms.

How accurate is this gcd / lcm calculator?

The math is deterministic — the same inputs always produce the same output, and the formula is shown above. Accuracy of the answer for your situation depends on how well your inputs match reality and how well the formula models the question.

How do I share my result?

Hit Share at the top of the page. Every input you change is encoded in the URL, so a permalink reproduces exactly what you see. No account needed.