curatedapi

Savings goal calculator

How much to save each month (or week, or year) to reach a goal, or how long it takes with a given contribution.

The amount you want to reach.
Amount already saved.
Expected annual interest or return in percent.
What to calculate. Options: contribution: the contribution needed to reach the goal in a given time; time: how many contributions are needed with a given contribution
Time to reach the goal, in years (solve_for = contribution). Unit: years.
Contribution per period (solve_for = time).
How often you contribute. Options: monthly: 12 contributions a year; semimonthly: 24 contributions a year; biweekly: 26 contributions a year; weekly: 52 contributions a year; quarterly: 4 contributions a year; annually: 1 contribution a year
When in each period you contribute. Options: end: at the end of each period (ordinary annuity); beginning: at the start of each period (annuity due)
More options: rounding and decimals
Precision and rounding
Rounding mode applied once to each result. Default half_even.
Round results to this many digits after the decimal point.

Examples

Example: 20,000 in 3 years at 4%, monthly

Contribution
Contribution per period.
523.81 exact
Number of contributions
Number of contributions.
36
Years
Number of contributions ÷ contributions per year.
3
Total contributions
Contribution × number of contributions.
18,857.16 exact
Interest earned
Final balance minus savings and contributions.
1,142.72 rounded
Final balance
Balance after the last contribution.
19,999.88 rounded

Rounding: Half even, 2 decimal places. Calculator finance/savings-goal@1.

How it is calculated

FV = PV·(1+i)^n + PMT·((1+i)^n − 1)/i  [× (1+i) when paid at the start], i = annual rate ÷ periods per year

Solves the future-value-of-annuity equation either for the regular contribution or for the number of contributions. Interest compounds once per contribution period. The final balance is recomputed exactly with the rounded contribution, so you can see whether it lands on, above or below the goal.

  • 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

POST /v1/calc/finance/savings-goalVersion 1
curl https://api.curatedapi.com/v1/calc/finance/savings-goal \
  -H "Authorization: Bearer $CURATEDAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "goal_amount": "20000",
    "annual_rate_percent": "4",
    "years": "3"
  }'
The same call in Python
import os

import requests

payload = {
    "goal_amount": "20000",
    "annual_rate_percent": "4",
    "years": "3",
}
response = requests.post(
    "https://api.curatedapi.com/v1/calc/finance/savings-goal",
    headers={"Authorization": f"Bearer {os.environ['CURATEDAPI_KEY']}"},
    json=payload,
    timeout=10,
)
print(response.json()["result"])
The same call in JavaScript
const payload = {
    "goal_amount": "20000",
    "annual_rate_percent": "4",
    "years": "3",
};
const response = await fetch("https://api.curatedapi.com/v1/calc/finance/savings-goal", {
  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_savings_goal at https://mcp.curatedapi.com. Inputs, outputs and errors in the API reference.

Put it on your website

<div data-curatedapi-widget="finance/savings-goal" 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

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.