Return on investment (ROI) calculator
Gain, ROI percentage and annualized return (CAGR) of an investment.
- Version 1
- Free, no sign-up
Examples
Example: 10,000 grows to 14,500 in 3 years
| Gain Amount returned minus amount invested. |
4,500.00 exact |
|---|---|
| Roi percent Return on investment in percent. Unit: percent. |
45.00 exact |
| Annualized roi percent Compound annual growth rate in percent. Unit: percent. |
13.19 rounded |
Rounding: Half even, 2 decimal places. Calculator finance/roi@1.
How it is calculated
ROI = (R − I) ÷ I; annualized = (R ÷ I)^(1/years) − 1ROI = (amount returned − amount invested) ÷ amount invested. With the holding period in years, also returns the annualized return (compound annual growth rate): (returned ÷ invested)^(1 ÷ years) − 1.
- Amounts are plain numbers in any single currency; no currency conversion is done.
References
Results follow each calculator's documented rules and the sources listed. They are not financial, tax or legal advice. Check that the rules fit your case before you rely on a result. See the terms.
Use it from your code
curl https://api.curatedapi.com/v1/calc/finance/roi \
-H "Authorization: Bearer $CURATEDAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount_invested": "10000",
"amount_returned": "14500",
"years": "3"
}'
The same call in Python
import os
import requests
payload = {
"amount_invested": "10000",
"amount_returned": "14500",
"years": "3",
}
response = requests.post(
"https://api.curatedapi.com/v1/calc/finance/roi",
headers={"Authorization": f"Bearer {os.environ['CURATEDAPI_KEY']}"},
json=payload,
timeout=10,
)
print(response.json()["result"])
The same call in JavaScript
const payload = {
"amount_invested": "10000",
"amount_returned": "14500",
"years": "3",
};
const response = await fetch("https://api.curatedapi.com/v1/calc/finance/roi", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CURATEDAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
console.log((await response.json()).result);
MCP tool calc_finance_roi at https://mcp.curatedapi.com.
Inputs, outputs and errors in the API reference.
Put it on your website
<div data-curatedapi-widget="finance/roi" data-key="capi_public_…"></div>
<script src="https://widgets.curatedapi.com/v1/widget.js" async></script>
Use a public key registered for your site. Calculations are billed like API calls. How widgets work.
Related calculators
- Black-76 calculator for options on futures
- Black-Scholes option price and Greeks calculator
- Bond duration and convexity calculator
- Compound interest calculator
- EU and UK APRC calculator
- Extra mortgage payment calculator
- FHA mortgage insurance (MIP) calculator
- Implied volatility calculator
- Internal rate of return (IRR) calculator
- Loan EMI calculator
- Mortgage affordability calculator
- Mortgage calculator
- Net present value (NPV) calculator
- Refinance break-even calculator
- Rent or buy calculator
- Savings goal calculator
- Simple interest calculator
- US APR calculator (Truth in Lending, Regulation Z)
- USDA loan guarantee fee calculator
- VA funding fee calculator
- Yield to call calculator
Add this calculator to your website
Paste two lines into your page and your visitors get this calculator. Each use counts as one call on your plan, the same as the API.
Free for up to 1,000 uses a month. 50,000 uses a month cost $9.00 on the Starter plan.