CalcSeed

GCD & LCM Calculator

Find the greatest common divisor (GCD) and least common multiple (LCM) of two whole numbers.

=
Quick answer: with the default inputs (48, 18), the gcd is 6. At these inputs: lCM = 144. Change any input to update the result.
GCD
—

What this calculator does

Enter two whole numbers and the calculator returns both the greatest common divisor (GCD) and the least common multiple (LCM). At its defaults — 48 and 18 — the GCD is 6 and the LCM is 144. The GCD is the largest number that divides both inputs exactly; the LCM is the smallest number that both divide into exactly. One measures shared structure, the other shared reach.

The identity linking GCD and LCM

a·b=gcd(a,b)·lcm(a,b)a \times b = gcd(a,b) \times lcm(a,b)

The product of the two numbers always equals the product of their GCD and LCM. On the defaults: 48 × 18 = 864, and 6 × 144 = 864. This identity makes the LCM free once you know the GCD: lcm = a × b ÷ gcd(a, b) = 864 ÷ 6 = 144. It is why every GCD calculator is automatically an LCM calculator, and why the two answers move in opposite directions — numbers with a large GCD share factors and so have a relatively small LCM.

Worked example: the Euclidean algorithm on 48 and 18

  • Divide 48 by 18: remainder 12 (48 = 2 × 18 + 12).
  • Divide 18 by 12: remainder 6 (18 = 1 × 12 + 6).
  • Divide 12 by 6: remainder 0. The last non-zero remainder, 6, is the GCD.
  • LCM = 48 × 18 ÷ 6 = 864 ÷ 6 = 144.

Each step replaces the pair with the smaller number and the remainder, and the remainders shrink fast — which is why the algorithm beats factor listing. Reducing 48/18 by hand means scanning the divisors of 48 (1, 2, 3, 4, 6, 8, 12, 16, 24, 48); the Euclidean path above takes three divisions. The same 6 reduces the fraction 48/18 to 8/3, its lowest terms.

Prime factorization as a second method

Factor both numbers and compare exponents. 48 = 2⁴ × 3 and 18 = 2 × 3². The GCD takes each prime at the minimum exponent: 2² × 3¹ = 6. The LCM takes each prime at the maximum: 2⁴ × 3² = 144. Both routes land on the same pair of answers, and the min/max framing makes the identity a × b = gcd × lcm obvious — min plus max equals the sum of the two exponents.

Common pairs

abGCDLCM
1218636
24361272
48186144
713191
1007525300

Note the pattern: when the GCD is 1 (7 and 13), the numbers are coprime and the LCM is simply their product, 91. When one number divides the other exactly (12 and 24), the smaller is the GCD and the larger is the LCM. The defaults row — 48 and 18 giving 6 and 144 — sits between these extremes, sharing a 6 but neither containing the other.

Why the LCM syncs schedules

If one bus runs every 12 minutes and another every 18, they meet whenever the elapsed time is a multiple of both intervals — that is, at multiples of lcm(12, 18) = 36 minutes. The LCM is the general answer to "when do two repeating cycles line up", which is why it drives gear teeth counts, event calendars and rhythmic patterns in music. The same arithmetic with the defaults: a machine that cycles every 48 seconds and an inspection that runs every 18 seconds coincide every 144 seconds, or 2 minutes 24 seconds.

Where the GCD does the work

  • Reducing fractions. 48/18 divides top and bottom by gcd = 6 to give 8/3, the form tests expect.
  • Tiling and cutting. The largest square tile that covers a 48 × 18 inch strip without cutting is gcd(48, 18) = 6 inches; you need 8 × 3 = 24 tiles.
  • Dividing groups evenly. 48 students and 18 chaperones form equal teams with at most gcd = 6 people from each group, giving 8 student teams and 3 chaperone teams.
  • Modular arithmetic and cryptography. RSA keys rely on finding numbers coprime to a modulus, which means checking gcd = 1.
  • Simplifying gear ratios. A 48-tooth to 18-tooth drive is 8:3 after dividing by 6, the same reduction as the fraction.

