DEV Community

Monkza
Monkza

Posted on

Percentage Increase Isn’t Just Subtraction: Understanding the Math Behind It

When you work with numbers in software, analytics, finance, or even a simple JavaScript project, percentage increase looks like one of the easiest calculations around. Yet it is surprisingly common to implement it incorrectly.
The reason is simple: finding the difference between two values and finding the percentage increase are two different operations.
Suppose an application's daily active users increase from 8,000 to 9,200. The absolute increase is 1,200 users. But if you want to know how much the metric actually grew relative to its starting point, you need a percentage.
The calculation is:
Percentage Increase = ((New Value − Original Value) / Original Value) × 100
For the example above:
((9,200 − 8,000) / 8,000) × 100 = 15%
So the application experienced a 15% increase in daily active users.
The denominator is the part developers and analysts need to pay attention to. For a percentage increase, the denominator is the original value, not the new value.
This matters when you're writing code for dashboards, reports, analytics tools, or calculators. A function such as:
((newValue - oldValue) / oldValue) * 100
looks trivial, but you still need to consider what happens when oldValue is zero, whether negative values are allowed, how many decimal places should be displayed, and whether the user actually wants percentage increase or percentage-point change.
For example, imagine a conversion rate moving from 20% to 22%. Saying it increased by 2% can be misleading. The direct difference is 2 percentage points, while the relative increase is 10%:
((22 - 20) / 20) * 100 = 10%
Both numbers are mathematically meaningful, but they describe different things.
This distinction becomes particularly important in analytics. A dashboard showing “+10%” and another showing “+2 percentage points” could be referring to exactly the same movement from 20% to 22%. Without the right terminology, readers can easily misunderstand the data.
There is another interesting property of percentage changes that is worth remembering. A percentage increase followed by the same percentage decrease does not generally return the original value.
Start with 100 and increase it by 20%:
100 × 1.20 = 120
Now decrease 120 by 20%:
120 × 0.80 = 96
The result is 96, not 100. The reason is that the second percentage is calculated from a different base.
For developers, this is a useful reminder that percentage changes are relative transformations, not fixed amounts.
If you're implementing percentage calculations in JavaScript, for example, you might start with something like:
function percentageIncrease(original, current) { return ((current - original) / original) * 100; }
But production code should also decide how to handle an original value of zero. There is no conventional finite percentage increase from zero to a positive number because the calculation would require division by zero. That case should be handled explicitly rather than allowing the application to produce an invalid result.
For quick experimentation and testing, I also built a free Percentage Increase Calculator on Monkza. It can be useful when you want to verify a calculation without writing a quick script every time.
The interesting thing about percentage calculations is that the arithmetic is usually the easy part. The harder part is understanding what the percentage is actually measuring.
Whenever you're working with a percentage increase, ask three questions: What was the starting value? How much did it change? And what percentage of the starting value is that change?
Once those three questions are clear, the formula becomes much harder to misuse.

Top comments (0)