API & MCP

Everything a person can do on Percentage & Ratio Calculator, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

Percentage & Ratio Calculator

Answers every everyday percentage question (X% of Y, X is what percent of Y, percentage change, increase or decrease by a percentage, reverse percentage, percentage points versus percent) and every ratio task (simplify, scale, split an amount, aspect ratios). Each answer shows the formula and the steps.

Inputs of Percentage & Ratio Calculator
FieldTypeDefaultDescription
modeselect (percent-of, what-percent, change, increase, decrease, reverse, points, ratio-simplify, ratio-scale, ratio-split, aspect)"percent-of"Question
xnumber—Value X. Percentage modes: the percentage or the start value (see the question). Aspect ratio: width.
ynumber—Value Y. Percentage modes: the base, end or final value. Aspect ratio: height.
ratiotext—Ratio. For the ratio modes: 2 to 10 positive terms separated by ":" (e.g. 16:9, 2:3:5, 1.5:2).
amountnumber—Amount. Split: the total to share out. Scale: the value the chosen term should become.
scaleTerminteger1Term to scale. Scale mode: which ratio term (1 = first) should equal the amount.
newWidthnumber—New width. Aspect ratio: optional; the matching height is calculated.
newHeightnumber—New height. Aspect ratio: optional; the matching width is calculated.
decimalsinteger2Decimal places. Rounding of the displayed answer and of split amounts (2 = cents).

Example request

What is 15% of 80?

curl -X POST https://percentageratiocalculator.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"mode":"percent-of","x":15,"y":80}'

Every result contains

inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.

MCP (Model Context Protocol)

{
  "mcpServers": {
    "percentage-ratio-calculator": { "type": "http", "url": "https://percentageratiocalculator.usefulweb.site/mcp" }
  }
}