Capital Gains Tax Calculator 2026

Selling something for more than you paid for it feels like a win until the tax bill arrives, and the size of that bill depends on three things most sale prices never mention: how long you held the asset, how much other income you already have, and what exactly you sold. Hold a stock for over a year and your gain is taxed at the preferential long-term rates of 0%, 15% or 20%. Sell inside a year and the same gain is taxed at your ordinary income rates, up to 37%. Sell your main home and up to $250,000 of gain ($500,000 married filing jointly) may be excluded entirely under Section 121. Sell a rental property and the slice of gain tied to depreciation you claimed is unrecaptured Section 1250 gain, shown here at the 25% maximum rate (simplified). This capital gains tax calculator walks through that real stacking math for 2026: your other taxable income fills the capital gains bands first, your gain takes whatever band room is left, the 3.8% net investment income tax is estimated for higher incomes, and you see the tax band by band, your effective rate and your after-tax gain. It is a federal estimate only: state taxes are not included, because states tax gains very differently and several tax them as ordinary income. It is a planning estimate, not tax advice.

Last updated: November 14, 2026

Filing status

$ Your taxable income from everything else, wages and other income after your deductions, not counting this gain. The gain stacks on top of it, so this figure decides which capital gains band the gain lands in.

$ What you sold the asset for, minus what it cost you (your basis) and minus selling costs. For a home, use the gain before any home-sale exclusion, the calculator applies the exclusion for you.

How long did you hold the asset?
What did you sell?

Official source: IRS — Topic No. 409, Capital gains and losses

The formula

  • Capital gain = amount realized on the sale − adjusted basis (what you paid, plus improvements, minus depreciation)
  • Taxable gain = capital gain − Section 121 home-sale exclusion, if you qualify ($250,000 single / $500,000 married filing jointly)
  • Long-term gain stacks on top of your other taxable income: 0% up to $49,450 single / $98,900 joint / $66,200 head of household / $49,450 married filing separately, 15% up to $545,500 / $613,700 / $579,600 / $306,850, then 20%
  • Short-term gain stacks through the 2026 ordinary brackets (10% to 37%): tax on (other income + gain) − tax on other income alone
  • Unrecaptured Section 1250 gain = min(depreciation taken, taxable gain), taxed at the 25% maximum rate (simplified); the rest of the gain stacks normally
  • Net investment income tax (est.) = 3.8% × min(taxable gain, MAGI − $200,000 single or head of household / $250,000 joint / $125,000 married filing separately), when positive; MAGI is approximated as other taxable income + the gain
  • Total federal tax on the gain = band tax + Section 1250 tax + NIIT (est.); after-tax gain = capital gain − total federal tax

A worked example

Single filer with $40,000 of other taxable income who sells stock held for over a year at a $30,000 gain: the first $9,450 of the gain fits in the 0% band (which tops out at $49,450 of taxable income), the remaining $20,550 is taxed at 15%, federal tax on the gain is $3,082.50, and the after-tax gain is $26,917.50. No net investment income tax applies at this income level.

More about the Capital Gains Tax Calculator

The 2026 long-term capital gains brackets

Long-term capital gains, from assets held for over a year, are taxed at three federal rates: 0%, 15% and 20%. Which rate applies is not decided by the size of the gain alone. The IRS looks at your total taxable income, your other income plus the gain, and the gain fills whatever is left of each band. The thresholds below are the taxable income levels for the 2026 tax year, set in IRS Revenue Procedure 2025-32, Section 4.03.

Read the table by finding your filing status column. If your total taxable income stays under the 0% ceiling, your long-term gain is taxed at 0%. Income between the two ceilings is taxed at 15%, and only the part of the gain that pushes total taxable income past the second ceiling pays 20%.

Long-term rate Single Married filing jointly Head of household Married filing separately
0% Taxable income up to $49,450 Up to $98,900 Up to $66,200 Up to $49,450
15% $49,450 to $545,500 $98,900 to $613,700 $66,200 to $579,600 $49,450 to $306,850
20% Over $545,500 Over $613,700 Over $579,600 Over $306,850

How long-term gains stack on your other income

The single most misunderstood part of capital gains tax is stacking. Your gain does not start at the bottom of the bands. Your other taxable income, wages, business income, interest and everything else, sits at the bottom and fills the 0% band first. The gain is poured on top, and only the band room your other income did not use is available to it.

