Back to Blog
FinancialAugust 1, 20269 min read

How Do You Calculate Capital Gains Tax in 2026?

Capital gains tax rates for 2026 are 0%, 15%, and 20% for long-term holdings, plus a 3.8% NIIT surcharge. Learn the 2026 brackets, the home sale exclusion, and how to calculate your tax bill.

By Calculators Planet
How Do You Calculate Capital Gains Tax in 2026?

You bought 200 shares of Apple at $75 in 2021. In 2026 they sit at $240. You want to sell. The gain looks like $33,000. But how much of that do you actually keep after taxes? That depends on how long you held the shares, your income, your filing status, and whether the Net Investment Income Tax applies to you.

Capital gains tax is one of the few taxes you can partially control. The timing of your sale, the assets you choose to sell, and the deductions you stack against the gain all change the final number. This guide walks through the 2026 federal capital gains brackets, the formulas, and real scenarios so you can estimate your bill before you sell.

What Capital Gains Tax Is and Why It Matters

A capital gain is the profit from selling a capital asset: stocks, bonds, real estate, crypto, mutual funds, art, or business property. The IRS splits gains into two categories based on holding period.

Short-term gains come from assets held one year or less. They are taxed as ordinary income, meaning they fall into the same brackets as your salary. The top federal rate is 37% in 2026.

Long-term gains come from assets held more than one year. They qualify for preferential rates of 0%, 15%, or 20%, depending on your taxable income. This is why holding period matters so much. A one-day difference in sale date can move a gain from the 37% short-term bracket to the 15% long-term bracket.

Use our Capital Gains Tax Calculator to estimate your liability before you sell.

The 2026 Long-Term Capital Gains Brackets

The IRS released the 2026 inflation-adjusted brackets in Revenue Procedure 2025-32. These apply to tax year 2026, for returns filed in early 2027.

Filing status0% rate up to15% rate band20% rate above
Single$49,450$49,451 to $545,500$545,500
Married filing jointly$98,900$98,901 to $613,700$613,700
Head of household$66,200$66,201 to $579,600$579,600

Capital gains stack on top of your ordinary income. If your salary puts you at $40,000 of taxable income as a single filer and you realize a $20,000 long-term gain, the first $9,450 of the gain fills the 0% bracket and the remaining $10,550 falls into the 15% bracket.

The 3.8% Net Investment Income Tax

High earners pay an additional 3.8% on investment income, including capital gains. The NIIT applies to the lesser of your net investment income or the amount by which your modified adjusted gross income exceeds the threshold.

Filing status2026 MAGI threshold
Single$200,000
Married filing jointly$250,000
Married filing separately$125,000

These thresholds are not indexed for inflation. They have stayed the same since 2013, which means more people get caught by the NIIT each year as incomes rise with inflation.

How to Calculate Your Capital Gains Tax

The formula for a capital gain is straightforward:

Gain = Sale price minus Cost basis

Cost basis is what you paid for the asset plus any commissions or fees. If you reinvested dividends, those increase your basis. If you made improvements to a property, those increase basis too.

To calculate the tax:

  1. Determine your holding period (short or long term).
  2. Add the gain to your other taxable income.
  3. Find which bracket the gain falls into based on your filing status.
  4. Apply the rate to the portion of gain in each bracket.
  5. Add the 3.8% NIIT if your MAGI exceeds the threshold.

Our Capital Gains Tax Calculator handles all of this automatically. You can also use the Income Tax Calculator to see your total tax picture.

Example 1: Selling Stock as a Single Filer

Marcus is 34, single, and earns $52,000 in salary in 2026. He sells 150 shares of an index fund he bought in 2022 for $8,000. He sells them for $19,500. His cost basis is $8,000.

Gain: $19,500 minus $8,000 = $11,500 (long-term, held over one year)

His 2026 standard deduction as a single filer is $16,100. His taxable income from salary after the standard deduction is $52,000 minus $16,100 = $35,900.

Now the $11,500 long-term gain stacks on top of $35,900, giving $47,400 in taxable income. The 0% bracket covers up to $49,450 for single filers. Since $47,400 is below $49,450, the entire gain falls in the 0% bracket.

