HandyTools Hub

GCD & LCM Calculator

Calculate the Greatest Common Divisor and Least Common Multiple for multiple numbers

100% client-side processing

The GCD & LCM Calculator finds the greatest common divisor and least common multiple of any set of whole numbers, with step-by-step working shown. Students use it for homework and fractions, teachers use it to demonstrate the Euclidean algorithm, and engineers reach for it in gear ratios and scheduling.

How to Use

  1. Enter numbers: type two or more whole numbers, separated by commas or spaces
  2. View results: the GCD and LCM appear instantly
  3. Check steps: click Show Steps to follow the full calculation

Features

  • Greatest Common Divisor (GCD) — the largest number dividing all inputs evenly
  • Least Common Multiple (LCM) — the smallest multiple shared by all inputs
  • Step-by-step solution — see the full calculation process
  • Any number of inputs — not limited to two numbers
  • One-click copy — grab results for notes or homework

How GCD and LCM Are Calculated

The GCD uses the Euclidean algorithm, described around 300 BC and still the fastest practical method. For GCD(48, 18): 48 ÷ 18 leaves 12, 18 ÷ 12 leaves 6, 12 ÷ 6 leaves 0 — the last non-zero remainder, 6, is the answer. Each step shrinks the problem, so even huge numbers resolve in a few divisions.

The LCM then comes free via LCM(a, b) = a × b ÷ GCD(a, b): 48 × 18 ÷ 6 = 144. The two are mirror images — the GCD asks what biggest piece fits into both numbers, the LCM what smallest container holds both.

Use Cases

  • Fraction simplification: divide top and bottom by the GCD
  • Scheduling: the LCM shows when recurring events coincide
  • Engineering: gear ratios and belt timing problems
  • Homework: check answers against the visible steps

Frequently Asked Questions

What is GCD?

GCD (Greatest Common Divisor) is the largest positive integer that divides all input numbers evenly without a remainder.

What is LCM?

LCM (Least Common Multiple) is the smallest positive integer that is a multiple of all input numbers.

Can I calculate GCD/LCM for more than two numbers?

Yes, enter multiple numbers separated by commas or spaces. The calculator handles any number of inputs.

How are the results calculated?

The GCD is found with the Euclidean algorithm — repeatedly replacing the larger number by the remainder of dividing the two — which runs fast even for very large inputs. The LCM then follows from the identity LCM(a, b) = a × b ÷ GCD(a, b).