1. Home
  2. Calculators
  3. Capital Gains Tax Calculator
Free calculator

Capital gains tax calculator: estimate the tax before you sell

Reviewed by a licensed financial advisor

Estimate the federal and state tax on the sale of stocks, funds, property or other investments, using the 2026 and 2027 long-term and short-term rates.

Results update as you typeReviewed by the My Financial Next Step teamUpdated November 2026
Person reviewing tax documents before selling investments

Enter your numbers

Type a value or drag the slider. Your results update instantly.

On this page
  1. How to use this capital gains tax calculator
  2. Long-term capital gains tax rates
  3. Short-term capital gains
  4. Ways to reduce capital gains tax
  5. A worked example
  6. How other income changes the tax
  7. Short-term vs. long-term
  8. Filing status and state tax
  9. A larger sale
  10. Ways to reduce the tax
  11. Getting your cost basis right
  12. What the calculator leaves out
  13. Common mistakes
  14. Next steps
  15. Frequently asked questions

How to use this capital gains tax calculator

Enter what you paid for the asset, including commissions and improvements, and what you expect to sell it for. Add your other taxable income for the year, after deductions. Set filing status to 1 for single or 2 for married filing jointly, and the holding period to 1 if you owned the asset for more than a year. Choose the tax year of the sale and your state’s rate. The capital gains tax calculator shows the gain, the federal and state tax, and what you keep.

Long-term capital gains tax rates

Assets held longer than one year are taxed at 0%, 15% or 20%. The rate depends on your total taxable income, including the gain.

Rate2026 single2026 married filing jointly2027 single2027 married filing jointly
0%Up to $49,450Up to $98,900Up to $51,050Up to $102,100
15%$49,451 to $545,500$98,901 to $613,700$51,051 to $563,200$102,101 to $633,600
20%Over $545,500Over $613,700Over $563,200Over $633,600

The gain is stacked on top of your other income. A single filer with $40,000 of other taxable income and a $30,000 long-term gain in 2026 pays 0% on the first $9,450 of the gain and 15% on the remaining $20,550, for about $3,083 of federal tax. High earners may also owe the 3.8% net investment income tax once income passes $200,000, or $250,000 for joint filers. The calculator adds an estimate of it when it applies.

Short-term capital gains

Gains on assets held one year or less are taxed as ordinary income, at rates from 10% to 37%. Using the example numbers above, the $40,000 gain costs $6,000 in federal tax if held long term and about $9,186 if sold short term. Waiting until the one-year mark can make a real difference.

Planning for the whole year? Read our tax planning guide.

Ways to reduce capital gains tax

  • Hold for more than a year to qualify for long-term rates.
  • Harvest losses. Losses offset gains, plus up to $3,000 of ordinary income a year, and the rest carries forward.
  • Time the sale. Selling in a lower-income year can keep more of the gain in the 0% or 15% band.
  • Use the home sale exclusion. Up to $250,000 of gain on a primary residence, or $500,000 for joint filers, can be excluded if you meet the ownership and use tests.
  • Give appreciated assets. Donating shares to charity avoids the gain entirely.

A worked example with the default numbers

The calculator starts with an asset bought for $50,000 and sold for $90,000, held longer than a year, by a single filer with $85,000 of other taxable income in 2026 and a 5% state tax rate. The capital gain is $40,000. Because the filer’s other income is already above the top of the 0% bracket ($49,450 for single filers in 2026), the entire gain is taxed at 15% federally, which is $6,000. State tax at 5% is $2,000. The total is $8,000, which is 20% of the gain, and the seller keeps $82,000 of the $90,000 sale price.

The calculator stacks the gain on top of your other income, so the same sale can be taxed at a different rate depending on what else you earned that year. That is the key idea behind the rest of this page.

How your other income changes the tax

Keeping the same $40,000 long-term gain and 5% state rate, here is what happens as other taxable income changes (single filer, 2026):

Other taxable incomeFederal taxNet investment income taxTotal taxShare of gain
$30,000$3,082$0$5,08212.7%
$60,000$6,000$0$8,00020.0%
$85,000$6,000$0$8,00020.0%
$150,000$6,000$0$8,00020.0%
$300,000$6,000$1,520$9,52023.8%

At $30,000 of other income, part of the gain falls in the 0% bracket. Between roughly $50,000 and several hundred thousand dollars, the federal rate is 15%. At $300,000 the 3.8% net investment income tax applies to the part of income over $200,000, which adds $1,520 here. Federal tax does not change between $60,000 and $150,000 because the gain stays within the 15% bracket across that range.

Short-term compared with long-term