That is why the same $30,000 stock gain can be taxed at 0% for one person and 15% for another. With $20,000 of other taxable income as a single filer, the whole gain fits under the $49,450 ceiling and the federal tax is $0. With $40,000 of other income, only $9,450 of room remains, so $20,550 of the gain spills into the 15% band. The calculator does this stacking for you, which is why it asks for other taxable income before it asks for the gain.

A practical consequence: a year with unusually low other income, a gap between jobs, a sabbatical, the early years of retirement before pensions and required distributions begin, is often the cheapest year to realize a large long-term gain, because more of the 0% and 15% bands are empty.

Short-term gains: taxed like wages

Sell an asset a year or less after buying it and there is no preferential rate at all. A short-term gain is added to your ordinary income and taxed through the regular 2026 brackets, 10%, 12%, 22%, 24%, 32%, 35% and 37%, set in Rev. Proc. 2025-32, Section 4.01. The calculator works it out the way the tax tables do: tax on your other income plus the gain, minus the tax on your other income alone. The difference is the tax the gain itself caused.

The bracket table below shows the 2026 ordinary brackets for every filing status this calculator supports. Heads of household get wider 10% and 12% brackets than single filers, and married filing separately uses half the joint thresholds through the 32% band, with the 37% rate starting at $384,350 instead of $768,700.

Ordinary rate Single Married filing jointly Head of household Married filing separately
10% Up to $12,400 Up to $24,800 Up to $17,700 Up to $12,400
12% $12,400 to $50,400 $24,800 to $100,800 $17,700 to $67,450 $12,400 to $50,400
22% $50,400 to $105,700 $100,800 to $211,400 $67,450 to $105,700 $50,400 to $105,700
24% $105,700 to $201,775 $211,400 to $403,550 $105,700 to $201,750 $105,700 to $201,775
32% $201,775 to $256,225 $403,550 to $512,450 $201,750 to $256,200 $201,775 to $256,225
35% $256,225 to $640,600 $512,450 to $768,700 $256,200 to $640,600 $256,225 to $384,350
37% Over $640,600 Over $768,700 Over $640,600 Over $384,350

Worked example: a long-term stock sale

Say you are single, you have $40,000 of other taxable income for 2026, and you sell stock you bought three years ago. You paid $20,000 for the shares and sell them for $50,000, so your capital gain is $30,000. Because you held the stock for over a year, the gain is long-term.

Now stack it. The 0% band for a single filer ends at $49,450 of taxable income. Your other income already uses $40,000 of that band, leaving $9,450 of 0% room, so the first $9,450 of the gain is taxed at 0%. The remaining $20,550 falls in the 15% band, which runs all the way to $545,500, so it is taxed at 15%: $20,550 × 15% = $3,082.50. Your modified adjusted gross income is nowhere near the $200,000 net investment income tax threshold, so no NIIT is added. Total federal tax on the gain: $3,082.50. After-tax gain: $30,000 − $3,082.50 = $26,917.50, an effective rate of about 10.3% on the gain.

Enter exactly these figures in the calculator above, single, $40,000 of other taxable income, a $30,000 gain, long-term, standard asset, and you will see the same $3,082.50, broken into the same two band slices.

How to calculate capital gains tax on a stock sale

Step one: find your proceeds. That is the total amount you received for the shares, which your broker reports on Form 1099-B. Step two: find your basis. For shares you bought, the basis is what you paid plus commissions. For shares received as a gift or inheritance, or through a stock split or dividend reinvestment plan, the basis rules differ, and getting the basis wrong is the most common reason a stock gain is overstated.

Step three: subtract. Gain = proceeds − basis − selling commissions and fees. Step four: check the holding period from your trade confirmations. Over a year means long-term and the 0%, 15% and 20% rates; a year or less means short-term and your ordinary rates. Step five: stack the gain on top of your other taxable income for the year and read off the band slices, exactly as the worked example above does. Step six: if your modified adjusted gross income is over $200,000 single or $250,000 married filing jointly, check the 3.8% net investment income tax as well.

One warning for active traders: the wash sale rule can disallow a loss if you buy substantially the same stock within 30 days before or after selling at a loss. It affects losses, not gains, but it changes the basis of the replacement shares, which changes the gain you calculate on the next sale.

Selling your main home: the Section 121 exclusion

For most people the biggest capital gain of their life is their house, and the tax code gives it the biggest break. Under Section 121 of the Internal Revenue Code, if you owned the home and lived in it as your main home for at least 2 of the 5 years before the sale, you can exclude up to $250,000 of the gain, or $500,000 on a joint return. The 2 years of ownership and the 2 years of use do not have to be the same 2 years, and they do not have to be continuous.

