Skip to content
KalkNest

How we calculate

Last updated

Every number on KalkNest comes from one calculation engine: the same code runs the calculator in your browser and computes the worked examples on our pages, including the ones below. This page sets out the formulas it follows, the assumptions it makes, how it rounds, and how we checked its results.

The compound interest formula

When interest is added to the balance, the next interest payment is worked out on the larger balance. With no deposits or withdrawals, the balance after a number of years is:

A = P × (1 + rn)nt

A
the balance at the end
P
the starting amount
r
the yearly interest rate as a decimal (5% is 0.05)
n
how many times a year interest is added
t
the number of years

Example: $10,000.00 at 5% a year, added once a year for 10 years. The growth factor is (1 + 0.05) to the power 10, which is 1.628895, so the balance ends at $16,288.95. That is $6,288.95 of interest, against $5,000.00 if interest were never added to the balance (simple interest).

Compounding frequency and the effective rate

The calculator offers interest added daily (365 or 360 times a year), twice a week, weekly, every two weeks, twice a month, monthly, every two months, quarterly, twice a year, yearly, continuously, or any custom number of times a year. A rate quoted per month, week or day is turned into a yearly rate by multiplying it by the number of such periods in a year (1% a month is a 12% nominal yearly rate).

The more often interest is added, the more the balance grows for the same quoted rate. The effective annual rate, often called APY, shows the growth over one year:

APY = (1 + rn)n − 1

r
the nominal yearly rate as a decimal
n
how many times a year interest is added

At 5% with monthly compounding, the effective rate is 5.12%. The table shows the same $10,000.00 over 10 years:

$10,000.00 at 5% for 10 years, at each compounding frequency
CompoundingFuture valueTotal interestAPY
Yearly (1/yr)$16,288.95$6,288.955.000%
Half-yearly (2/yr)$16,386.16$6,386.165.062%
Quarterly (4/yr)$16,436.19$6,436.195.095%
Monthly (12/yr)$16,470.09$6,470.095.116%
Daily (365/yr)$16,486.65$6,486.655.127%
Continuously$16,487.21$6,487.215.127%

Continuous compounding

Continuous compounding is the limit as interest is added more and more often. The balance grows exponentially, with e (about 2.71828) as the base:

A = P × ert

r
the yearly rate as a decimal
t
the number of years

$10,000.00 at 5% for 10 years grows to $16,487.21 with continuous compounding, a little more than with daily compounding.

Regular deposits

When the same amount is added every time interest is added, the textbook formula is the future value of the starting amount plus the future value of the deposits:

A = P × (1 + i)N + PMT × (1 + i)N − 1i

i
the interest rate per period (r divided by n)
N
the number of periods
PMT
the deposit each period

Deposits at the start of each period earn one more period of interest:

A = P × (1 + i)N + PMT × (1 + i)N − 1i × (1 + i)

Real schedules do not always line up with the compounding, for example weekly deposits into an account that adds interest monthly. So the engine does not rely on the formula alone: it follows the account through time. Inside each compounding period, every amount earns simple interest for the part of the period it was in the account, and the interest is added to the balance at the end of the period. This is how banks usually credit interest. When deposits and compounding do line up, it gives the same result as the formulas above.

Example: $5,000.00 at 5% compounded monthly, adding $100.00 at the end of each month for 10 years, ends at $23,763.28: $12,000.00 of deposits and $6,763.28 of interest. Paying the $100.00 at the start of each month instead gives $23,827.98.

Year by year: $5,000.00 plus $100.00 a month at 5%
YearDepositsInterestBalance
1$1,200.00$283.70$6,483.70
2$1,200.00$359.60$8,043.30
3$1,200.00$439.39$9,682.69
…
10$1,200.00$1,124.73$23,763.28

Deposits can rise every year, by a percentage or a fixed amount. A percentage increase is rounded to whole cents each year, as a bank would pay it.

Withdrawals

Withdrawals can be a fixed amount, a percentage of the balance at the start of each withdrawal period, or a percentage of the interest earned since the previous withdrawal. A fixed withdrawal can rise every year like a deposit. The balance never goes below zero: when the money runs out, withdrawals stop and the calculator shows the month it happened and the largest withdrawal that would last the whole term.

Fees

A yearly fee, such as a fund's annual charge, is taken as a share of the balance. It builds up through each compounding period like interest and is taken off when interest is added, so it reduces the rate the balance grows at:

A = P × (1 + r − fn)nt

f
the yearly fee as a decimal (1% is 0.01)

With continuous compounding the fee is applied the same way, as a factor of (1 − f) per year.

$10,000.00 at 7% for 30 years grows to $76,122.55 without fees. A 1% yearly fee brings it down to $57,434.91: the fee costs $18,687.64, of which $7,905.80 is fees paid and the rest is growth those fees would have earned.

Inflation

