The Code Codex
Theme

Compound Interest Calculator

Simulate monthly contributions with Brazilian regressive income tax and inflation, compared with savings and CDI — what matters is the real value, in today's money.

The link keeps what is on screen.
Parameters
Investment
Returns
Compare with
You will have, after tax and inflationR$ 149.811Net amount: R$ 234.439 · Possible monthly income (4% rule): R$ 499
  • Total contributedR$ 130.000
  • Interest earnedR$ 122.989
  • Income tax on withdrawalR$ 18.549
Balance by yearContributionsInterest
063,2 mil126,5 mil189,7 mil253 mil12345678910
Show year-by-year table
YearContributionsInterestGross balance
1R$ 22.000,00R$ 1.846,50R$ 23.846,50
2R$ 34.000,00R$ 5.354,58R$ 39.354,58
3R$ 46.000,00R$ 10.723,62R$ 56.723,62
4R$ 58.000,00R$ 18.176,96R$ 76.176,96
5R$ 70.000,00R$ 27.964,69R$ 97.964,69
6R$ 82.000,00R$ 40.366,95R$ 122.366,95
7R$ 94.000,00R$ 55.697,48R$ 149.697,48
8R$ 106.000,00R$ 74.307,68R$ 180.307,68
9R$ 118.000,00R$ 96.591,09R$ 214.591,09
10R$ 130.000,00R$ 122.988,52R$ 252.988,52
Variables used in the calculation

Indicators (Central Bank of Brazil)

CDI
13.65% a.a. SGS 4389 as of 10/21/2026
Savings account (poupança)
8.2% a.a. (0.659% a.m.) SGS 195 as of 10/21/2026
Expected inflation (IPCA)
4.58% a.a. SGS 13522 as of 9/1/2026

Central Bank data updated on 10/22/2026.

Official rules and tables

Fixed income tax (regressive)
22,5% → 20% → 17,5% → 15% · Lei 11.033/2004
Sustainable withdrawal
4% a.a.

Compare with

  • Your investmentR$ 149.811In today's moneyNet amount: R$ 234.439
  • SavingsR$ 130.344In today's moneyNet amount: R$ 203.975
  • 100% of CDIR$ 163.399In today's moneyNet amount: R$ 255.703
How is it calculated?
Annual rates are effective: the monthly rate is (1 + annual)^(1/12) − 1, and each contribution lands at the end of the month. Income tax follows the regressive table (22.5% up to 6 months, 20% up to 1 year, 17.5% up to 2 years, 15% above), computed per contribution since each has its own holding period. The real value divides the net balance by cumulative inflation. Management and custody fees are not included.
See the code ↗

Processed in your browser; nothing is sent.

⌨️ Use from the terminal (JSON)

This tool also runs outside the site: the cli.js script uses the same logic as this page and returns the result as JSON. Parameters are the same as this page's URL — copy the command below with the values on screen.

Deno
deno run -q "https://thecodecodex.com/cli.js?tool=compound-interest"
Node.js / Bun
curl -s https://thecodecodex.com/cli.js | node --input-type=module - compound-interest inicial=…
ParameterDescriptionDefault
inicialdepósito inicial10000
aporteaporte mensal1000
anosprazo em anos10
taxarentabilidade anual efetiva (fração)0.12
ir0 = sem IR1
ipcainflação anual (fração)IPCA 12m do BCB
poupancapoupança anual (fração)poupança do BCB
cdiCDI anual (fração)CDI do BCB

Requires Deno, Node.js or Bun. With Deno the script runs with no permissions: it cannot read files or access the network. Central Bank indicators are from the day the site was published.

More in Finance