Compound interest calculator
This compound interest calculator shows how a starting principal can grow when interest is added back to the balance at regular intervals.
Run — free
Enter the principal, the nominal annual rate as a percentage, the number of compounding periods per year, and the duration in years. The result reports both the final amount and the interest earned, making it easy to separate contributed capital from growth. The same deterministic formula is useful for savings projections, investment comparisons, and transparent financial examples.
Enter the four inputs consistently
Begin with the principal, which is the amount available before any interest is applied. Enter the annual rate as a percentage, so a value of 5 represents five percent rather than the decimal 0.05. Frequency is the number of times interest is compounded during one year: 1 is annual, 4 is quarterly, 12 is monthly, and 365 is daily compounding. Years is the full duration of the calculation and may include a fractional part when the time horizon is not a whole number of years. Keep the principal and the returned amounts in the same currency, because the calculator performs arithmetic without converting monetary units. It accepts zero for principal, annual rate, or years, which can be useful for boundary checks, but frequency must be a positive integer. Before comparing scenarios, confirm that every option uses the same rate convention and time horizon. A nominal annual rate compounded monthly is not entered as a monthly rate; the calculator divides the annual percentage across the declared periods.
Understand the compound interest formula
The calculation uses the standard periodic compounding formula: final amount equals principal multiplied by one plus the annual rate divided by the compounding frequency, raised to the power of frequency multiplied by years. The annual percentage is first divided by 100 to convert it to a decimal. Interest earned is then calculated as the final amount minus the original principal. This method assumes that the rate remains constant, every scheduled compounding event occurs, and all credited interest stays in the balance. It does not model deposits, withdrawals, fees, taxes, changing rates, or inflation. More frequent compounding generally produces a slightly larger final amount when principal, nominal annual rate, and time stay fixed, because credited interest begins earning interest sooner. The outputs retain useful numeric precision for further calculations while avoiding distracting floating-point artifacts. For financial decisions that require currency posting rules, apply the institution's required rounding schedule after reviewing its terms, since periodic cent rounding can differ slightly from a direct formula.
Interpret and compare the results
Use final amount when you need the projected balance at the end of the selected period. Use interest earned when you want to isolate growth from the original principal. For a meaningful comparison between accounts, keep the principal and duration fixed, then change one assumption at a time. Comparing frequencies alone shows the effect of compounding intervals, while comparing annual rates shows the much larger effect of the quoted return. Remember that this is a projection, not a promise: real savings and investment products can have variable rates, fees, minimum balances, contribution schedules, early withdrawal rules, or market risk. The result is especially helpful as a transparent baseline that can be reproduced in a spreadsheet or audit note. Automated callers can submit the same inputs through the API for $0.002 per request, and browser users can explore scenarios without network-dependent calculations. If a quoted product uses an effective annual yield rather than a nominal annual rate, do not enter it as though it were nominal; first confirm the convention or compare effective yields directly.
What you can do with it
Project a savings balance
Estimate the ending balance and total interest for a fixed deposit held at a constant nominal annual rate.
Compare compounding frequencies
Hold principal, rate, and years constant to see how annual, quarterly, monthly, or daily compounding changes growth.
Build a reproducible financial example
Generate deterministic figures for a lesson, report, spreadsheet check, or automated calculation workflow.
FAQ
What does the annual rate field mean?
It is the nominal annual rate expressed as a percentage. Enter 5 for five percent, not 0.05.
What should I use for monthly compounding?
Set frequency to 12 because interest is compounded twelve times per year.
Why must frequency be positive?
The formula divides the annual rate into compounding periods. Zero or a negative number of periods has no valid meaning and produces an invalid input error.
Does the result include extra deposits or withdrawals?
No. It models one starting principal with a constant rate and no additional cash flows, fees, or taxes.
How much does an API calculation cost?
Each API request costs $0.002. The calculation is also available in the browser.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/calc2/compound-interest \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"principal":1000,"annual_rate":5,"frequency":12,"years":10}'const res = await fetch("https://api.kit.forhosting.com/calc2/compound-interest", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"principal": 1000,
"annual_rate": 5,
"frequency": 12,
"years": 10
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/calc2/compound-interest",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"principal": 1000,
"annual_rate": 5,
"frequency": 12,
"years": 10
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/calc2/compound-interest", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"principal":1000,"annual_rate":5,"frequency":12,"years":10}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"principal":1000,"annual_rate":5,"frequency":12,"years":10}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/calc2/compound-interest", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"principal": 1000,
"annual_rate": 5,
"frequency": 12,
"years": 10
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "calc2.compound_interest",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |