CaixaUnica CaixaUnica
← Back to blog
  • darf
  • stocks
  • income tax
  • investments
  • irpf

DARF on stock sales: the R$ 20,000 exemption and how to calculate the tax

July 15, 2026 · 6 min read · by CaixaUnica Team

DARF on stock sales: the R$ 20,000 exemption and how to calculate the tax

You sold some stocks, the money landed in your account, and a nagging question followed: do I owe tax on this? Almost everyone has heard the answer — "up to R$ 20,000 is exempt" — and almost everyone repeats the rule wrong. The detail that changes everything is what those R$ 20,000 actually measure.

The exemption looks at how much you sold, not how much you profited

The monthly exemption rule is about the total sold in the month, meaning the sum of everything you disposed of — not about the profit left over.

Compare two situations in the same month:

Total sold Profit Tax
Sold little, profited a lot R$ 18,000 R$ 9,000 exempt
Sold a lot, profited little R$ 25,000 R$ 900 15% on the R$ 900

In the first case the profit was ten times bigger and no tax arises at all. In the second, a tiny profit is taxed because the volume sold crossed the line. That is why "I barely made anything, so it's exempt" is the sentence that sends the most investors into the Receita Federal's audit net.

Two practical consequences:

  • The math is per month, not per trade or per year — each month closes on its own, and selling R$ 19,000 in January and R$ 19,000 in February is very different from selling R$ 38,000 in January.
  • It is the sum across all brokerages — the exemption is yours, not your broker's. If you sold R$ 12,000 at one and R$ 11,000 at another, you went past R$ 20,000.

Heads up: the R$ 20,000 exemption comes from Lei 11.033/2004 and is still in force — but it is a recurring target for reform. In 2025, MP 1.303 proposed replacing it with a flat 17.5% rate and a R$ 60,000 per-quarter exemption; that measure lapsed without becoming law. Before filing, check whether the rule changed for your tax year.

When the DARF is due

Went past R$ 20,000 in the month and had a profit? Then the tax is 15% on the profit — never on the total sold. Payment is made via DARF (the federal tax payment slip), under code 6015, by the last business day of the month following the sale.

One detail that saves headaches: a DARF under R$ 10 is not paid on its own. It carries forward and is added to a later month that generates tax.

And the month's profit can be reduced by losses from previous months, as long as they come from the same type of operation. Losses from common operations offset profits from common operations; day trade only offsets day trade.

FIIs are another story — and this one catches a lot of people

The R$ 20,000 exemption applies to stocks in common operations. It does not extend to real-estate funds.

  • Selling FII units (FII = Brazilian REIT) — always 20% on the profit, with no exemption band at all, even if you only sold R$ 500.
  • Monthly FII income — that one usually is exempt, and it goes in a different section of the return. It is a separate subject that deserves its own article.
  • Day trade — 20% on the profit, no exemption, calculated separately from common operations.

Mixing those three buckets into "I sold stocks and FIIs, it came to less than R$ 20,000, so I'm exempt" is one of the costliest mistakes on an investor's IRPF (Brazil's individual income tax return).

Profit depends on your average price — and that is where the math derails

Notice that every rule above turns on one word: profit. And profit is the sale price minus your average cost — the calculation the Receita requires, which has to account for every earlier purchase of that security, across every brokerage, including stock splits and bonus shares.

If the average cost is wrong, the DARF is wrong — even if you understand the exemption rule perfectly. If that part is still a spreadsheet you don't quite trust, it is worth first reading how to calculate the average price of stocks, which is the foundation of this whole calculation.

How CaixaUnica does this math for you

When you import your B3 reports, the portfolio already calculates the average cost of each security. The Variable Income section of the IRPF report uses that cost to close out the calculation:

  • Closes month by month — sums the total sold in each month and applies the R$ 20,000 check on its own, adding up all your accounts.
  • Estimates the DARF — 15% on the profit calculated on common operations when the month goes past the exemption.
  • Separates the FIIs — selling units goes into the 20% bucket, with no exemption, just as the rule requires.
  • Classifies before taxing — a fixed-income redemption is not variable income, and each asset class falls under its own rule instead of everything becoming a "sale".

It is worth spelling out what it does not do today: the calculation covers common operations, so day trade and automatic loss carryover between months are still on you. The report is an estimate for you to check — not a substitute for the Receita's own software.

The codes for each asset in the Bens e Direitos (assets and rights) section are in IRPF Bens e Direitos codes.

How to get started

  1. Export the year's trading and movement reports from B3.
  2. Import the files into the portfolio — re-importing the same file duplicates nothing.
  3. Check the average cost of the securities you sold during the year.
  4. Generate the IRPF report and look at the Variable Income section, month by month.

The Portfolio module is part of the paid plans — current prices are always on the pricing page. You can create an account and import your reports to see the calculation with your own numbers.

Important: this article is educational and does not replace an accountant or the Receita's official rules. The rates and exemption band cited apply to common operations by individuals; day trade, stock lending and complex corporate events have their own treatment — confirm with a professional.

Sources