Compound interest calculator
Put 1,000 away at 5% compounded once a year for 10 years and it grows to 1,628.89, with 628.89 of interest. Choose annual, monthly or daily posting to see how frequency changes the final balance of a savings account or CD. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Principal amount
- 1,000
- Interest rate
- 5
- Frequency
- 1
- Years
- 10
- Periods
- 10
- Final balance
- 1,628.89
- Interest amount
- 628.89
Compound interest is the growth that appears when earned interest is added back to the principal and then itself earns interest in later periods. Students, savers, and product teams meet the same closed form again and again: the future balance equals the starting principal times one plus the annual rate divided by the compounding frequency, raised to the product of frequency and years. This compound interest calculator accepts those four numbers—principal, annual rate as a percent, compounding periods per year, and years—and returns the final balance together with the interest earned as the difference from principal. It does not quote a bank product, convert currencies, schedule extra deposits, or invert a growth rate into CAGR.
What compound interest means and how the closed form works
Simple interest multiplies principal by rate by time and stops there, so each year the same dollar amount of interest is added. Compound interest capitalizes that interest: after the first period the base is larger, so the next period earns interest on interest. The standard discrete model used by savings accounts, certificates of deposit, and textbook problems is A equals P times one plus r over n, raised to n times t.
P is the starting principal in currency units. r is the nominal annual rate as a decimal, so a five percent quote is r equals 0.05. n is the compounding frequency—how many times per year interest is posted—and t is the horizon in years. Common n values are one for annual, two for semiannual, four for quarterly, twelve for monthly, fifty-two for weekly, and three hundred sixty-five for daily. More frequent compounding, holding the nominal rate fixed, produces a slightly larger future value because interest starts earning sooner.
Interest earned is simply A minus P. This capability does not add regular contributions, subtract fees, or switch to continuous compounding with e to the r t; those are different identities and different search intents. A zero-year horizon returns the original principal with zero interest.
A zero rate likewise leaves the principal unchanged. Negative rates are allowed when they stay finite, which models a contracted decline rather than a typing error, but if one plus r over n is negative and the exponent is not an integer the power is not a real finite number and the task fails instead of returning NaN.
What you can do with it
Savings and CD growth checks
Project the future balance of a lump-sum savings account or certificate of deposit from principal, the quoted annual percent, posting frequency, and years held.
Classroom and homework oracles
Generate reproducible A = P(1+r/n)^(nt) answer keys that distinguish monthly compounding from annual compounding on the same principal and rate.
FAQ
How is compound interest calculated?
The final balance is A = P × (1 + r/n)^(n×t), where P is principal, r is the annual rate as a decimal (percent divided by 100), n is compounding periods per year, and t is years. Interest earned is A minus P.
Is the rate a percent or a decimal?
A percent. Send 5 for five percent per year. Sending 0.05 would be treated as five hundredths of a percent, not five percent.
What happens if rate is not a finite number?
Missing, infinite, or non-numeric rate values are rejected and are not billed.
Does this include extra deposits or continuous compounding?
No. It compounds a single lump sum with discrete periods per year. Regular contributions and the continuous formula A = P e^(rt) are different identities.
Does compounding more often really change the result?
Yes, a little. At the same 5% over 10 years, 1,000 compounded monthly reaches 1,647.01 instead of 1,628.89 with yearly compounding, because interest is posted sooner and starts earning interest of its own.
Related tools
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/fin/compound-interest \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"principal":1000,"rate":5,"frequency":12,"years":10}'const res = await fetch("https://api.kit.forhosting.com/fin/compound-interest", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"principal": 1000,
"rate": 5,
"frequency": 12,
"years": 10
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/fin/compound-interest",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"principal": 1000,
"rate": 5,
"frequency": 12,
"years": 10
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/fin/compound-interest", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"principal":1000,"rate":5,"frequency":12,"years":10}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"principal":1000,"rate":5,"frequency":12,"years":10}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/fin/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,
"rate": 5,
"frequency": 12,
"years": 10
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "fin.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. |
Technical notes
It evaluates the discrete identity in pure arithmetic so a worksheet, a coaching session, and an API client never disagree.
Input contract, response shape, and error behaviour
Example: one thousand principal, five percent, twelve compounds per year, and ten years yields one hundred twenty periods, a final balance of one thousand six hundred forty-seven point zero one, and interest of six hundred forty-seven point zero one. The same principal and rate compounded only once per year for ten years yields a smaller balance of one thousand six hundred twenty-eight point eight nine, which is the point of exposing frequency as its own field. Failed validation does not consume balance. POST a JSON body with four required finite numbers. principal is the starting amount in one currency; aliases amount, p, and starting_balance are accepted so spreadsheets can keep familiar column names, and the value must sit between zero and one trillion inclusive. rate is the nominal annual percent—five means five percent per year—not a decimal 0.05 unless you truly intend five hundredths of a percent; aliases annual_rate, annual_percent, and interest_rate map to the same field. If rate is missing, empty, infinite, or otherwise not a finite number, the task fails with invalid_input naming rate; that is the contracted error and it is not billed. frequency is n, an integer from one through three hundred sixty-five compounding periods per year, with aliases n, compounds_per_year, and compounding_frequency. years is t, a finite number from zero through one hundred twenty; fractional years such as two point five are allowed, and aliases t, time, and periods_years are accepted. Each field may arrive as a JSON number or a numeric string. On success the body echoes principal, rate, frequency, and years, reports periods as n times t, and returns final_balance and interest rounded half-up to two decimal places for stable currency-style goldens, plus a formula string restating A equals P times one plus r over n to the n t.
Where a compound interest API earns its keep
Households and students use a compound interest calculator when a savings balance, a certificate of deposit, or a homework problem asks how much a lump sum grows at a stated annual rate with a stated posting frequency. Personal-finance coaches need a deterministic oracle that rejects a non-finite rate instead of silently showing NaN that a buggy form might treat as success. When you later need regular deposits, switch to a future-value-of-annuity identity rather than stretching this four-field lump-sum contract. Product teams wire the same contract into onboarding demos so a user who types a principal, a percent, monthly compounding, and a horizon sees the identical final_balance the API will later return in production tests. Keep requests small, pin rounded final_balance and interest in tests, and you get reproducible future values for worksheets, LMS plugins, and edge workers without standing up a spreadsheet service of your own.
Integration use cases
Product demos and CI fixtures
Seed budgeting apps and automated tests with deterministic final_balance and interest values that match the free browser widget byte-for-byte.
Technical questions
What does the compound interest calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.