The same $40,000 gain sold after holding for one year or less is taxed as ordinary income. With $85,000 of other income, the federal tax rises from $6,000 to $9,186, and the total including state tax rises from $8,000 to $11,186, or 28% of the gain. At $150,000 of other income, the short-term federal tax is $9,600. Waiting past the one-year mark on this sale would save about $3,186. If you are a few weeks from one year, check the exact date the holding period is measured from before you sell.

Filing status and state tax

Married couples filing jointly get wider brackets. The same $40,000 gain with $85,000 of other income and a joint return has $3,915 of federal tax instead of $6,000, because part of it falls into the 0% bracket (which extends to $98,900 for joint filers in 2026). Total tax with a 5% state rate is $5,915, or 14.8% of the gain. With $60,000 of other income, joint filers owe only $165 of federal tax and $2,165 in total.

State tax makes a visible difference too. On the $40,000 gain, a state with no income tax leaves the total at $6,000 (15%), a 5% state makes it $8,000 (20%) and a 9% state makes it $9,600 (24%). Enter your own state rate, since some states tax capital gains differently from ordinary income.

A larger sale

Consider a $100,000 investment sold for $500,000 by a single filer with $150,000 of other income. The gain is $400,000. Federal tax is about $60,225, the net investment income tax adds about $13,300, and a 5% state tax adds $20,000, for a total near $93,525, or 23.4% of the gain. Part of the gain is taxed at 20% because it passes the top of the 15% range. Large sales are where planning has the most value, since spreading a sale across tax years can keep more of the gain in lower brackets.

Ways people reduce capital gains tax

  • Hold for more than a year. The long-term rates are lower than ordinary rates.
  • Sell in a lower-income year. A year with a career break, retirement or a gap between jobs can place more of the gain in the 0% bracket.
  • Harvest losses. Losses offset gains, and net losses can offset up to $3,000 of ordinary income a year, with the rest carried forward. The wash-sale rule disallows a loss if you buy the same or a substantially identical investment within 30 days before or after the sale.
  • Donate appreciated assets. Giving appreciated shares you have held more than a year to charity can avoid the gain, and you may be able to deduct the value.
  • Use tax-advantaged accounts. Gains inside an IRA or 401(k) are not taxed in the year of the sale.
  • Choose which shares to sell. If you bought at different prices, selling higher-cost shares first can reduce the gain. Ask your broker whether specific lot selection is available.

Getting your cost basis right

Your cost basis is what you paid, plus commissions and, for property, improvements. Reinvested dividends add to basis, which many people forget, so the same dollars are not taxed twice. Inherited assets are generally valued at their value on the date of death, and gifted assets usually carry the giver’s basis, so the rules depend on how you acquired the asset. Gather records before you sell, because a wrong basis changes the entire result.

What the calculator does not cover

  • Home-sale exclusions for a main residence.
  • Depreciation recapture on rental or business property.
  • Higher rates on collectibles and certain small business stock.
  • Alternative minimum tax and phase-outs of deductions or credits.
  • Local taxes.

It is an estimate. Confirm the final figure with a tax professional before a large sale.

Common mistakes

  • Using the sale price as the gain. Tax applies only to the gain after basis.
  • Forgetting state tax. It can add several points to the bill.
  • Selling a day too early. Check the holding period.
  • Ignoring the effect on other income. A large gain can push other income into a higher bracket or trigger the investment income tax.
  • Not planning for estimated payments. A large gain may require quarterly payments to avoid an underpayment penalty.

Next steps

Enter the basis, expected sale price, other income, filing status and state rate for your own situation, then try selling in a different tax year or after the one-year date to see the difference. If a sale is large or involves a business, home or inherited property, request a free call using the form on this page. A licensed advisor will reach out by phone or video to talk through the planning, free and with no obligation.

Frequently asked questions

How is capital gains tax calculated?

Subtract your cost basis from the sale price to find the gain. Long-term gains are taxed at 0%, 15% or 20% based on your taxable income. Short-term gains are added to your ordinary income and taxed at your regular rates.

How much income can I have and pay 0% capital gains tax?

For 2026, taxable income up to $49,450 for single filers and $98,900 for married couples filing jointly. For 2027, the limits rise to $51,050 and $102,100.

Do I pay capital gains tax when I sell my house?

Often not. If you owned and lived in the home for at least two of the five years before the sale, you can exclude up to $250,000 of gain, or $500,000 if married filing jointly. This calculator does not apply that exclusion.

Do states tax capital gains?

Most states tax capital gains as regular income, and a few have no income tax. Enter your state’s rate above, and check current rules with a tax professional.

Sources and further reading

See our editorial standards for how we build and review our tools.

Learn more

Guides that explain these numbers

Want help planning around a big sale?

Talk it through with a licensed financial advisor, by phone or video call. Free and with no obligation.

Talk to an advisor →
From the blog

Latest money guides and ideas