Find the greatest common divisor and least common multiple of two numbers — free and instant.
The greatest common divisor (GCD, also called GCF or HCF) is the largest number that divides both inputs evenly — computed here using the Euclidean algorithm, the same fast, ancient method taught in most math courses. The least common multiple (LCM) is the smallest number both inputs divide into evenly, computed from the GCD using the identity LCM(a,b) = |a×b| ÷ GCD(a,b).
Both figures are commonly needed for simplifying fractions (GCD) and finding a common denominator (LCM), among other uses.
Worked example (the Euclidean algorithm, step by step): to find GCD(48, 18), repeatedly divide and keep the remainder until it hits zero — 48 = 2×18 + 12, then 18 = 1×12 + 6, then 12 = 2×6 + 0. The last non-zero remainder is the GCD, so GCD(48,18) = 6. From there, LCM = (48×18) / 6 = 864 / 6 = 144. A common mistake is trying to find the GCD by listing out every factor of both numbers — that works for small numbers but gets slow and error-prone fast, which is exactly the problem the Euclidean algorithm was invented to avoid.
The two numbers are "coprime" (or "relatively prime") — they share no common factors other than 1, even if neither number is itself prime.
Not directly here — for three or more numbers, compute the GCD or LCM of the first two, then combine that result with the next number, repeating as needed.
GCD and LCM are conventionally defined for positive integers — enter positive numbers here.