# GCD and LCM calculator > What do these numbers have in common? The greatest common divisor and the least common multiple of two to ten whole numbers, with the Euclidean steps. Free GCD and LCM calculator: the greatest common divisor and least common multiple of two to ten whole numbers, of any size, with the Euclidean algorithm steps. - Page: https://how.box/gcd/ - Runs entirely in the browser. - License: HowToolbox's own text and data (titles, explanations, FAQs, tool descriptions and schemas, this file) are CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/); AI training and answers are welcome. Attribute "HowToolbox (how.box)" with a link to the page used. Third-party data keeps its own terms; the name and logo are not licensed. Publisher: HowToolbox, contact@how.box. Terms: https://how.box/about/terms/ ## Inputs Answer link: https://how.box/gcd/?n={n}&s={s} - `n` (text): 2 to 10 whole numbers separated by commas. Example: `1071,462`. - `s` (gcd or lcm): Which answer comes first: gcd or lcm. Example: `lcm`. Example answer: https://how.box/gcd/?n=1071%2C462&s=lcm A complete link carries the primary answer in the page HTML; a missing or invalid value shows the default page. ## Agent tools - `gcd_calculate`: Greatest common divisor (gcd, also called greatest common factor) and least common multiple (lcm) of 2 to 10 whole numbers of up to 40 digits each, exact. - MCP, one POST to https://how.box/mcp: `{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"gcd_calculate","arguments":{"numbers":"1071,462","show":"lcm"}}}` - GET: https://how.box/mcp/run/gcd_calculate?numbers=1071%2C462&show=lcm ## How it works The greatest common divisor of some whole numbers is the largest number that divides every one of them without a remainder: the GCD of 24 and 36 is 12. The least common multiple is the smallest positive number that every one of them divides: the LCM of 4 and 6 is 12. The GCD is what you divide by to simplify a fraction, and the LCM is the common denominator for adding fractions. The Euclidean algorithm finds the GCD by repeated division: divide the larger number by the smaller, then the smaller by the remainder, and so on until the remainder is 0. The last divisor is the GCD. For 48 and 18: 48 = 2 × 18 + 12, then 18 = 1 × 12 + 6, then 12 = 2 × 6 + 0, so the GCD is 6. The LCM then follows from lcm(a, b) = a ÷ gcd(a, b) × b, which gives 48 ÷ 6 × 18 = 144. For more than two numbers the answer is built pair by pair: gcd(a, b, c) = gcd(gcd(a, b), c), and the same for the LCM. The signs of numbers are ignored. The GCD of 0 and a number is that number, gcd(0, 0) is defined as 0, and the LCM is 0 whenever one of the numbers is 0. Calculations are exact, for numbers of up to 40 digits. ## FAQ **What is the difference between GCD and LCM?** The GCD is the biggest number that fits into all of the numbers, so it is never larger than the smallest of them. The LCM is the smallest number that all of them fit into, so it is never smaller than the largest of them. **What does it mean if the GCD is 1?** The numbers share no factor except 1, so they are called coprime. 8 and 15 are coprime even though neither is prime. The LCM of two coprime numbers is simply their product. **Is GCD the same as GCF or HCF?** Yes. Greatest common factor, highest common factor and greatest common divisor are different names for the same number. **How do I use the GCD to simplify a fraction?** Divide the top and the bottom by their GCD. For 18/48 the GCD is 6, so the fraction simplifies to 3/8. **Can I enter negative numbers?** Yes. The signs are ignored, so negative numbers give the same divisors and multiples as their positive counterparts. More: [HowToolbox index](https://how.box/llms.txt) · [Agent Skill](https://how.box/skill.md) · [agent terms](https://how.box/about/agents/)