Money
Capital Gains Tax Calculator
The federal tax on selling stocks, funds or other investments in 2026: which of the 0%, 15% and 20% rates your gain falls in, how losses offset it, and how much it adds to your tax bill.
Enter your gain and your other income to see the federal tax on it.
How this calculator works
How long you held the investment decides how the profit is taxed. Sold after more than one year, it is a long-term gain, taxed at 0%, 15% or 20%. Sold within a year, it is a short-term gain, taxed as ordinary income at your regular bracket rate.
The rate on a long-term gain depends on your total taxable income, not on the gain alone. Your other income fills the bottom of the range and the gain sits on top. For a single filer in 2026, the part of the gain below $49,450 of taxable income is taxed at 0%, the part between that and $545,500 at 15%, and anything above at 20% — so one gain can be taxed at two rates.
Gains and losses are netted the way Schedule D does it: short-term with short-term, long-term with long-term, then one against the other. If the year ends in a net loss, up to $3,000 of it ($1,500 married filing separately) comes off your other income, and the rest carries forward to later years.
Higher earners also pay the 3.8% net investment income tax, on the smaller of their investment income or the amount their income exceeds $200,000 ($250,000 married filing jointly). Those thresholds are fixed in law and are not adjusted for inflation.
The headline figure is what the gains add to your tax. The calculator works out your federal income tax with them and without them and shows the difference, which is what most people mean when they ask how much tax they will owe on a sale.
The formula
Exactly what happens to your numbers, step by step.
Netting
gain at 0/15/20% = net long-term gain − any net short-term lossWhatever is left of a short-term gain is taxed as ordinary income.
Stacking
ordinary taxable income = taxable income − long-term gains − qualified dividends 0% on the part of the gains below the 0% limit 15% on the part between the 0% limit and the 15% limit 20% on the part above the 15% limitThe limits apply to total taxable income, with the gains counted last.
Net investment income tax
NIIT = 3.8% × min(investment income, income − threshold)Tax on your gains
tax on gains = tax with the gains − tax without them
A worked example
A single filer with $50,000 of other income sells shares held for three years at a $30,000 profit.
What you enter
- Filing status
- Single
- Long-term gain
- $30,000
- Other income
- $50,000
- Deduction
- Standard ($16,100)
Step by step
- Taxable income
- $80,000 − $16,100 = $63,900
- Other income, taxed first
- $33,900 at ordinary rates = $3,820.00
- Gain up to $49,450
- $15,550.00 at 0% = $0
- Gain above $49,450
- $14,450.00 at 15% = $2,167.50
Tax on the gain: $2,167.50, which is 7.2% of the $30,000
More than half of the gain is taxed at nothing, because it falls under the 0% limit. Federal income tax comes to $5,987.50 in all, against $3,820.00 with no gain.
Assumptions
Every result here rests on these. Change your inputs and the result changes with them.
- 2026 figures from IRS Rev. Proc. 2025-32. The 0% rate applies up to $49,450 of taxable income for single filers and married filing separately, $66,200 for heads of household and $98,900 for married filing jointly. The 15% rate applies up to $545,500, $306,850, $579,600 and $613,700 respectively.
- A gain is the sale price minus your cost basis: what you paid, plus fees and any reinvested dividends. Enter the gain, not the sale price.
- Other income is ordinary taxable income before the standard deduction: wages after pre-tax 401(k) and HSA contributions, interest, ordinary dividends and so on.
- The standard deduction is the basic 2026 amount for your filing status, without the extra amounts for being 65 or older or blind.
- The net investment income tax counts only the gains and dividends entered here. Other investment income, such as interest or rent, would raise it.
What this cannot tell you
- Collectibles and depreciation. Gains on art, coins and other collectibles are taxed at up to 28%, and the part of a property gain that comes from depreciation at up to 25%. Neither is modeled.
- Selling your home. Up to $250,000 of gain on your main home ($500,000 married filing jointly) is usually excluded if you owned it and lived in it for at least two of the five years before the sale. Enter only the gain above the exclusion.
- State tax. Many states tax capital gains too. This shows federal tax only.
- Credits, the alternative minimum tax and the Schedule 1-A deductions are not included, so this estimates what the gains add rather than your whole return. For the rest of the return, use the income tax calculator.
- Losses carried forward from earlier years are not tracked. Add them to this year’s losses before entering.
Questions people ask
What are the capital gains tax rates for 2026?
Long-term gains are taxed at 0%, 15% or 20%, depending on taxable income. For a single filer in 2026, the 0% rate covers taxable income up to $49,450 and the 15% rate up to $545,500, with 20% above that. For married couples filing jointly the limits are $98,900 and $613,700. Short-term gains are taxed at ordinary income rates, from 10% to 37%.
Can I really pay 0% on capital gains?
Yes, if your taxable income including the gain stays under the 0% limit: $49,450 for a single filer in 2026. The standard deduction comes off first, so a single person with no other income could have up to $65,550 of long-term gains and owe no federal income tax on them.
How long do I have to hold an investment to pay the lower rate?
More than one year. Held for a year or less, the gain is short-term and taxed like your wages. Selling a few days later can move a gain from your bracket rate to 15% or even 0%.
Do capital losses lower my taxes?
Yes. Losses first cancel out gains, without limit. If you still have a net loss, up to $3,000 of it ($1,500 married filing separately) comes off your other income for the year, and the rest carries forward to later years.
Are qualified dividends taxed like capital gains?
Yes. Qualified dividends, in box 1b of Form 1099-DIV, are taxed at the same 0%, 15% and 20% rates and stack on top of your income the same way. Dividends that are not qualified are taxed as ordinary income, so add those to your other income instead.
Related calculators
- Income Tax CalculatorYour 2026 federal income tax, bracket by bracket, with the new tips, overtime and senior deductions.Money
- Investment Growth CalculatorProject a portfolio with contributions, fees and inflation applied.Money
- ROI CalculatorReturn on investment as a total percentage and an annualized rate.Money
- Self-Employment Tax CalculatorSocial Security and Medicare on freelance or business profit, with any W-2 wages taken into account.Work & Pay
Sources and review
Sources
- IRS Rev. Proc. 2025-32 — 2026 inflation adjustments
- IRS Topic no. 409 — Capital gains and losses (holding period, rates, the $3,000 loss limit)
- IRS Topic no. 559 — Net investment income tax
- IRS Topic no. 404 — Dividends (qualified dividends at capital gain rates)
- IRS Topic no. 701 — Sale of your home (the $250,000 / $500,000 exclusion)
Methodology version 1.0.0 · Last reviewed · Tax year 2026
Cite this calculator
For coursework, a resource list or your own site. How every calculator is built and checked is set out on the methodology page.
Citation
Chalk Calculator. (2026, October 1). Capital Gains Tax Calculator (Methodology version 1.0.0). https://chalkcalculator.com/capital-gains-tax-calculator/Link to it from your site
<a href="https://chalkcalculator.com/capital-gains-tax-calculator/">Capital Gains Tax Calculator</a> from Chalk Calculator