How the Compound Interest Calculator Works
AnyTool Compound Interest Calculator projects growth in the browser using the standard lump-sum formula A = P(1 + r/n)ⁿᵗ, where P is the starting amount, r is the annual rate as a decimal, n is the number of compounding periods per year and t is the number of years. Regular contributions are not folded into a single annuity formula; instead a month-by-month loop credits interest at the chosen compounding frequency and adds each deposit exactly on its period (at the beginning or end), which stays correct even when the contribution frequency differs from the compounding frequency. The 0% case degrades cleanly to simply the money paid in. All arithmetic is pure client-side JavaScript shared through a reusable, unit-tested investment engine designed to also power SIP, FD/RD, PPF, retirement and inflation tools.
- A = P(1 + r/n)ⁿᵗ for the lump sum; r is the annual rate as a decimal
- Contributions added period by period in a month-granular loop, not approximated
- Begin-of-period deposits earn one extra period of interest versus end-of-period
- Effective annual yield (APY) is (1 + r/n)ⁿ − 1 for the nominal rate
- All math is client-side JavaScript in a reusable investment engine — no server round-trip