Marcus pays $0 in federal long-term capital gains tax on this sale. This is the power of understanding brackets. If his salary had been $60,000 instead, his taxable income would be $43,900 plus $11,500 = $55,400. The first $5,550 of the gain would still be in the 0% bracket (up to $49,450), and the remaining $5,950 would be taxed at 15%, costing $892.50.

Example 2: Selling a Rental Property as a Married Couple

Sarah and James are married filing jointly. Their combined salary is $180,000. They sell a rental condo they bought in 2018 for $210,000. They sell it for $365,000. They made $25,000 in capital improvements over the years, so their adjusted cost basis is $235,000.

Gain: $365,000 minus $235,000 = $130,000 (long-term)

Their 2026 standard deduction is $32,200. Taxable income from salary: $180,000 minus $32,200 = $147,800.

The gain stacks on top: $147,800 plus $130,000 = $277,800. The 0% bracket covers up to $98,900 for MFJ, so $0 of the gain is taxed at 0% (their income already exceeds that threshold). The 15% bracket covers $98,901 to $613,700, so the entire $130,000 gain falls in the 15% bracket.

Tax on the gain: $130,000 x 0.15 = $19,500

Now check the NIIT. Their MAGI including the gain is $310,000, which exceeds the $250,000 MFJ threshold. The NIIT applies to the lesser of net investment income ($130,000) or the excess over the threshold ($60,000). So the NIIT is $60,000 x 0.038 = $2,280.

Total federal tax on the sale: $19,500 plus $2,280 = $21,780.

The Home Sale Exclusion

If you sell your primary residence, you may exclude up to $250,000 of gain as a single filer or $500,000 as a married couple filing jointly. The requirements are:

  • You owned and used the home as your principal residence for 2 of the 5 years before the sale.
  • You have not used the exclusion on another home sale in the prior 2 years.

These dollar amounts have not changed since 1997. There is a bill in Congress (the More Homes on the Market Act) that would double them to $500,000 and $1,000,000 and index them for inflation, but as of September 2026 it has not passed.

If your gain exceeds the exclusion, the excess is taxed as a long-term capital gain. Use our Mortgage Calculator and Closing Cost Calculator when planning a home sale.

Common Mistakes to Avoid

1. Not tracking cost basis accurately. Reinvested dividends increase your basis. If you forget them, you overpay. Brokerages are now required to report basis, but old holdings may still be on your records at the original purchase price without dividend adjustments.

2. Selling one day too early. If you buy on March 15 and sell on March 14 of the following year, that is 364 days. Short-term. Wait one more day and the same gain drops from ordinary income rates to long-term rates. The difference on a $50,000 gain can be thousands of dollars.

3. Forgetting state taxes. This guide covers federal rates only. Most states also tax capital gains, and a few like California do not offer preferential long-term rates. Check your state rules separately.

4. Ignoring the NIIT. If your income is near $200,000 single or $250,000 MFJ, a large capital gain can push you over the threshold and trigger the 3.8% surcharge on top of the regular capital gains rate.

External Research and Resources

People Also Ask

What is the capital gains tax rate for 2026?

The 2026 long-term capital gains rates are 0%, 15%, and 20%, depending on your taxable income and filing status. Short-term gains (assets held one year or less) are taxed as ordinary income at rates up to 37%.

How do I avoid capital gains tax on stocks?

You can reduce capital gains tax by holding assets over one year for long-term rates, harvesting losses to offset gains, donating appreciated stock to charity, or keeping your taxable income low enough to qualify for the 0% bracket ($49,450 single or $98,900 MFJ in 2026).

How much is the capital gains tax on a home sale?

If you lived in the home for 2 of the past 5 years, you can exclude up to $250,000 of gain (single) or $500,000 (married filing jointly). Any gain above the exclusion is taxed at long-term capital gains rates.

What is the Net Investment Income Tax?

The NIIT is a 3.8% surcharge on investment income, including capital gains, that applies to high earners. It kicks in when your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). These thresholds are not adjusted for inflation.

Do I pay capital gains tax if I reinvest?

Yes. Selling an asset triggers a taxable event even if you immediately reinvest the proceeds. The only exception is a 1031 exchange for investment real estate, which lets you defer the gain by rolling it into another property.

capital-gainstaxesinvestingreal-estate

Command Palette

Search calculators and pages