How it works
The three modes use:
- X% of Y = (X ÷ 100) × Y — e.g. a discount amount, tax or tip on a price
- X is what % of Y = (X ÷ Y) × 100 — e.g. a test score or a share of a total
- Change from X to Y = ((Y − X) ÷ X) × 100 — e.g. a price rise or a drop in traffic
Two related problems people often need: a reverse percentage ("X is 20% of what number?") is X ÷ (20 ÷ 100); and a price after discount is price × (1 − discount% ÷ 100) — a $60 item at 25% off is 60 × 0.75 = $45.
Worked example
Worked examples across the three modes:
- Discount: 20% of $80 = (20 ÷ 100) × 80 = $16 off, so you pay $64.
- Test score: 42 correct out of 60 = (42 ÷ 60) × 100 = 70%.
- Price change: from $80 to $100 = ((100 − 80) ÷ 80) × 100 = +25% — note that going back from $100 to $80 is only −20%, because the base changes.
How we check this calculator
All three modes are validated with identity checks that must hold exactly: X% of Y and 'X is what % of Y' are inverse operations, so 20% of 80 = 16 must round-trip to '16 is 20% of 80'; and a change from X to Y followed by the reverse change must return to X. We also pin the classic asymmetry case (+25% then −20% returns to the start) to guard against base-value mistakes.