Seven percent is not seven percent
Somebody asked me the question every compound interest calculator exists to answer — if I put this much away at this rate, what do I have in thirty years — and I did what I always do, which is open a spreadsheet and get the formula slightly wrong. Not wrong enough to notice. Wrong in the way these things are usually wrong: the rate on the account was a yearly number, the deposits were monthly, and I divided one by twelve and called it the monthly rate, which is what every textbook does and what nothing that pays interest actually does. The answer was off by a few thousand dollars over thirty years, and I would never have known, because a few thousand dollars over thirty years looks exactly like the right answer.
So I built the calculator properly: CompoundCalc. A starting balance, what you add and how often, the rate and how often it compounds, the years — and the balance comes back with the interest separated out, the schedule year by year, what the rate really is once its compounding is counted, the real doubling time beside the rule of 72, and how long a goal takes. This post is the arithmetic, and the two places it is usually done carelessly.
Seven percent is not seven percent
The number on an account is the nominal rate: seven percent a year, say. What you get depends on how often the interest is added to the balance so that it can earn interest itself. Compounded yearly, 7 % is 7 %. Compounded monthly, each month adds seven-twelfths of a percent to the balance, and the twelfth month's interest is earned on eleven months of earlier interest as well as on the principal, so the year comes to 7.229 %. Daily, it is 7.250 %. The formula is one line — the annual percentage yield, the APY, is (1 + r/n)n − 1 for n compounds a year — and the page prints it beside every result, with the numbers substituted, so you can see where the extra quarter of a point came from.
A quarter of a point does not sound like much, and at 7 % it is not. The gap grows with the rate: at 20 % the difference between yearly and daily compounding is over two points, which is why the rate on a credit card is quoted one way and charged another. It also grows with time, because the extra fraction compounds too. Put $10,000 and $500 a month into the tool at 7 % for thirty years and ask for the three compoundings:
| 7 % nominal, compounded | APY | After 30 years | Difference |
|---|---|---|---|
| Yearly | 7.000 % | $660,848.85 | — |
| Monthly | 7.229 % | $691,150.47 | + $30,302 |
| Daily | 7.250 % | $694,016.97 | + $33,168 |
Thirty thousand dollars between "7 % a year" and "7 % a year, compounded monthly", on the same deposits over the same years. Neither figure is wrong. They are answers to two different questions, and most calculators do not tell you which one they are answering. A savings account compounds daily; the long-run figures people quote for a stock index are yearly; a loan amortises monthly. The tool makes you say which, and then says what it comes to.
The rate the schedule actually uses
Here is the mistake I made in the spreadsheet, and it is in most of the compound interest formulas you will find written out. The future value of a regular deposit is the annuity formula, C × ((1 + i)N − 1) / i, with i the rate per deposit and N the number of deposits. The textbook gets i by dividing the annual rate by twelve. That is correct only when the account also compounds monthly. If it compounds daily, the balance has grown by thirty days of daily compounding between one deposit and the next, which is a little more than a twelfth of the nominal rate — and if it compounds yearly, a little less.
The honest version converts the nominal rate to an exact rate per deposit period: with n compounds and m deposits a year,
i = (1 + r / n)n / m − 1
For monthly deposits into a monthly-compounding account the exponent is one and this collapses to the textbook's r/12. For monthly deposits into a daily-compounding account it is 365/12 and the monthly rate at 7 % comes to 0.58498 % instead of 0.58333 %. For yearly deposits into a monthly account it is twelve, and the rate per deposit is exactly the APY. Twelve of those monthly periods compound to precisely the yearly figure, which is the test that proves the conversion right:
public function periodicRate(): float
{
$n = $this->compounding->perYear();
$m = $this->contributing->perYear();
return (1 + $this->rate / 100 / $n) ** ($n / $m) - 1;
}
Every number on the page comes from that one rate, in closed form. The balance after any number of periods is the formula evaluated once, and the year-by-year table is the same formula evaluated at each year mark, so the last row of the schedule and the headline figure cannot disagree — not because they are reconciled, but because they are the same calculation. A fifty-year plan costs fifty evaluations rather than eighteen thousand steps, and nothing is rounded to cents until it is printed, because this is a projection over decades and not a ledger.
Where the money comes from
The schedule is the part of the page I would send to someone who asked the question at the top. Take the tool's own example, $10,000 plus $500 a month at 7 %, compounded monthly, for thirty years, and read the interest column. The first year earns $919. The ninth year is the first in which the interest — $6,094 — is more than the $6,000 paid in, and from then on the account is contributing more than you are. The thirtieth year earns $46,373.53, which is nearly eight years of deposits, in one year, from a balance you mostly did not put there. Of the $691,150 at the end, $190,000 was deposited and $501,150 is interest: 72.5 % of the balance is money the money made.
The share climbs steadily, and it is worth watching it climb, because it is the only part of this that is intuitive once you have seen it and not before:
| After | Put in | Interest to date | Balance | Interest share |
|---|---|---|---|---|
| 5 years | $40,000 | $9,973 | $49,973 | 20 % |
| 10 years | $70,000 | $36,639 | $106,639 | 34 % |
| 15 years | $100,000 | $86,971 | $186,971 | 47 % |
| 20 years | $130,000 | $170,851 | $300,851 | 57 % |
| 25 years | $160,000 | $302,290 | $462,290 | 65 % |
| 30 years | $190,000 | $501,150 | $691,150 | 72.5 % |
Two smaller things the page handles that a spreadsheet usually does not. When in the month you pay in matters: a deposit at the start of the period earns one more period of interest than a deposit at the end, every time, which is the difference between an annuity due and an ordinary annuity. On $100 a month at 6 % for ten years that is $16,469.87 against $16,387.93 — half a percent, for the same money. The tool defaults to end-of-period, which is what most payroll deductions are, and has a switch. And inflation does not change the balance; it changes what the balance buys. Give the page an inflation rate and it adds a line saying so: the example's $691,150 is about $284,745 in today's money at 3 % a year, which is the figure to actually plan around and the one that most calculators leave out because it is depressing.
The rule of 72, measured
The rule everyone knows: divide 72 by the rate and you get the years it takes money to double. At 7 % that is 10.3 years. The exact answer is ln 2 / ln(1 + APY), and at 7 % compounded yearly it is 10.24 years — the rule is a few weeks out. Compounded monthly it is 9.93, because the APY is 7.229 and not 7. The page prints the exact figure and the rule's figure side by side, so I ran the rule at every rate from 2 to 30 % to see where it is actually good.
The answer is: between about 6 and 10 %, within a month. Below that it overstates — a full year at 2 %, which matters if you are doubling a savings account rather than a stock fund — and above it understates, by two or three months at the rates a credit card charges. The rule was chosen because 72 has so many divisors, not because it is the closest number; 69.3 is closer for very small rates, and the drift above 8 % is the rule being a straight line through a curve. It is a good rule. It is better when you know which way it is wrong.
When, not how much
The question people actually have is usually not "what will I have in thirty years" but "when will I have enough". The annuity formula inverts: given a target T,
N = ln((T + C/i) / (P + C/i)) / ln(1 + i)
and the page solves it rather than stepping forward a month at a time until the balance passes the line. A million dollars from the example takes 34 years and 10 months — four years and ten months past the thirty-year horizon above it, which the page says, so a goal is answered whether or not it falls inside the plan. Raise the deposit to $600 and it is 32 years 8 months; raise the rate to 8 % and it is 31 years 10 months, which is the usual lesson that the rate matters more than the deposit over long enough spans, with the usual caveat that you can choose the deposit and you cannot choose the rate.
Three answers are possible and the page gives each a different sentence. The target is already covered by the starting balance; or it will never be reached, which happens with no growth and no deposits, and also with a negative rate, where a shrinking balance topped up by deposits settles at a ceiling of C/|i| and never passes it; or a span of years and months. That third case had one bug worth telling: exactly at the ceiling, floating-point noise made the logarithm of almost-zero read as "in 653 years", which is a number nobody would have believed and a test now refuses.
What it does not know
The rate you type is the rate you get, every period, for the whole run, and nothing real does that. Real returns arrive in a different order every year, and the order matters when you are adding or withdrawing money; the same average return with the bad years first and the bad years last produces two different balances. Nothing is taxed, nothing is charged a fee, no deposit is missed, and the inflation line is the only concession to the world outside the formula. The page says this under the results, in the assumptions, and I would rather it said it too often than once.
None of this is advice. A calculator cannot know your taxes, your fees or your nerve, and one that claims to is selling something. What it can do is get the arithmetic exactly right and show its working, which is more than the spreadsheet did.
So I built it
Same shape as the three tools before it. The maths lives in PHP under test and does not know the web exists: the rate conversion, the annuity formula and its inverse, the schedule, the APY and the doubling time. The anchors are the textbook ones — $1,000 at 5 % for ten years is $1,628.89, $100 a month at 6 % for ten years is $16,387.93 — so a wrong formula cannot hide behind the page agreeing with itself, and the tool's own example is pinned to the cent in the same test that this post's figures came from. The page is the query string, so a plan is a URL: send it to someone and it opens to the same figures every time, which is the thing a spreadsheet attachment never quite does.
If you find a rate the page gets wrong, I would like to know which one and by how much. The one number I am least sure of is yours.