curatedapi

Compound interest calculator

Future value of a lump sum with annual, monthly, daily or continuous compounding, plus the effective annual rate (APY).

Amount deposited at the start.
Nominal annual interest rate in percent (may be negative, above -100).
Time in years. Unit: years.
How often interest is compounded. Options: annually: once a year; semiannually: twice a year; quarterly: 4 times a year; monthly: 12 times a year; weekly: 52 times a year; daily: 365 times a year; continuously: continuous compounding (e^rt)
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: 1,000 at 5% for 10 years, yearly

Final amount
Balance at the end.
1,628.89 rounded
Interest earned
Final amount minus principal.
628.89 rounded
Effective annual rate percent
Effective annual rate (APY) for this compounding, in percent. Unit: percent.
5.00 exact
Periods
Number of compounding periods m·t used.
10

Rounding: Half even, 2 decimal places. Calculator finance/compound-interest@1.

How it is calculated

A = P·(1 + r/m)^(m·t); continuous: A = P·e^(r·t); APY = (1 + r/m)^m − 1

Grows a single deposit at a nominal annual rate compounded m times a year: A = P(1 + r/m)^(m·t), or A = P·e^(r·t) for continuous compounding. Whole numbers of periods are computed exactly; anything else is computed with certified high-precision arithmetic and rounded correctly.

  • Amounts are plain numbers in any single currency; no currency conversion is done.
  • Daily compounding uses 365 periods per year.

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/compound-interestVersion 1
curl https://api.curatedapi.com/v1/calc/finance/compound-interest \
  -H "Authorization: Bearer $CURATEDAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "principal": "1000",
    "annual_rate_percent": "5",
    "years": "10"
  }'
The same call in Python
import os

import requests

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

Put it on your website

<div data-curatedapi-widget="finance/compound-interest" 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.