# Percentage calculator

> Percent of, percent change, reverse percent, and margin, with the formula shown.

Free percentage calculator. Find X% of Y, what percent X is of Y, the change from one number to another, the original value, an increase or decrease, and margin versus markup. Arithmetic uses decimal rounding.

- Page: https://benchline.fabwaseem.com/t/percentage-calculator
- Runs: in the browser. Input stays on the device.
- Price: free, no account
- Input: A percentage form and two numbers.
- Output: The result and the formula. Margin also includes profit and markup.
- Keywords: percentage calculator, percent change, margin calculator
- Updated: 2026-10-18
- Built by: Waseem Anjum (https://fabwaseem.com)

## How to use it

1. **Choose the form.** Percent of a value, what percent one value is of another, change, reverse, increase, decrease, or margin.
2. **Enter the two numbers.** The labels change with the form. Margin asks for cost and price.
3. **Read the formula.** The result sits next to the expression that produced it.

## Use it from an AI agent

MCP tool name: `calculate_percentage`
MCP endpoint: https://benchline.fabwaseem.com/mcp (Streamable HTTP, no key)
HTTP: POST https://benchline.fabwaseem.com/api/v1/tools/percentage-calculator with the input as the JSON body
This call does not fetch anything. It runs on the arguments you send.

Calculate percent of a value, what percent one number is of another, percent change, the reverse, an increase or decrease, and margin versus markup.

### Input schema

```json
{
  "type": "object",
  "properties": {
    "mode": {
      "default": "of",
      "description": "of, is, change, reverse, increase, decrease, or margin.",
      "type": "string",
      "enum": [
        "of",
        "is",
        "change",
        "reverse",
        "increase",
        "decrease",
        "margin"
      ]
    },
    "a": {
      "description": "First value. For of and increase, this is the percent.",
      "type": [
        "string",
        "number"
      ]
    },
    "b": {
      "description": "Second value. For of and increase, this is the amount.",
      "type": [
        "string",
        "number"
      ]
    }
  },
  "required": [
    "mode",
    "a",
    "b"
  ],
  "additionalProperties": false
}
```

### Example tools/call

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "calculate_percentage",
    "arguments": {
      "mode": "of",
      "a": "example",
      "b": "example"
    }
  }
}
```

Setup for Claude, Cursor, and VS Code: https://benchline.fabwaseem.com/mcp/guide

## Questions

### What is the difference between margin and markup?

Margin is profit divided by price. Markup is profit divided by cost. A price of 100 on a cost of 60 is a 40% margin and a 66.67% markup.

### Why not ordinary floating point?

Values such as 10% of 1 and 1 out of 3 are calculated with decimal.js and rounded half up to 8 decimal places, then trailing zeros are removed.

### Can the change be negative?

Yes. A drop from 100 to 80 is −20%.

## Related tools

- [Loan EMI calculator](https://benchline.fabwaseem.com/t/loan-emi-calculator): A monthly installment and the full amortization table, rounded to the cent.
- [Unit converter](https://benchline.fabwaseem.com/t/unit-converter): Length, mass, temperature, and data sizes, with decimal and binary units kept apart.
- [Date difference calculator](https://benchline.fabwaseem.com/t/date-difference): Count the days, weeks, and business days between two dates.
- [Unix timestamp converter](https://benchline.fabwaseem.com/t/unix-timestamp): Turn epoch seconds or milliseconds into a date, and a date in any time zone back into epoch time.
