Free Tax Tool

Capital Gains Tax Calculator

Estimate the 2026 tax on selling stocks, crypto, or a home: the 0%, 15%, and 20% long-term rates, short-term gains at ordinary rates, the 3.8% NIIT, and state tax.

$

What you sold the stock, crypto, or property for, after fees

$

What you paid plus improvements and buying costs. Enter 0 and put the gain in sale price to use a known gain.

$

Wages and other ordinary income before the standard deduction

Optional. Approximated with the state's top rate.

Applies the home sale exclusion: $250,000, or $500,000 married filing jointly.

2026 federal capital gains tax

Federal long-term capital gains tax

$1,417.50

Capital gain
$20,000.00
Taxable gain
$20,000.00
Taxed at 0%
$10,550.00
Taxed at 15%
$9,450.00
Taxed at 20%
$0.00
Net investment income tax (3.8%)
$0.00
Federal tax if held 1 year or less
$3,250.00

Long-term gains stack on top of your ordinary taxable income (after the standard deduction) to set the 0%, 15%, and 20% split. Short-term gains are taxed at ordinary rates. The 3.8% NIIT applies to the gain only to the extent income exceeds the threshold.

2026 total tax and what you keep

Gain you keep after tax

$18,582.50

Federal capital gains tax
$1,417.50
Net investment income tax
$0.00
Total tax on the sale
$1,417.50
Effective tax rate on the gain
7.09%
Sale proceeds after tax
$48,582.50

Estimate only. Uses the standard deduction and ignores the 28% collectibles rate, 25% unrecaptured section 1250 gain on depreciated real estate, loss carryovers, and other gains or losses. State tax is approximated as the gain times the state's top rate; most states tax capital gains as ordinary income.

How capital gains tax is calculated

  1. Find the gain: sale price minus cost basis (what you paid plus fees and improvements). For your main home, subtract the $250,000 or $500,000 exclusion first.
  2. Find your ordinary taxable income: wages and other income minus the standard deduction. Short-term gains are simply added to it and taxed at your regular brackets, the same way the federal income tax calculator works.
  3. Stack long-term gains on top. The part of the gain that keeps total taxable income under the 0% ceiling is tax-free, the part up to the 15% ceiling is taxed at 15%, and anything above is taxed at 20%.
  4. Add the 3.8% net investment income tax if your income is over $200,000 ($250,000 married filing jointly), plus any state income tax.

Example: a single filer with $55,000 of wages sells stock held for three years for $50,000 that cost $30,000, a $20,000 long-term gain. After the $16,100 standard deduction, ordinary taxable income is $38,900. The first $10,550 of the gain fills the space up to the $49,450 0% ceiling and is tax-free. The remaining $9,450 is taxed at 15%, for $1,417.50 of federal tax, an effective rate of 7.09% on the gain. Had the stock been held a year or less, the same gain would cost $3,250 at ordinary rates.

Withdrawals from retirement accounts are not capital gains; they are ordinary income, which you can estimate with the 401(k) withdrawal tax calculator. Retirees should also know that capital gains count toward the income test that decides how much of your benefit is taxed, so check the taxable Social Security calculator before a big sale. Lottery and casino prizes are taxed as ordinary income, not capital gains; see the lottery tax calculator.

Frequently asked questions

What are the 2026 capital gains tax rates and brackets?

Long-term gains are taxed at 0%, 15%, or 20% based on your total taxable income. For 2026, the 0% rate applies up to $49,450 of taxable income for single filers and married filing separately, $98,900 for married filing jointly, and $66,200 for head of household. The 15% rate applies up to $545,500 single, $613,700 married filing jointly, $306,850 married filing separately, and $579,600 head of household. Income above those amounts is taxed at 20%.

What is the difference between short-term and long-term capital gains?

If you own an asset for more than one year before selling, the gain is long-term and gets the lower 0%, 15%, or 20% rates. If you own it one year or less, the gain is short-term and is taxed as ordinary income at your regular bracket, which can be as high as 37%. Holding period starts the day after you buy and includes the day you sell.

How do I avoid capital gains tax on a home sale?

If you owned and lived in the home as your main residence for at least 2 of the 5 years before the sale, you can exclude up to $250,000 of gain, or $500,000 if married filing jointly. You generally cannot have used the exclusion on another home in the prior two years. Gain above the exclusion is taxed as a long-term or short-term capital gain. Records of improvements raise your cost basis and lower the gain.

Do I pay capital gains tax if I reinvest the money?

Yes, in a regular taxable brokerage account. Selling and buying something else is still a sale, so the gain is taxable that year even if you never withdraw the cash. Trades inside a 401(k) or IRA are not taxed when you sell; you pay tax (or not, for qualified Roth withdrawals) when money comes out. Like-kind exchanges that defer tax only apply to real estate held for business or investment.

How is crypto taxed?

The IRS treats cryptocurrency and other digital assets as property. Selling crypto, trading one coin for another, or spending it on goods creates a capital gain or loss equal to the value received minus your basis, with the same short-term and long-term rates as stocks. Brokers began issuing Form 1099-DA for digital asset sales in 2025, and you report each sale on Form 8949 and Schedule D.

What is the 3.8% net investment income tax?

The net investment income tax (NIIT) is an extra 3.8% on investment income, including capital gains, for people with modified adjusted gross income above $200,000 single or head of household, $250,000 married filing jointly, or $125,000 married filing separately. It applies to the smaller of your net investment income or the amount your income exceeds the threshold. Excluded home sale gain does not count.

Do capital gains count as income for tax brackets?

Long-term gains are stacked on top of your ordinary income. They do not raise the rate on your wages, but your wages fill the lower brackets first, which decides how much of the gain falls in the 0%, 15%, or 20% band. Gains do raise your adjusted gross income, which can trigger the NIIT, reduce credits and deductions that phase out, make more Social Security taxable, and raise Medicare premiums.

Do states tax capital gains?

Most states with an income tax treat capital gains as ordinary income at their regular rates. States without an income tax, like Texas and Florida, do not tax them, while Washington has a separate excise tax on large long-term gains. A few states offer partial exclusions. This calculator approximates state tax with the top state rate, so treat it as a rough estimate.

Sources

Related tools