Percentage Calculator

Calculate a percentage of a number, add or subtract a percentage, and find the resulting amount quickly.

// about

About this Tool

Enter an amount and a percentage to calculate the percentage value and the amount after adding it.

How to use it

  1. Enter the original number or amount.
  2. Enter the percentage rate.
  3. Select Calculate to see the percentage amount and total.

Why people use this tool

  • Works for prices, tax, tips, discounts, budgets, and general math.
  • Shows both the percentage portion and the final total.
  • Uses decimal arithmetic so currency-like values remain precise.
Guides · Calculation · 6 min read

Percentage Calculations Explained: Percent Change, Percentage Points, Stacked Discounts and VAT

How much did sales grow? What is the sale price? Did the interest rate rise by a percent or a percentage point? Percentages look simple, but choosing the wrong base changes the answer.

A percentage is a ratio expressed per hundred. Every percentage calculation comes down to choosing the right base (the denominator), and most everyday cases fit one of these four.

① What is B% of A?        A × B ÷ 100          (15% of 80,000 = 12,000)
② A is what % of B?       A ÷ B × 100          (12 ÷ 48 × 100 = 25%)
③ Change from A to B      (B − A) ÷ A × 100    (200 → 250 = +25%)
④ A increased/decreased   A × (1 ± B ÷ 100)    (50,000 + 20% = 60,000)
The four basic percentage formulas, percent versus percentage points, why 20% off plus 10% off is not 30%, and how to back out tax from a gross price.
Read guide →
Build it with AI

Build this tool yourself with AI

Want your own version of this tool? Copy the work-order prompt into an AI chat, or save the skill file for an AI coding agent. Both describe the features, edge cases and test cases we used when building it.

AI work-order prompt

Paste it as-is into an AI chat such as Claude, ChatGPT or Gemini.

You are an experienced full-stack web developer. Build a web tool called "Percentage Calculator" that meets the requirements below.

## Goal

Build a calculator for everyday percentage tasks: share, percent change, increases/decreases and reverse calculations.

## Core features

- What is B% of A
- A is what percent of B
- Percent change from A to B
- Increase or decrease A by B%
- Original price from a discounted price

## Inputs

- Two numbers per calculation type

## Outputs

- Result
- Formula and working shown step by step

## Edge cases and handling rules

- Explain division by zero when the base is 0
- Support negative and decimal numbers
- Rounding option to hide floating-point noise
- Note on percent versus percentage points

## Implementation requirements

- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.
- Make the UI responsive and easy to use on mobile; label every input and keep everything keyboard accessible.
- Add a Copy button for results and show clear, friendly error messages for invalid input.
- Keep the core logic in functions separate from the UI so it can be unit-tested.

## Definition of done (test cases)

- 15% of 80000 = 12000
- Change from 200 to 250 = 25%
- If 72000 is 20% off, the original is 90000

First outline your implementation plan in at most five lines, then write the complete code, and finally explain how to check the test cases above.

Skill (SKILL.md)

Save it as .claude/skills/build-percent-calculator/SKILL.md for AI coding agents such as Claude Code to reuse whenever you build or change this tool.

---
name: build-percent-calculator
description: Use when building or changing a Percentage Calculator tool. Build a calculator for everyday percentage tasks: share, percent change, increases/decreases and reverse calculations.
---

# Build: Percentage Calculator

## Goal

Build a calculator for everyday percentage tasks: share, percent change, increases/decreases and reverse calculations.

## Workflow

1. Review the required features, inputs and outputs below and ask about anything missing first.
2. Implement the core logic as pure functions separate from the UI.
3. Check the logic against the test cases in the verification list.
4. Build a responsive UI with an input form, a result area and a Copy button.
5. Reproduce each edge case listed under Rules and refine the error messages.

## Core features

- What is B% of A
- A is what percent of B
- Percent change from A to B
- Increase or decrease A by B%
- Original price from a discounted price

## Inputs

- Two numbers per calculation type

## Outputs

- Result
- Formula and working shown step by step

## Rules

- Explain division by zero when the base is 0
- Support negative and decimal numbers
- Rounding option to hide floating-point noise
- Note on percent versus percentage points
- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.

## Verification

- [ ] 15% of 80000 = 12000
- [ ] Change from 200 to 250 = 25%
- [ ] If 72000 is 20% off, the original is 90000

Tips for working with AI

  • Tell the AI your stack (for example React, Vue or plain HTML) on the first line so the code matches your project.
  • Ask it to run the listed test cases and show the results before you accept the code.
  • Never paste real secrets, customer data or API keys into the prompt; use sample values instead.