{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"ratio"},"result":{"entity_type":"calculator","id":"ratio","calculator_id":"ratio","canonical_url":"https://tttkmbb.com/math/ratio","name":"Ratio Calculator","title":"Ratio Calculator – Simplify a:b, Convert to Decimal and Scale to a New Value","category":"math","category_name":"Math","tool_name":"calculate_ratio","featured_mcp_tool":false,"description":"Simplifies a ratio a:b to lowest terms (decimals are scaled to integers first), expresses it as a decimal, as n:1 and as percentage shares, and optionally scales it to a new value of a.","use_when":"You need to reduce a ratio, compare two quantities, or find the matching second value when the first is scaled (e.g. mixing or recipe ratios).","do_not_use_when":"You are solving a/b = c/x with three known values (use proportion) or reducing a fraction with sign handling (use fraction-simplifier).","inputs":[{"name":"a","label":"First quantity (a)","type":"number","required":true,"min":0.000001,"max":1000000000,"description":"First term of the ratio a:b. Decimals are allowed (rounded to 6 decimal places before simplifying).","example":6},{"name":"b","label":"Second quantity (b)","type":"number","required":true,"min":0.000001,"max":1000000000,"description":"Second term of the ratio a:b.","example":4},{"name":"new_a","label":"Scale: new value of a","type":"number","required":false,"exclusive_min":0,"description":"Optional new first quantity; returns the second quantity that keeps the same ratio.","example":9}],"outputs":[{"name":"simplified","label":"Simplified ratio","type":"string","decimals":4,"description":"a:b in lowest integer terms, e.g. '3:2'."},{"name":"decimal","label":"a ÷ b","type":"number","decimals":4,"description":"The ratio as a single number."},{"name":"ratio_to_one","label":"Ratio to 1","type":"string","decimals":4,"description":"The ratio written as n:1."},{"name":"one_to_ratio","label":"1 to ratio","type":"string","decimals":4,"description":"The ratio written as 1:n."},{"name":"share_a_percent","label":"Share of a","type":"number","unit":"%","decimals":2,"description":"a / (a + b) × 100."},{"name":"share_b_percent","label":"Share of b","type":"number","unit":"%","decimals":2,"description":"b / (a + b) × 100."},{"name":"new_b","label":"Scaled b","type":"number","decimals":4,"description":"new_a × b / a; only when new_a is given."}],"input_schema":{"type":"object","properties":{"a":{"description":"First term of the ratio a:b. Decimals are allowed (rounded to 6 decimal places before simplifying).","type":"number","minimum":0.000001,"maximum":1000000000,"examples":[6]},"b":{"description":"Second term of the ratio a:b.","type":"number","minimum":0.000001,"maximum":1000000000,"examples":[4]},"new_a":{"description":"Optional new first quantity; returns the second quantity that keeps the same ratio.","type":"number","exclusiveMinimum":0,"examples":[9]}},"additionalProperties":false,"required":["a","b"]},"output_schema":{"type":"object","properties":{"simplified":{"description":"a:b in lowest integer terms, e.g. '3:2'.","type":"string"},"decimal":{"description":"The ratio as a single number.","type":"number"},"ratio_to_one":{"description":"The ratio written as n:1.","type":"string"},"one_to_ratio":{"description":"The ratio written as 1:n.","type":"string"},"share_a_percent":{"description":"a / (a + b) × 100. Unit: %.","type":"number","x-unit":"%"},"share_b_percent":{"description":"b / (a + b) × 100. Unit: %.","type":"number","x-unit":"%"},"new_b":{"description":"new_a × b / a; only when new_a is given.","type":"number"}}},"formula":"simplified = (A / g):(B / g) with A, B = a, b scaled to integers and g = gcd(A, B); decimal = a / b; new_b = new_a × b / a","sources":[{"name":"Wikipedia – Ratio","url":"https://en.wikipedia.org/wiki/Ratio","type":"reference","retrieved_at":"2026-09-23"},{"name":"Wolfram MathWorld – Ratio","url":"https://mathworld.wolfram.com/Ratio.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":"6:4, scale a to 9","inputs":{"a":6,"b":4,"new_a":9},"expected":{"simplified":"3:2","decimal":1.5,"ratio_to_one":"1.5:1","one_to_ratio":"1:0.666667","share_a_percent":60,"share_b_percent":40,"new_b":6},"url":"https://tttkmbb.com/api/v1/calculate/ratio?a=6&b=4&new_a=9"},{"name":"2.5:1.5","inputs":{"a":2.5,"b":1.5},"expected":{"simplified":"5:3","decimal":1.6667,"share_a_percent":62.5},"url":"https://tttkmbb.com/api/v1/calculate/ratio?a=2.5&b=1.5"}],"faq":[{"q":"How are decimal ratios simplified?","a":"Both terms are multiplied by the same power of 10 until they are integers (2.5:1.5 → 25:15) and then divided by their GCD (5:3)."},{"q":"What does 'share' mean?","a":"The fraction of the total each term represents: in 3:2 the first part is 3 of 5, i.e. 60%."}],"tags":["ratio","simplify ratio","ratio to decimal","scale ratio","a to b"],"related":[{"calculator_id":"proportion","reason":"Solve a/b = c/x for the missing value."},{"calculator_id":"fraction-simplifier","reason":"The same reduction as a fraction."},{"calculator_id":"aspect-ratio","reason":"Ratios of image and screen dimensions."}],"links":{"html":"https://tttkmbb.com/math/ratio","markdown":"https://tttkmbb.com/math/ratio.md","json":"https://tttkmbb.com/math/ratio.json","api":"https://tttkmbb.com/api/v1/calculate/ratio","schema":"https://tttkmbb.com/api/v1/calculators/ratio","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-23"},"timestamp":"2026-09-23T23:25:41Z","next_actions":[{"tool":"run_calculator","calculator_id":"ratio","reason":"Run Ratio Calculator with the inputs above."}],"links":{"markdown":"https://tttkmbb.com/math/ratio.md"}}