# Percentage Calculator

> Solves the three basic percentage questions (a percentage of a number, what percentage one number is of another, and the whole behind a known part and percentage). Always returns the part, the whole and the percent.

- Calculator id: `percentage` · Category: Math (`math`) · Tool name: `calculate_percentage`
- Canonical page: https://tttkmbb.com/math/percentage · This document: https://tttkmbb.com/math/percentage.md · JSON definition: https://tttkmbb.com/math/percentage.json

## Purpose

Solves the three basic percentage questions (a percentage of a number, what percentage one number is of another, and the whole behind a known part and percentage). Always returns the part, the whole and the percent.

**Use when:** You need a percentage of a value, the percentage one value represents of another, or the base value that a part and its percentage imply.

**Do not use when:** You need the percentage change between two values (use percentage-change), a price after a percentage discount (use discount) or a tax amount (use sales-tax).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `mode` | enum: percent_of \| is_what_percent \| percent_of_what |  | optional, default "percent_of" | Which percentage question to solve; x and y take the meaning shown in the label of the chosen mode. |
| `x` | number |  | required | First number: the percent (percent_of) or the part (is_what_percent, percent_of_what). Percents are plain numbers, 15 means 15%. |
| `y` | number |  | required | Second number: the whole (percent_of, is_what_percent) or the percent (percent_of_what). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | The unknown quantity: the part (percent_of), the percent in % (is_what_percent) or the whole (percent_of_what). |
| `sentence` | string |  | The solved statement, e.g. '15% of 240 is 36.' |
| `part` | number |  | The part: percent × whole / 100. |
| `whole` | number |  | The base value that corresponds to 100%. |
| `percent` | number | % | The percentage: part / whole × 100. |

## Formula

`percent_of: result = x / 100 × y. is_what_percent: result = x / y × 100. percent_of_what: result = x / (y / 100). In every mode part = percent × whole / 100.`

## Data Sources

- Wikipedia – Percentage — https://en.wikipedia.org/wiki/Percentage (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Percent — https://mathworld.wolfram.com/Percent.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/percentage?x=…&y=…`
- `POST https://tttkmbb.com/api/v1/calculate/percentage` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/percentage · OpenAPI operationId `calculate_percentage` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `calculate_percentage` (dedicated) or `run_calculator` with `{"calculator_id": "percentage", "inputs": {…}}`

## Example

- What is 15% of 240?: inputs `{"mode":"percent_of","x":15,"y":240}` → `{"result":36,"part":36,"whole":240,"percent":15,"sentence":"15% of 240 is 36."}`
- 30 is what percent of 120?: inputs `{"mode":"is_what_percent","x":30,"y":120}` → `{"result":25,"part":30,"whole":120,"percent":25,"sentence":"30 is 25% of 120."}`

```
GET https://tttkmbb.com/api/v1/calculate/percentage?mode=percent_of&x=15&y=240
```

## Limitations

You need the percentage change between two values (use percentage-change), a price after a percentage discount (use discount) or a tax amount (use sales-tax). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Do I enter 15 or 0.15 for 15%?**

Enter 15. Percentages are plain percent numbers everywhere on this site; the calculator divides by 100 internally.

**How do I find the whole from a part?**

Use mode percent_of_what: '36 is 15% of what?' gives x = 36, y = 15 and returns 240.

**What is the difference between percent and percentage points?**

Going from 10% to 15% is a rise of 5 percentage points but a 50% relative increase. This calculator handles plain percent arithmetic; use percentage-change for relative changes.

## Related

- [Percentage Change Calculator](https://tttkmbb.com/math/percentage-change.md) — Percentage increase or decrease between two values.
- [Discount Calculator](https://tttkmbb.com/finance/discount.md) — Price after a percentage discount.
- [Fraction Simplifier](https://tttkmbb.com/math/fraction-simplifier.md) — Express the same part/whole relationship as a reduced fraction.