The calculator applies the exclusion when you choose Main home and answer yes to the ownership and use question. A $400,000 gain on a single filer’s home sale becomes a $150,000 taxable gain, and the excluded $250,000 is not taxed at all. Note the ordering with the net investment income tax: the NIIT in this calculator is charged only on the taxable part of the gain, because excluded gain is not investment income. Gain above the exclusion stacks through the long-term bands like any other gain.

Partial exclusions exist when you sell early because of a job move, health reasons or unforeseen circumstances, and there are special rules for homes that were also rented out or used as an office. Those cases are beyond this calculator: if your sale does not fit the simple owned-and-lived-in pattern, the full exclusion answer needs your actual dates and facts.

Rental and investment real estate: depreciation and the 25% slice

Real estate gains have a second layer that stock gains do not. Every year you owned a rental property, you were entitled to a depreciation deduction, and that depreciation also reduced your basis, which makes the eventual gain bigger. The tax code claws part of that benefit back: the portion of your gain that matches the depreciation you took is unrecaptured Section 1250 gain, taxed at a maximum rate of 25% rather than the usual capital gains rates.

This calculator models that slice at exactly the 25% maximum rate (simplified), and labels it that way in the result. The slice is the smaller of your total depreciation and your taxable gain; the rest of the gain stacks through the 0%, 15% and 20% bands as normal. Two honest caveats. First, on a real return the capital gain worksheet can tax part of the unrecaptured slice at less than 25% when your income is low, so the figure here is a ceiling, not always the exact bill. Second, depreciation is recaptured whether or not you actually claimed it, because basis is reduced by depreciation that was allowable, so keep your depreciation records even if you skipped the deduction in some year.

Short-term real estate sales are different again: a property sold within a year was never depreciated on the same schedule and its gain is ordinary income. Choose short-term in the calculator and the depreciation field is ignored, by design.

The 3.8% net investment income tax

High earners owe one more layer. The net investment income tax, Section 1411 of the Internal Revenue Code, adds 3.8% on the smaller of your net investment income or the amount by which your modified adjusted gross income exceeds $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). Unlike the brackets, these thresholds are fixed in the statute and are not adjusted for inflation, so more sellers cross them every year.

This calculator estimates the NIIT rather than computing it exactly. It approximates your MAGI as your other taxable income plus the full gain you entered, then applies 3.8% to the smaller of your taxable gain (after any Section 121 exclusion) and the excess over your threshold. Real MAGI includes income items this page never asks about, so if you are near a threshold, treat the NIIT line as an estimate to verify, in the calculator’s own words, not as a filing figure. When it applies, it takes the top long-term rate from 20% to an effective 23.8% before state tax.

Common capital gains mistakes

Selling a few days too early. The difference between short-term and long-term is one day past the one-year mark, and on a large gain it can be the difference between a 37% top rate and a 20% top rate. Check the exact acquisition date before you sell, remembering the holding period starts the day after purchase.

Forgetting that the gain stacks. Sellers routinely look up “the capital gains rate” as if one rate applied to the whole gain. In reality the gain can span two or even three bands, and a big sale can also push your other income planning, estimated payments and the NIIT threshold into play. Run the stacking math, not a single-rate guess.

Losing track of basis. Improvements to a home, reinvested dividends in a fund, and depreciation on a rental all change your basis, and every dollar of basis you fail to document is a dollar of gain you overpay tax on. Keep purchase records, improvement receipts and brokerage statements for as long as you own the asset, and for at least three years after you sell it.

Assuming the federal answer is the whole answer. This page is a federal estimate, and state taxes are out of scope by design. Many states tax capital gains as ordinary income with no preferential rate at all, so a seller who budgets only for the federal figure can still be caught short in April.

How to use the Capital Gains Tax Calculator

  1. Choose your filing status, it sets the capital gains thresholds, the ordinary brackets and the home-sale exclusion.
  2. Enter your other taxable income, everything except this gain, after your deductions. The gain stacks on top of it.
  3. Enter the capital gain: what you sold the asset for, minus your basis and selling costs. For a home, enter the gain before any exclusion.
  4. Pick the holding period, long-term if you held the asset for over a year, short-term if a year or less, and say what you sold.
  5. For a main home, say whether you owned it and lived in it for at least 2 of the last 5 years. For rental real estate, add any depreciation you took.
  6. Press Calculate for the band-by-band federal tax, the NIIT estimate if it applies, your effective rate and your after-tax gain.

Frequently asked questions

How do I calculate capital gains tax on a stock sale?

