ROI Calculator Formula
Understand the math behind the roi calculator. Each variable explained with a worked example.
Formulas Used
Net Gain/Loss
gain = final_value - initial_investmentROI
roi = initial_investment > 0 ? (final_value - initial_investment) / initial_investment * 100 : 0Variables
| Variable | Description | Default |
|---|---|---|
initial_investment | Amount Invested(USD) | 10000 |
final_value | Final Value(USD) | 14000 |
How It Works
ROI Formula
ROI = (Final Value - Initial Investment) / Initial Investment × 100%
A positive ROI means you gained money; negative means you lost money.
Worked Example
You invested $10,000 and it is now worth $14,000.
initial_investment = 10000final_value = 14000
- 01Net gain = $14,000 - $10,000 = $4,000
- 02ROI = $4,000 / $10,000 × 100% = 40%
Ready to run the numbers?
Open ROI Calculator