How to use this capital gains tax calculator
Capital gains tax is where a lot of people make avoidable mistakes, and the mistakes are expensive. The good news is that most of the fix is about timing.
The one-year line
Hold an asset more than one year and the gain is taxed at preferential rates of 0%, 15% or 20%. Hold it one day less and the entire gain is taxed at your ordinary rate, up to 37%.
For a $20,000 gain on an asset with a 24% ordinary rate and a 15% long-term rate, that difference is $1,800. For a larger portfolio with multiple positions, the sum of those differences is the largest tax lever most people have.
How the long-term brackets work
Long-term capital gains have their own brackets that stack on top of your ordinary income brackets. For a single filer in 2025, roughly the first $47,000 of long-term gains is taxed at 0% — entirely tax-free — gains up to about $533,400 are taxed at 15%, and anything above that at 20%. Married filers get roughly double the thresholds.
Because these thresholds sit on top of ordinary income, the amount of tax-free gains you get shrinks as your salary rises. A $47,000 gain is entirely tax-free for someone with no other income and entirely taxed at 20% for someone with a large salary.
The 3.8% surtax
Above $200,000 of modified AGI for single filers ($250,000 married jointly), an additional 3.8% applies to net investment income. It applies to long-term gains, dividends, interest and other investment income. The threshold is not indexed for inflation and has not changed since 2013, which means it captures progressively more people as nominal incomes rise.
Harvesting losses
Realised losses can offset gains. The mechanics have sharp edges:
- Short-term losses offset short-term gains; long-term losses offset long-term gains
- Up to $3,000 of net loss offsets ordinary income each year; the rest carries forward indefinitely
- Losses do not offset the 0% bracket — so if you have $50,000 of long-term gains and harvest $5,000 of losses, you still pay tax on $45,000 of gains, but now at the 0% rate instead of 15%
That last point catches people. Harvesting losses makes sense when your gains are in the 15% or 20% bracket, and it is counterproductive when your gains are already at 0%.
Where the money actually goes
Capital gains are taxed on the difference between what you sold for and what you paid, minus selling expenses. For a stock position, the basis is what you paid in commissions. For property, it is the purchase price plus buying costs, plus any improvements you made. For crypto, it is what you paid for the coins.
If you have been trading for years, your broker reports your realised gains and losses annually on Form 1099-B. That is the number the IRS uses, and it will not match your mental accounting. Review it before you file.