← Math & statistics

GCD & LCM Calculator (step-by-step)

Compute GCD (greatest common divisor) and LCM (least common multiple) with Euclid steps, ladder method, and extended Euclid.

Other languages 日本語 | English | 简体中文 | 繁體中文 | 繁體中文(香港) | Español | Español (México) | Português (Brasil) | Português (Portugal) | Bahasa Indonesia | Tiếng Việt | 한국어 | Français | Deutsch | Italiano | Русский | हिन्दी | العربية | বাংলা | اردو | Türkçe | ไทย | Polski | Filipino | Bahasa Melayu | فارسی | Nederlands | Українська | עברית | Čeština

How to use this calculator effectively

Use this page when you need both the answer and the reasoning: the gcd/lcm summary, the Euclidean division log, the ladder view, and the Bézout identity all come from the same integer input.

Choose the right mode first

Use GCD/LCM for a list such as 48, 18, 30. Use Extended Euclid when you need coefficients x and y such that ax + by = gcd(a,b).

What the page shows

The result card reports the gcd, lcm, and normalised absolute values. The step log writes each Euclidean division as a = q·b + r, while the ladder view shows the repeated common-factor division visually.

When this is useful

This is a good fit for homework checks, board-work preparation, and quick verification before simplifying fractions, ratios, modular arithmetic, or Diophantine equations.

Common mistakes to avoid

What to compare with another tool

If another tool gives a different answer, compare the absolute-value normalisation first, then compare the Euclidean divisions line by line. Most disagreements come from sign handling, zero handling, or a non-step-based quick calculator using a different display convention.

How to read the outputs

GCD/LCM mode

In list mode, the page reduces the numbers pair by pair. The gcd shrinks through Euclid reductions, while the lcm grows from the previous lcm and the next absolute value using the gcd at each stage.

Extended Euclid mode

In EEA mode, the final combination line is the key teaching output. It shows exactly how the gcd is written as a linear combination of a and b, which is what you need for modular inverses and Bézout-style proofs.

Ladder view vs Euclid log

The ladder view is usually easier for introducing prime-factor style repeated division. The Euclid log is better when you want to connect the calculation directly to the division algorithm or to back-substitution.

Suggested classroom flow

Start with the preloaded sample, ask students to predict the gcd, then compare the ladder and Euclid views. After that, switch to EEA mode with 240 and 46 to show how the gcd becomes a linear combination.

When to move to another page

Use the quick GCD/LCM page for a fast answer only, the fraction simplifier for reduction, and the prime factorisation tool when you want the factor tree or prime exponents rather than Euclid-style steps.

Mode

Enter integers separated by commas or spaces (up to 64). Negative numbers and zeros are allowed.

Results

Toggle discussion points you want to highlight in class.

FAQ

What does the Euclidean log show?

Every reduction is written as a = q·b + r, so you can follow each gcd and lcm update and see how zeros are handled.

How do ladder steps differ from the Euclidean steps?

The ladder (repeated division) view shows the prime pulled out on the left and the divided numbers on the right, while the Euclidean steps list each a = q·b + r division. Both describe the same gcd reductions.

Why do negative signs disappear in the gcd and lcm?

The gcd and lcm are defined from absolute values, so the calculator normalises signs before reducing the list. Signs return only in the Bézout coefficients for extended Euclid.

Why does the lcm become 0 when one input is 0?

This tool follows the standard convention that any lcm involving 0 is 0. The note below the result explains that once 0 appears, later lcm steps stay at 0.

When should I use Extended Euclid instead of the list mode?

Use Extended Euclid when you need coefficients for ax + by = gcd(a,b), such as modular inverses or proof-style exercises. Use list mode when you only need gcd and lcm for several integers.

Related calculators