A clean, dependency-free compound interest calculator
with monthly deposits, custom canvas chart, and ES/EN toggle.
Simulates the growth of an initial balance with monthly contributions at a fixed monthly return rate. Updates everything in real time as you type:
- 💰 Final balance — what you end with
- 📥 Capital invested — your money in (initial + monthly deposits × months)
- 📈 Interest earned — finalBalance − invested
- 🎯 Total return % — interest / invested
- 📊 Bar chart — monthly balance growth, custom canvas (no Chart.js)
- 📋 Detailed table — month-by-month breakdown with running totals
Or clone and open index.html in any browser. Zero build step.
git clone https://github.com/othmarodev/compound-interest-calculator.git
cd compound-interest-calculator
open index.htmlFor each month m from 1 to N:
gain[m] = balance[m-1] × (rate / 100)
balance[m] = balance[m-1] + gain[m] + deposit
Where:
rateis the monthly return (not annual)depositis applied after each month's gain- All values are USD-rounded to 2 decimals in the UI
For an annual rate, divide by 12 before entering. For example, an annual 12% becomes a monthly 1%.
- Pure vanilla — HTML + CSS + JS, all in a single 600-line
index.html - No dependencies — no npm, no build, no framework
- Custom canvas chart — gradient bars + dynamic Y-axis labels (no Chart.js)
- Mobile-first — responsive grid down to 360px
- Bilingual — ES / EN toggle with full UI translation
- Accessibility — semantic HTML, ARIA roles on language toggle
Everything ES2018+. Tested on Chrome, Safari, Firefox, Edge. Works on iOS Safari and Chrome mobile.
Originally part of fallaox.com — an automated trading platform — where investors use it to simulate strategy returns. Extracted as a standalone open-source tool because the math doesn't belong to anyone, and a clean compound-interest calculator is something everyone needs eventually.
MIT — see LICENSE. Use it, fork it, embed it, ship it.
Made with code, curiosity, and ☕ — from 🇨🇷 San José, Costa Rica · by Othmaro Fallas