CalcWorldHub
Free online calculator · no signup

GCD & LCM calculator

The greatest common divisor is the largest positive integer dividing every input. The least common multiple is the smallest positive integer divisible by all inputs.

Calculator

4,000 tools
GCD & LCM calculator — Integers (comma-separated) and calculation method
GCD & LCM calculator: inputs and calculation method.

How to use this calculator

Find the greatest common divisor and least common multiple of positive integers using the Euclidean algorithm.

  1. Enter Integers (comma-separated). Match the units shown beside each field and review the result together with the assumptions below.
  2. Read the worked example below to check the expected input format and result.
  3. Compare another scenario by changing one input at a time. Use Reset to return to the starting values.

Find the greatest common divisor and least common multiple

The greatest common divisor is the largest positive integer dividing every input. The least common multiple is the smallest positive integer divisible by all inputs.

Inputs and units

Formula and method

The Euclidean algorithm repeatedly replaces a pair (a,b) with (b, a mod b) until the remainder is zero. For two positive integers, lcm(a,b) = a × b ÷ gcd(a,b); repeat across the list.

Worked example

For 12, 18, and 30, gcd(12,18,30) = 6. The common multiples are multiples of 180, so the least common multiple is 180.

Interpreting the result

Six is the largest factor shared by all three values, while 180 is the first positive value in all three multiplication tables.

Assumptions and limits

Inputs are integers and the result must fit the supported range. The LCM can grow much larger than any single input.

Frequently asked questions

Can the GCD be larger than an input?

No. For positive inputs it cannot exceed the smallest input.

Why can the LCM be much larger?

It must contain the prime factors needed to be divisible by every input, including factors not shared by the others.

How do I use the GCD & LCM calculator?

Enter Integers (comma-separated). Match the units shown beside each field and review the result together with the assumptions below.

What is a worked example of GCD & LCM?

For 12, 18, and 30, gcd(12,18,30) = 6. The common multiples are multiples of 180, so the least common multiple is 180.

What does the GCD & LCM calculator calculate?

Find the greatest common divisor and least common multiple of positive integers using the Euclidean algorithm.

Good calculators show their work.

CalcWorldHub is built around clear inputs and visible assumptions. Results are estimates for planning; check official sources or your provider’s terms when exact figures matter.

✓ Results update instantly
✓ No account required
✓ Privacy-friendly by design
✓ US and metric units