Inflation does not change the balance; it changes what the balance can buy. The calculator shows the final balance in today's money by dividing it by the growth in prices over the term:

today's money = A(1 + π)t

π
the yearly inflation rate as a decimal
t
the number of years

$10,000.00 at 6% for 20 years ends at $32,071.35. With prices rising 3% a year, that buys what $17,757.13 buys today.

Doubling time and the Rule of 72

The time for money to double depends only on the effective yearly rate:

t = ln 2ln(1 + APY)

The Rule of 72 is a mental shortcut: divide 72 by the rate in percent (R).

t ≈ 72R

At 8% a year the exact time is 9 years and 1 month, and the Rule of 72 gives 9 years. The calculator shows the exact time, rounded up to the next whole month, because that is when the balance has actually doubled. It is shown only when there are no withdrawals.

Assumptions

  • The interest rate stays the same for the whole term. Real investment returns go up and down, and can be negative.
  • No taxes are taken off interest or gains.
  • Deposits and withdrawals happen on schedule. A year has 12 months; weekly payments mean 52 a year, every two weeks 26 a year.
  • Interest earned in a final, incomplete compounding period is added at the end of the term.
  • The rate of return over the whole term is the total gain (final balance plus withdrawals, minus the starting amount and deposits) divided by the money put in.

Rounding

  • The engine works with full precision and rounds only what it shows: money to the cent (whole yen for JPY), rates to two decimals unless more are needed.
  • In the yearly and monthly tables every row is rounded to the cent, and the interest shown is the change in the rounded balance minus deposits plus withdrawals and fees, so every row and every total adds up exactly.
  • The totals on a page are the sums of those rounded rows, so the summary, the chart and the table always agree.
  • When the calculator solves for a deposit that reaches a goal, the deposit is rounded up to the next cent, so it really reaches the goal.

How we checked the results

The engine is tested automatically every time the code changes:

  • Formulas: results are compared with the closed formulas above wherever they apply (lump sums at every frequency, continuous compounding, deposits that line up with compounding, effective rates, doubling times).
  • Consistency: the monthly and yearly breakdowns must add up to the same totals, the balance must equal the money put in plus interest minus the money taken out, every displayed table must add up to the cent, and goal answers must agree with a full simulation.
  • Reference scenarios: we entered a set of scenarios into an established online compound interest calculator and recorded its results. Our engine must reproduce each final balance and yearly row to the cent (within a few cents in two scenarios where the other calculator rounds each withdrawal and its own table drifts by a few cents). The table below is calculated live by our engine on this page:
Final balances: the reference calculator's published result next to ours, for the same inputs
ScenarioReference resultKalkNestDifference
$5,000 at 5% a year, compounded monthly, $100 deposited at the end of each month, 10 years$23,763.28$23,763.28Same to the cent
$5,000 at 5% a year, compounded monthly, no deposits, 5 years$6,416.79$6,416.79Same to the cent
$5,000 at 5%, compounded monthly, $100 deposited at the start of each month, 10 years$23,827.98$23,827.98Same to the cent
$10,000 at 5%, compounded daily (360 days a year), 10 years$16,486.64$16,486.64Same to the cent
$10,000 at 5%, compounded daily (365 days a year), $100 a month, 10 years$32,023.26$32,023.26Same to the cent
$10,000 at 1% a month, compounded yearly, 5 years$17,623.42$17,623.42Same to the cent
$5,000 at 5%, compounded monthly, $100 a month rising 5% each year, 10 years$27,378.72$27,378.72Same to the cent
$5,000 at 5%, compounded monthly, $100 a month rising $10 each year, 10 years$30,114.43$30,114.43Same to the cent
$100,000 at 5%, compounded monthly, $500 withdrawn each month, 10 years$87,059.81$87,059.81Same to the cent
$100,000 at 5%, compounded monthly, 0.5% of the balance withdrawn each month, 10 years$90,479.97$90,479.97Same to the cent
$100,000 at 5%, compounded monthly, half of each month's earnings withdrawn, 10 years$128,369.12$128,369.153 cents apart
$10,000 at 6%, compounded quarterly, $200 a month in and $1,000 a year out, 5 years$21,759.66$21,759.66Same to the cent
$5,000 at 5%, compounded monthly, $100 each quarter, 2 years and 6 months$6,722.69$6,722.69Same to the cent

There are two cases where we differ from that calculator on purpose. With weekly or fortnightly deposits into a monthly compounding account, we credit each deposit on its own date, so it starts earning interest straight away, while the other calculator treats them as one deposit at the end of the month. And when withdrawals are larger than the balance, we stop at zero and say when the money ran out, instead of letting the balance go negative. The calculator's questions and answers explain both.

Limits

These are estimates for learning and planning, not financial advice; see the disclaimer. If you think a result is wrong, please contact us with the page link or the calculator's share link, and we will check it.