# Percentage Calculator

- **URL:** https://codeasystem.com/calculators/math/percentage-calculator/
- **Category:** math
- **Description:** Solve all three classic percentage questions; percent of a number, percent-of-total, and percentage change; in one switchable tool.
- **Primary output:** 15% of 80: 12

## Inputs
- Question type (name: `mode`, type: select)
- First value (X) (name: `valueA`, type: number, example: 15)
- Second value (Y) (name: `valueB`, type: number, example: 80)

## Outputs
- 15% of 80: 12
- As a decimal multiplier: 0.15
- Remainder: 68

## Formula / methodology
```
X% of Y = Y × X/100
X is what % of Y = X/Y × 100
% change = (Y − X)/X × 100
```

All three questions reduce to one multiplication or division once you identify which number is the base. The mode selector fixes the roles so the same two inputs answer whichever question you are actually asking, and the help line under each field restates its meaning for the chosen mode.

## Assumptions & limitations
- Percent-of mode treats the second value as the base.
- Change mode is undefined from zero and reports that explicitly.
- Results render with up to six decimal places before rounding kicks in.

## How to use
1. **Pick your question type**; Percent of a number, share of a total, or growth between two values.
2. **Fill both values**; The labels stay generic (first/second) because their meaning changes per mode; the help text explains each role.
3. **Read the single clear answer**; One headline result plus supporting rows like ratio and remainder.

## Example
15% of 80 is 12; the calculator multiplies 80 by 0.15.

Result for these inputs:

```
15% of 80: 12
```

## About this calculator
### One tool, three confusions

Most percentage mistakes come from mixing up the question: “20% off” versus “20% more”, or “what percent of my income” versus “how much did it grow”. Choosing the mode first forces clarity about which number is the base, and the base is everything.

### The base rule

Whatever follows the word “of” is the base. 30% of 40 and 40% of 30 land on the same 12, but 30 as a percent of 40 is a completely different 75%. When results look absurd, re-check which value sat where.

### Change needs a starting point

Percentage change divides by where you started, so going 50 → 75 is +50% while 75 → 50 is −33.3%. The asymmetry is real mathematics, not an error; percentages do not round-trip.

## FAQs
### Which number goes first?

In “X% of Y” the percent comes first. In “is what % of” the part comes first and the whole second. In change mode they are start then end.

### Why does change from zero fail?

Division by zero has no defined percentage; every positive endpoint would be “infinite” growth. Use absolute difference instead.

### Can I use negative numbers?

Yes for all modes; signs carry through, though interpreting a negative base deserves extra care.

### How precise are the results?

Up to six decimals are shown before formatting rounds, enough for finance-grade comparisons at everyday magnitudes.

## Related calculators
- [Percentage Change Calculator](https://codeasystem.com/calculators/math/percentage-change-calculator/)
- [Discount Calculator](https://codeasystem.com/calculators/finance/discount-calculator/)
- [Profit Margin Calculator](https://codeasystem.com/calculators/business/profit-margin-calculator/)

---
Last updated: 2026-08-23 · Version: 1.0.0 · [HTML version](https://codeasystem.com/calculators/math/percentage-calculator/)