Common mistakes

  • Confusing GCD with LCM. For 48 and 18, 6 divides both; 144 is divided by both. They are not interchangeable, and 144 is not a divisor of 48.
  • Stopping the Euclidean algorithm early. The GCD is the last non-zero remainder. The zero remainder itself is not the answer.
  • Computing LCM as a × b without dividing. 48 × 18 = 864 is a common multiple but not the least; dividing by the GCD gives 144.
  • Assuming bigger inputs mean bigger GCD. gcd(48, 18) = 6 but gcd(49, 18) = 1; a one-unit change can wipe out every shared factor.
  • Using the LCM where the GCD belongs. Reducing 48/18 by 144 is impossible; reduction always divides by the GCD, while finding a shared cycle always uses the LCM.

Three numbers and beyond

Both operations extend by iteration. For three numbers, gcd(a, b, c) = gcd(gcd(a, b), c) and the LCM works the same way: lcm(12, 18, 30) = lcm(36, 30) = 180. The clean two-number shortcut lcm = a × b ÷ gcd no longer suffices for triples, so chain pairwise LCMs instead. For very large inputs the Euclidean algorithm stays fast: it needs at most about five times the number of digits of the smaller input in division steps, which is why the GCD of two nine-digit numbers still computes instantly while factor-listing would take pages.

Frequently asked questions

How do I find the greatest common divisor?

Run the Euclidean algorithm: replace the larger number with the remainder of dividing it by the smaller, repeating until the remainder is 0. For 48 and 18 the remainders are 12, then 6, then 0, so the GCD is 6.

How do I find the least common multiple?

Multiply the two numbers and divide by their GCD. For 48 and 18: 864 ÷ 6 = 144.

What is the GCD and LCM of 48 and 18?

GCD = 6 and LCM = 144. The identity confirms it: 48 × 18 = 864 = 6 × 144.

What if two numbers share no common factor?

Their GCD is 1 and they are coprime; the LCM is then their product. 7 and 13 give gcd = 1 and lcm = 91.

How do I reduce the fraction 48/18?

Divide numerator and denominator by gcd(48, 18) = 6, giving 8/3. The Euclidean algorithm finds the 6 in three steps.

When do two repeating events line up?

At multiples of their LCM. A bus every 12 minutes and one every 18 minutes coincide every lcm(12, 18) = 36 minutes.

What is the largest square tile for a 48 by 18 inch space?

gcd(48, 18) = 6 inches. The space takes 8 tiles across and 3 down, 24 tiles in all.

How does the Euclidean algorithm work step by step?

48 mod 18 = 12, 18 mod 12 = 6, 12 mod 6 = 0. Each step keeps the smaller number and the remainder; the last non-zero remainder, 6, is the GCD.

How do I find the GCD of three numbers?

Chain it: gcd(a, b, c) = gcd(gcd(a, b), c). For 12, 18 and 30: gcd(12, 18) = 6, then gcd(6, 30) = 6.

Why does a × b equal gcd times lcm?

Each prime factor contributes its minimum exponent to the GCD and its maximum to the LCM, and min + max equals the sum of both exponents — so the two products always match: 6 × 144 = 864 = 48 × 18.

Method and sources

Calculation basis

Results follow exact mathematical definitions; the arithmetic is deterministic and can be verified by hand from the steps shown.

Last updated: November 19, 2026
Formula & data sources
  • Euclidean algorithm and the identity a x b = gcd(a,b) x lcm(a,b).

Cite this page

Reference formats
APA 7CalcSeed. (2026, November 19). GCD & LCM Calculator. https://calcseed.com/c/math/gcd-lcm-calculator/
MLA 9"GCD & LCM Calculator." CalcSeed, 19 Nov. 2026, calcseed.com/c/math/gcd-lcm-calculator/.
ChicagoCalcSeed. "GCD & LCM Calculator." Last modified November 19, 2026. https://calcseed.com/c/math/gcd-lcm-calculator/

Related calculators