Loading…
Greatest common divisor and least common multiple of two or more numbers via Euclid's algorithm.
GCD & LCM Calculator is loading — interactive editor will appear here. Use examples below to try instantly once loaded.
Press ? for keyboard shortcuts
Computes the greatest common divisor (GCD) and least common multiple (LCM) of two or more whole numbers using Euclid's algorithm.
GCD and LCM are the workhorses of fraction arithmetic, scheduling problems, and number theory. GCD reduces fractions to lowest terms; LCM finds when repeating cycles coincide. Computing them by hand means factorizing, which is slow and error-prone.
This tool is part of the DevStackIO platform — a collection of free online developer tools from DevStackIO. Browse more free developer resources on DevStackIO.
Students in arithmetic or number theory, programmers writing scheduling or tiling logic, teachers preparing GCF/LCM exercises, and anyone simplifying fractions.
Enter two or more whole numbers separated by commas or spaces
Read the GCD and LCM in the results panel
The raw identities are shown below so you can verify them
gcd(12, 18) = 6, lcm(12, 18) = 36gcd(24, 36, 60) = 12, lcm(24, 36, 60) = 360gcd(7, 13) = 1 (coprime), lcm(7, 13) = 91gcd(0, 5) = 5 — the GCD with zero is the other numbergcd(48, 180) = 12, lcm(48, 180) = 720Q: What's the difference between GCD and GCF? A: They're the same thing
greatest common divisor and greatest common factor.
Q: Can I enter more than two numbers? A: Yes
the algorithm reduces gcd(a, b, c) = gcd(gcd(a, b), c) and the same for LCM.
Q: What happens with negative numbers?
A: Their absolute values are used, per the standard convention.
Q: Is this Euclid's algorithm? A: Yes
the original 'Elements' algorithm, repeatedly replacing (a, b) with (b, a mod b).
Authoritative specifications, standards, and in-depth reading for GCD & LCM Calculator.
Greatest common divisor
6
Least common multiple
36
gcd(12, 18) = 6 · lcm(12, 18) = 36
Computed with Euclid’s algorithm. Identity check: for two numbers, |a × b| = gcd(a,b) × lcm(a,b). Runs locally.
Add, subtract, multiply, and divide fractions with exact rational arithmetic — no floating-point drift. Simplifies automatically.
Simplify ratios, split a total in a given ratio, and solve proportions a:b = c:x.
Descriptive statistics for a list of numbers: mean, median, mode, range, variance, standard deviation.
Compute nCr (combinations) and nPr (permutations) with exact integer arithmetic. Supports large n via logarithms.
Solve ax² + bx + c = 0, including complex conjugate roots.
Splits restaurant bills from subtotal, tip %, tax and party size. Use when dining out or splitting; differs from vat-gst by gratuity split vs tax-inclusive pricing. Returns tip amount, total and per-person share. 100% client-side.
Scientific calculator with trig and logs. Use for advanced math; for datasets use statistics-calculator. Input: expression. Returns result. 100% client-side, files never leave browser.
Compute mean, median and stddev. Use for datasets; for single expressions use scientific-calculator. Input: numbers ≤10MB. Returns stats. 100% client-side, files never leave browser.