Percentage Calculator
Calculate percentages instantly with ToolMono's free online percentage calculator. Find X% of Y, calculate what percent X is of Y, and solve reverse percentages.
What is X% of Y?
Real-time precision percentage calculation with step-by-step formula
20% of 150 is equal to 30.
Step-by-Step Mathematical Solution
Result = (X / 100) × Y
Result = (20 / 100) × 150
- Step 1: Convert percentage to decimal: 20 ÷ 100 = 0.2
- Step 2: Multiply decimal by whole number: 0.2 × 150 = 30
- Step 3: Round result: 30
History
0 calculations saved
No History Recorded
Calculations will be saved here locally.
Overview & Calculation Engine
Use ToolMono's free online percentage calculator to find percentages quickly and accurately. Calculate X% of a number, determine what percentage one value is of another, or find the original value when a percentage is known.
Percentage calculations are foundational arithmetic powering financial ledger auditing, profit margin analysis, sales tax (GST/VAT) compliance, retail discounting, interest rate yield curves, and statistical percentile distributions. Despite their conceptual simplicity, computer systems executing floating-point math are prone to floating-point truncation hazards. ToolMono executes 100% client-side precision-sanitized calculations, purging IEEE 754 floating-point drift.
All financial calculations, tax rate additions, payroll deductions, and profit margin models execute 100% locally inside your web browser V8 sandbox memory. Proprietary numbers are never transmitted to external cloud servers.
How to Calculate Percentages
A percentage represents a dimensionless ratio expressed as a fraction out of 100. The fundamental equation linking a part, a whole, and a percentage is:
Example: If a test score is 25 out of 100: (25 / 100) × 100 = 25%.
Core Percentage Formulas (3 Primary Modes)
The three most common percentage calculation modes use the following mathematical formulas:
1What Is X% of Y?
Find the partial value corresponding to X percent of Y.
2X Is What % of Y?
Determine what percentage the part X forms of the whole Y.
3X Is P% of What?
Find the 100% total value when X represents P percent of it.
Percentage Increase and Decrease
Applying a percentage increase or decrease modifies an original value by a fraction of itself. The formula is the same in both directions — the direction of change determines whether you add or subtract.
Percentage Increase
Percentage Decrease
Practical Examples
| Scenario | Original | Change | Result |
|---|---|---|---|
| Price after 15% tax | $200 | +15% | $230 |
| Salary after 10% raise | $60,000 | +10% | $66,000 |
| Item after 30% discount | $120 | −30% | $84 |
| Stock after 5% drop | $500 | −5% | $475 |
IEEE 754 Floating-Point Mechanics & Precision
Standard binary floating-point numbers (IEEE 754 Double Precision 64-bit) allocate 1 bit for sign, 11 bits for exponent, and 52 bits for mantissa. Decimal fractions whose denominators are not powers of two cannot be represented exactly in binary.
ToolMono implements precision sanitization that automatically rounds intermediate floating-point noise up to 12 decimal places, ensuring clean outputs like 0.3 without fractional rounding noise.
Percentage Change vs. Percentage Difference
While percentage change and percentage difference sound similar, they serve distinct mathematical purposes:
| Metric | When to Use | Formula |
|---|---|---|
| Percentage Change | Comparing new value vs an explicit original baseline value | ((New − Old) / Old) × 100 |
| Percentage Difference | Comparing two values symmetrically when neither is a starting baseline | (|A − B| / ((A + B) / 2)) × 100 |
| Percentage Points | Comparing two percentage rates directly | New% − Old% |
Percentage Points vs. Percentage Change Example
If an interest rate moves from 4% to 5%:
- Percentage Points: 5% − 4% = 1 percentage point increase.
- Percentage Change: ((5 − 4) / 4) × 100 = 25% relative increase.
Financial Engineering & Enterprise Applications
Compound Interest & APY
Compound interest equation: A = P × (1 + r/n)^(n × t). The Effective Annual Percentage Yield (APY) calculates compounding yield: APY = (1 + r/n)^n − 1.
Profit Margin vs Markup Accounting
Edge Cases & Computational Hazards Matrix
| Edge Case Scenario | Computational Hazard | Engine Mitigation Solution |
|---|---|---|
| Zero Baseline Division | Original value = 0 in % change | Return explicit zero baseline error guard |
| Negative Values | Negative numbers in % change | Use absolute value denominator |Initial| |
| Stacked Discounts | 20% off + 15% off linear addition | Multiplicative sequential balance reduction (32% net) |
Multi-Language Developer Implementation Guide
TypeScript / JavaScript (Precision Percentage)
export function calculatePercentageChange(initial: number, final: number): number {
if (initial === 0) throw new Error("Initial value cannot be zero");
const diff = final - initial;
const pctChange = (diff / Math.abs(initial)) * 100;
return Math.round((pctChange + Number.EPSILON) * 100) / 100;
}Python (decimal.Decimal Precision)
from decimal import Decimal, ROUND_HALF_UP
def calculate_gross_margin(revenue_str: str, cogs_str: str) -> Decimal:
revenue, cogs = Decimal(revenue_str), Decimal(cogs_str)
if revenue == Decimal('0'): raise ValueError("Revenue cannot be zero")
margin_pct = ((revenue - cogs) / revenue) * Decimal('100')
return margin_pct.quantize(Decimal('0.01'), rounding=ROUND_HALF_UP)Real-World Percentage Examples
Retail Shopping Discount
What is 20% off a $150 jacket?
Academic Test Score
Scoring 42 out of 50 on an exam.
Salary Increase
Salary rising from $65,000 to $71,500.
Which Percentage Calculation Should I Use?
Not sure which calculation mode applies to your situation? Use this quick decision table to identify the right formula before entering numbers.
| If you want to know… | Example | Calculation | Formula |
|---|---|---|---|
| X% of a number | 20% of 500 | Percentage of a number | (X / 100) × Y |
| What percent one number is of another | 50 is what % of 200? | Percentage ratio | (Part / Whole) × 100 |
| The original total from a part and rate | 30 is 20% of what? | Reverse percentage | Part / (Rate / 100) |
| How much a value grew or shrank | Price changed 80 → 100 | Percentage change | ((New − Old) / Old) × 100 |
| Gap between two values with no baseline | Compare 40 and 60 as peers | Percentage difference | (|A − B| / ((A+B)/2)) × 100 |
| Direct difference between two rates | Rate moved from 4% to 5% | Percentage points | New% − Old% |
The Stacked Percentage Trap
One of the most counterintuitive percentage facts: applying a percentage decrease followed by the same percentage increase does not return to the original value.
Why Does This Happen?
Percentage operations are multiplicative. A 20% decrease multiplies by 0.80. A 20% increase then multiplies by 1.20. Combined: 0.80 × 1.20 = 0.96 — 96% of the original, not 100%. The two operations use different base values, so they do not cancel each other out.
This effect matters in retail (markdown then markup), finance (portfolio drawdown and recovery), and salary negotiations. To recover fully from a 20% loss, a 25% gain is required: 80 × 1.25 = 100.
Related Percentage & Math Tools
Everyday math calculator for arithmetic expressions, parentheses, powers, roots, and calculation history.
Trigonometry (sin, cos, tan), logarithms, hyperbolic functions, constants, and DEG/RAD angle modes.
Compute the Greatest Common Divisor and Least Common Multiple for integer sets.
Frequently Asked Questions
Financial & Mathematical References
ISO 80000-2: Quantities and Units — Mathematics
International standard for mathematical proportions, ratios, and percentages.
IEEE 754-2019: Standard for Floating-Point Arithmetic
Official IEEE standard for numerical division and rounding.
MDN Web Docs: JavaScript Math Object
Official Mozilla guide to JavaScript arithmetic calculations.
Related Tools
Browse all toolsOnline Calculator
Use ToolMono's free online calculator for quick everyday math, expressions, percentages, powers, roots, and parentheses. Includes calculation history and keyboard support.
Scientific Calculator
Use ToolMono's free Scientific Calculator for advanced mathematical calculations. Supports trigonometric, inverse, hyperbolic, logarithmic, exponential, factorial, scientific notation, degree/radian modes, calculation history, and 100% client-side processing.
GCD and LCM Calculator
Calculate the GCD (GCF/HCF) and LCM of two or more numbers instantly. See step-by-step Euclidean algorithm and prime factorization methods with accurate results.
Timestamp Converter
Convert Unix timestamps to dates and dates to timestamps instantly. Supports seconds, milliseconds, microseconds, nanoseconds, UTC, local time, and ISO 8601.
Hash Generator
Generate hashes and file checksums locally in your browser. Compare digests, copy results, and use MD5, SHA-1, SHA-2, SHA-3, BLAKE2, and supported HMAC algorithms.