{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"gcd-lcm"},"result":{"entity_type":"calculator","id":"gcd-lcm","calculator_id":"gcd-lcm","canonical_url":"https://tttkmbb.com/math/gcd-lcm","name":"GCD and LCM Calculator","title":"GCD and LCM Calculator – Greatest Common Divisor and Least Common Multiple of Integers","category":"math","category_name":"Math","tool_name":"calculate_gcd_lcm","featured_mcp_tool":false,"description":"Computes the greatest common divisor (highest common factor) and least common multiple of two or more integers with the Euclidean algorithm.","use_when":"You need the GCD/HCF or LCM of a list of integers, e.g. to reduce fractions, find a common denominator or check whether numbers are coprime.","do_not_use_when":"You need the prime factors themselves (use prime-factorization) or want to reduce a single fraction (use fraction-simplifier).","inputs":[{"name":"numbers","label":"Integers","type":"number_list","required":true,"description":"Two or more integers, comma-separated (e.g. 12, 18, 24). Negative values are treated by their absolute value.","example":[12,18]}],"outputs":[{"name":"gcd","label":"GCD","type":"integer","decimals":0,"description":"Greatest common divisor of all the numbers."},{"name":"lcm","label":"LCM","type":"integer","decimals":0,"description":"Least common multiple of all the numbers."},{"name":"coprime","label":"Coprime","type":"boolean","decimals":4,"description":"true when the GCD is 1 (the numbers share no common factor)."}],"input_schema":{"type":"object","properties":{"numbers":{"description":"Two or more integers, comma-separated (e.g. 12, 18, 24). Negative values are treated by their absolute value.","type":"array","items":{"type":"number"},"minItems":2,"examples":[[12,18]]}},"additionalProperties":false,"required":["numbers"]},"output_schema":{"type":"object","properties":{"gcd":{"description":"Greatest common divisor of all the numbers.","type":"integer"},"lcm":{"description":"Least common multiple of all the numbers.","type":"integer"},"coprime":{"description":"true when the GCD is 1 (the numbers share no common factor).","type":"boolean"}}},"formula":"gcd(a, b) by the Euclidean algorithm (gcd(a, b) = gcd(b, a mod b)); lcm(a, b) = |a × b| / gcd(a, b); both are folded over the list: gcd(a, b, c) = gcd(gcd(a, b), c)","sources":[{"name":"Wikipedia – Greatest common divisor","url":"https://en.wikipedia.org/wiki/Greatest_common_divisor","type":"reference","retrieved_at":"2026-09-23"},{"name":"Wikipedia – Least common multiple","url":"https://en.wikipedia.org/wiki/Least_common_multiple","type":"reference","retrieved_at":"2026-09-23"},{"name":"Wolfram MathWorld – Greatest Common Divisor","url":"https://mathworld.wolfram.com/GreatestCommonDivisor.html","type":"reference","retrieved_at":"2026-09-23"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"12 and 18","inputs":{"numbers":[12,18]},"expected":{"gcd":6,"lcm":36,"coprime":false},"url":"https://tttkmbb.com/api/v1/calculate/gcd-lcm?numbers=12%2C18"},{"name":"4, 6 and 8","inputs":{"numbers":[4,6,8]},"expected":{"gcd":2,"lcm":24,"coprime":false},"url":"https://tttkmbb.com/api/v1/calculate/gcd-lcm?numbers=4%2C6%2C8"}],"faq":[{"q":"Is HCF the same as GCD?","a":"Yes. Highest common factor (HCF), greatest common factor (GCF) and greatest common divisor (GCD) are the same quantity."},{"q":"How large can the numbers be?","a":"Any integers whose LCM stays below 2^53 (about 9 × 10^15); larger results cannot be represented exactly and return an error."}],"tags":["gcd","lcm","greatest common divisor","least common multiple","hcf","euclidean algorithm"],"related":[{"calculator_id":"fraction-simplifier","reason":"Reduce a fraction by its GCD."},{"calculator_id":"prime-factorization","reason":"See the prime factors behind the GCD and LCM."},{"calculator_id":"ratio","reason":"Simplify a ratio by dividing by the GCD."}],"links":{"html":"https://tttkmbb.com/math/gcd-lcm","markdown":"https://tttkmbb.com/math/gcd-lcm.md","json":"https://tttkmbb.com/math/gcd-lcm.json","api":"https://tttkmbb.com/api/v1/calculate/gcd-lcm","schema":"https://tttkmbb.com/api/v1/calculators/gcd-lcm","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-23"},"timestamp":"2026-09-23T23:26:29Z","next_actions":[{"tool":"run_calculator","calculator_id":"gcd-lcm","reason":"Run GCD and LCM Calculator with the inputs above."}],"links":{"markdown":"https://tttkmbb.com/math/gcd-lcm.md"}}