First work out the gain: sale proceeds minus your basis (what you paid, including commissions) minus selling costs. Then check the holding period. Held over a year, the gain is long-term: stack it on top of your other taxable income and tax the slices at 0%, 15% or 20% using the 2026 thresholds for your filing status. Held a year or less, it is short-term and taxed at your ordinary rates. The worked example on this page shows the full arithmetic for a $30,000 long-term stock gain.

What are the capital gains tax brackets for 2026?

For long-term gains, the rate depends on your total taxable income and filing status. Single: 0% up to $49,450, 15% up to $545,500, 20% above that. Married filing jointly: 0% up to $98,900, 15% up to $613,700, 20% above. Head of household: 0% up to $66,200, 15% up to $579,600, 20% above. Married filing separately: 0% up to $49,450, 15% up to $306,850, 20% above. These thresholds are from IRS Rev. Proc. 2025-32. Short-term gains have no separate brackets, they use the ordinary 10% to 37% brackets.

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

The holding period. Sell an asset you held for over a year and the gain is long-term, taxed at the preferential 0%, 15% or 20% rates. Sell after a year or less and the gain is short-term, taxed at your ordinary income rates, which run from 10% to 37% in 2026. The day count matters: the holding period starts the day after you acquire the asset, and you must hold it for more than one year, selling exactly on the one-year anniversary is still short-term.

How much of my home sale gain can I exclude?

Under Section 121, if you owned the home and used it as your main home for at least 2 of the 5 years before the sale, you can exclude up to $250,000 of gain, or $500,000 if you are married filing jointly. The calculator applies that exclusion when you choose Main home and answer yes to the ownership and use question. Gain above the exclusion is taxed as a long-term capital gain, and the excluded part is also kept out of the net investment income tax estimate.

What is the net investment income tax and will I owe it?

The NIIT is an extra 3.8% tax on investment income, including capital gains, that applies once your modified adjusted gross income passes $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). Those thresholds are set by statute in IRC Section 1411 and are not indexed for inflation. This calculator estimates it using your other taxable income plus the gain as a MAGI proxy, and applies 3.8% to the smaller of your taxable gain and the amount over the threshold.

Why is part of my rental property gain taxed at 25%?

While you owned the property you likely claimed depreciation deductions against your rental income. When you sell, the part of the gain that corresponds to that depreciation is called unrecaptured Section 1250 gain and is taxed at a maximum rate of 25% instead of the usual 0%, 15% or 20%. This calculator models that slice, the smaller of your total depreciation and your gain, at exactly the 25% maximum rate (simplified) and stacks the rest of the gain through the normal bands. On a real return the Qualified Dividends and Capital Gain Tax Worksheet can tax some of that slice at lower rates, so treat the 25% figure as the ceiling it is labeled as.

Does this calculator include state capital gains tax?

No, and deliberately so. This is a federal estimate only. State treatment of capital gains varies widely: many states tax gains as ordinary income at their normal rates, a few give long-term gains a partial exclusion or a lower rate, and some states with no income tax still tax capital gains in specific situations. Check your state's rules separately and add that bill on top of the federal figure shown here.

Can I use this calculator for a loss, or for collectibles and crypto?

Enter gains only, the calculator expects a positive gain. Capital losses follow different rules, including the annual limit on deducting net losses against other income, and are not modeled here. Cryptocurrency held over a year is taxed like a standard long-term asset, so use the standard asset choice. Collectibles (art, coins, antiques) are taxed at a maximum rate of 28% on a real return, which this calculator does not model, so do not use the standard result for a collectibles sale.

What is tax-loss harvesting?

Tax-loss harvesting is selling an investment in a taxable account for less than you paid, so the realized loss can offset capital gains you have already taken. If losses exceed gains, up to $3,000 a year ($1,500 if married filing separately) can offset ordinary income, and any remaining loss carries forward to future years indefinitely. The strategy is most often used near year-end, but losses can be harvested whenever they appear.

What is the wash sale rule?

The wash sale rule disallows a capital loss if you buy the same or a substantially identical security within 30 days before or after selling it at a loss — a 61-day window in total. The disallowed loss is not usually lost forever; it is added to the cost basis of the replacement shares, deferring the benefit. The rule can also be triggered by a repurchase in your IRA.

What is a stepped-up basis for inherited property?

When you inherit property, your cost basis generally resets to its fair market value on the date the owner died, not what they originally paid. If a parent bought stock for $10,000 that was worth $90,000 at death, your basis is $90,000, and selling at that price creates no gain. Inherited assets are also treated as long-term, even if you sell soon after inheriting them.