Capital gains tax isn’t one flat rate. The same $20,000 gain can cost nothing, $3,000 or close to $4,800 depending on your other income and how long you held the asset. The calculator above runs the 2026 federal math, including the part people tend to miss: gains are stacked on top of your other income.
Enter your filing status, your other income and your gains. The result shows how much of the gain falls at each rate, the total tax and how much room you have left in the 0% bracket.
Long term and short term gains

The dividing line is one year. Sell something you held for more than one year and the gain is long term. Hold it one year or less and it’s short term.
Short term gains are taxed like wages, at your regular income tax rate, from 10% to 37%. Long term gains get their own rates of 0%, 15% or 20%.
For 2026, under IRS Revenue Procedure 2025-32, the long term rates apply to taxable income in these ranges:
- 0%: up to $49,450 single, $98,900 married filing jointly
- 15%: up to $545,500 single, $613,700 joint
- 20%: above those amounts
Waiting a few extra days to pass the one year mark can cut the tax on a gain by more than half for someone in the 22% or 24% bracket.
How stacking works
Your ordinary income, meaning wages, pensions, IRA withdrawals, interest and short term gains, fills the brackets first. Long term gains go on top.
A single filer with $60,000 of other income and the $16,100 standard deduction has $43,900 of taxable ordinary income. The 0% bracket ends at $49,450, so only $5,550 of a long term gain fits there. If the gain is $20,000, the other $14,450 is taxed at 15%. That’s about $2,168 of tax on the gain, an average of 10.8%.
Lower the other income and more of the gain lands at 0%. A single filer with no other income and a $40,000 long term gain owes nothing, because the first $16,100 is covered by the standard deduction and the rest fits in the 0% bracket.
Short term gains push the line the other way. They’re ordinary income, so they use up 0% room that long term gains could have had.
The 3.8% surtax
People with higher income may also owe the net investment income tax. It’s 3.8% on investment income, including capital gains, once modified AGI passes $200,000 for single filers or $250,000 for married couples filing jointly. Those limits aren’t adjusted for inflation.
The calculator adds it when it applies. A single filer with $300,000 of other income and a $100,000 long term gain would pay 15% plus 3.8%, or $18,800 in total.
Things the calculator leaves out

A few types of gains have their own rules:
- Your home. Up to $250,000 of gain, or $500,000 for married couples, is excluded if you owned and lived in the home for two of the last five years.
- Collectibles. Gains on art, coins, precious metals and similar items can be taxed up to 28%.
- Rental property. Depreciation you claimed is recaptured and can be taxed up to 25%.
- Small business stock. Qualified small business stock can be partly or fully excluded.
State tax isn’t included either. Most states tax capital gains as regular income, and a few have no income tax at all.
Losses and net gains
Enter net gains. Your losses for the year offset your gains first, short term against short term and long term against long term, then across.
If losses are larger than gains, up to $3,000 of the extra can offset other income, and the rest carries forward. Our guide to tax loss harvesting explains the wash sale rule that applies when you sell at a loss and buy back.
Cost basis
The gain is the sale price minus your cost basis, which is usually what you paid plus fees. Reinvested dividends add to your basis. Missing them means paying tax twice on the same money.
Inherited assets usually get a stepped up basis equal to the value on the date of death. Gifted assets keep the giver’s basis. Our gift tax guide covers that difference.
Your broker reports basis on Form 1099-B for most shares bought after 2011. For older shares or assets held elsewhere, you need your own records.
Paying the tax on a big gain
A large sale late in the year can leave you short on tax payments. If there’s no withholding to cover it, you may need an estimated payment by January 15, 2027, or extra withholding from your last paychecks to avoid a penalty. Our underpayment penalty calculator checks if you’ve paid enough.
If you’re in a low bracket this year, it may make sense to sell winners now and use the 0% rate. Our article on tax gain harvesting walks through that.
Questions people ask
What income should I enter as other income?
Everything except the gains: wages, self employment profit, pension, IRA and 401(k) withdrawals, interest, ordinary dividends and the taxable part of Social Security. Qualified dividends are taxed at the long term rates, so you can add them to long term gains for a closer estimate.
Why does the result say part of my gain was covered by the deduction?
If your other income is smaller than your deduction, the leftover deduction offsets part of the gain before any rate applies.
Do I pay capital gains tax if I reinvest the money?
Yes. Selling triggers the tax, even if you buy something else right away. Retirement accounts are the exception. Trades inside an IRA or 401(k) aren’t taxed.
Does selling stock affect my Social Security or Medicare?
Gains raise your income, which can make more of your Social Security taxable and raise Medicare premiums two years later through IRMAA. They can also shrink ACA premium credits.
An estimate of 2026 federal tax for single and married filing jointly filers, using IRS Rev. Proc. 2025-32 brackets. It does not include state tax, the alternative minimum tax or special rates for collectibles and depreciation. Your tax return determines the actual result.