math_ratio_calculator
Simplify, solve proportion, scale, split, or percentage calculations on ratios. Input numbers and select an operation to get instant results.
Instructions
Ratio Calculator (Simplify, Solve Proportion, Scale, Split, Percentage). Run one of five ratio operations on numbers you supply. The operation field selects the mode: simplify reduces an integer ratio by its GCD; solveProportion solves a is to b as c is to d for the one omitted term; scale multiplies every part so an anchored part hits a target; split distributes a total across parts with largest-remainder rounding; percentage expresses each part as a percent of the whole. Use this for proportions, scaling, and part-whole splits; use math_percentage_calculator for percent-of and percent-change math, or math_statistics_calculator for descriptive statistics on a dataset. Runs locally on the numbers you provide: read-only, non-destructive, contacts no external service, and is rate-limited (60 requests/minute for anonymous callers). Returns a JSON envelope (success, operation, result) whose result shape depends on the chosen operation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operation | Yes | Mode selector. simplify, scale, split, and percentage read the parts array; solveProportion reads a, b, c, d instead. | |
| parts | No | Ratio terms for simplify, scale, split, and percentage (ignored by solveProportion). 2 to 8 finite numbers greater than zero; numeric strings are coerced. simplify additionally requires every value to be a positive integer. | |
| a | No | First proportion term (solveProportion only). Provide exactly three of a, b, c, d, each greater than zero, and omit the one to solve for. | |
| b | No | Second proportion term (solveProportion only). Provide exactly three of a, b, c, d and omit the one to solve for. | |
| c | No | Third proportion term (solveProportion only). Provide exactly three of a, b, c, d and omit the one to solve for. | |
| d | No | Fourth proportion term (solveProportion only). Provide exactly three of a, b, c, d and omit the one to solve for. | |
| anchor | No | Anchor for the scale operation (required for scale, ignored otherwise): pin one part to a target value and scale the rest. | |
| total | No | Total to distribute across parts for the split operation (required for split, ignored otherwise). Each rounded allocation is proportional to its part. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | No | True when the calculation succeeded. | |
| operation | No | The operation that was executed (echoed from the request). | |
| result | No | Operation-specific output. simplify returns input, simplified, gcd. solveProportion returns a, b, c, d, unknown, equation. scale returns input, scaled, anchor (index, value), factor. split returns total, parts, allocations, rounded, rounding. percentage returns parts, percentages, total. | |
| error | No | Present only on failure (HTTP 400/500) with the validation message; omitted on success. |