What Is This Tool?
The greatest common divisor (GCD) of a set of numbers is the largest number that divides all of them with no remainder. The least common multiple (LCM) is the smallest number that all of them divide into evenly. This tool computes both using the Euclidean algorithm, which repeatedly replaces the larger number with the remainder of dividing it by the smaller one until the remainder reaches zero — the last nonzero remainder is the GCD.
Once the GCD is known, the LCM follows directly from the relationship LCM(a, b) = (a × b) ÷ GCD(a, b), extended pairwise for three or more numbers. Both values are fundamental in simplifying fractions, working with ratios, and solving scheduling problems where events repeat on different cycles.
Why Use It?
- Calculates GCD and LCM together for two or more integers in one step.
- Shows the Euclidean algorithm's working, not just the final answer.
- Handles any number of inputs, not just pairs.
- Instant results as you type — no page reload.
- Free and private — everything runs in your browser.
How to Use
- Enter two or more whole numbers, separated by commas or in separate fields.
- The calculator applies the Euclidean algorithm automatically.
- Read the GCD and LCM results.
- Expand the steps to see exactly how each division and remainder led to the answer.
Example
Input
48 and 18Output
GCD = 6, LCM = 144Euclidean algorithm: 48 = 2×18 + 12, 18 = 1×12 + 6, 12 = 2×6 + 0 — the last nonzero remainder, 6, is the GCD. LCM = (48×18)/6 = 144.
GCD vs LCM at a glance
| GCD | LCM | |
|---|---|---|
| Full name | Greatest Common Divisor | Least Common Multiple |
| What it finds | Largest shared factor | Smallest shared multiple |
| Result vs inputs | Always ≤ the smallest input | Always ≥ the largest input |
| Typical use | Simplifying fractions | Common denominators, repeating schedules |
Related tools
For other everyday and math calculations that pair well with GCD and LCM, try these tools.
→ Percentage Calculator · Rule of Three Calculator · Unit Converter
Frequently Asked Questions
What is the difference between GCD and LCM?
The GCD (greatest common divisor, also called HCF or highest common factor) is the largest number that divides two or more numbers exactly. The LCM (least common multiple) is the smallest number that those numbers all divide into exactly. GCD shrinks toward a shared factor; LCM grows toward a shared multiple.
How do you calculate GCD by hand with the Euclidean algorithm?
Divide the larger number by the smaller one and note the remainder. Replace the larger number with the smaller number, and the smaller number with the remainder. Repeat until the remainder is zero — the last nonzero remainder is the GCD. For example, for 48 and 18: 48 ÷ 18 leaves remainder 12; 18 ÷ 12 leaves remainder 6; 12 ÷ 6 leaves remainder 0, so the GCD is 6.
How is LCM calculated from GCD?
For two numbers, LCM(a, b) = (a × b) ÷ GCD(a, b). For 48 and 18, that's (48 × 18) ÷ 6 = 144. For three or more numbers, apply the same formula pairwise: find the LCM of the first two, then find the LCM of that result with the next number, and so on.
Where does GCD/LCM show up in everyday life?
GCD simplifies fractions to their lowest terms (dividing numerator and denominator by their GCD) and helps split items into the largest possible equal groups. LCM is what you need when lining up repeating cycles — for example, figuring out when two events with different repeat intervals will next fall on the same day, or finding a common denominator when adding fractions.
Can this calculator handle more than two numbers?
Yes. Enter as many whole numbers as you need; the tool finds the GCD and LCM shared across all of them by applying the pairwise algorithm sequentially.
Is my data stored anywhere?
No. The calculation runs entirely in your browser with JavaScript; nothing you enter is sent to a server, stored or logged.