Quick answer
Sell an asset for $75,000 that cost $40,000 after holding it 18 months, and the $35,000 gain costs $5,250 in federal tax for a single filer earning $90,000, all taxed at 15%. Sold within a year, the same gain would cost $7,764 at ordinary rates. Holding past 12 months saves $2,514.
How the Capital Gains Tax Calculator works, step by step
Enter what you paid for the asset, what you sold it for, how long you held it, your other income and your filing status. The gain is the sale price minus the cost basis, and the holding period decides the tax treatment: more than 12 months is long-term, one year or less is short-term. A loss is not taxed at all, and up to $3,000 of net capital losses a year can offset other income.
Long-term gains are taxed at 0%, 15% or 20% depending on your total taxable income. For 2026 the 0% rate covers taxable income up to $49,450 for single filers and $98,900 for joint filers, and 20% starts above $545,500 single or $613,700 joint. Your other income fills the lower bands first, and the gain stacks on top. That stacking is why two identical gains can be taxed at different rates.
Short-term gains get no preferential rate: they are added to your other income and taxed at your ordinary marginal rate, which can reach 37%. The calculator shows both figures side by side for the same sale, so you can see exactly what waiting past the 12-month mark is worth before you sell. On a large gain the difference can be thousands of dollars, as the example below shows.
Higher earners also face the 3.8% net investment income tax on top of the capital gains rate. It applies to the smaller of your net investment income or the amount by which your modified adjusted gross income exceeds $200,000 single or $250,000 joint. Those thresholds are not indexed for inflation, so more filers cross them each year.
This is a federal estimate only. Most states tax capital gains as ordinary income, with no preferential rate, and a few states have no income tax at all. The calculator also leaves out the wash-sale rule, collectibles rates and the home-sale exclusion, so confirm the details with the IRS or a tax professional before a large sale.
The formula
Gain = sale price minus cost basis. Long-term tax = the part of the gain inside the 0% band times 0%, plus the part inside the 15% band times 15%, plus the part above the 20% threshold times 20%, plus 3.8% net investment income tax where it applies. Short-term tax = ordinary bracket tax on the gain stacked on other income.
Worked example — try it on the calculator above
Worked example: $35,000 gain after 18 months, single filer
You buy shares for $40,000 and sell them 18 months later for $75,000, a $35,000 gain. Your other income is $90,000, so your taxable income before the gain is $73,900 after the $16,100 standard deduction. That already passes the $49,450 ceiling for the 0% rate, so the whole gain is taxed at 15%, giving $5,250. Net proceeds are $69,750. Had you sold within a year, the gain would have been taxed at ordinary rates, costing $7,764, so holding past 12 months saves $2,514. Your modified AGI of $125,000 is below the $200,000 threshold, so no net investment income tax applies.
Frequently Asked Questions
How long do I have to hold an asset for the long-term rate?
More than one year. An asset bought on March 1, 2025 and sold on March 2, 2026 is long-term; sold on March 1, 2026 it is short-term. The holding period starts the day after you buy. The calculator treats anything over 12 months as long-term, so set the slider past 12 to see the long-term figure.
Can I pay 0% tax on a capital gain?
Yes, if your total taxable income stays under the 0% ceiling: $49,450 for single filers or $98,900 for joint filers in 2026. A retiree with $30,000 of taxable income could realize a $19,000 long-term gain and pay no federal tax on it. State tax may still apply, and the gain itself counts toward the ceiling.
What is the net investment income tax?
A 3.8% surtax on investment income, including capital gains, dividends and rental income, for filers whose modified adjusted gross income exceeds $200,000 single or $250,000 joint. It applies to the smaller of your investment income or the amount above the threshold. Combined with the 20% rate, the top federal rate on a gain is 23.8%.
Do states tax capital gains at lower rates too?
Most do not. The majority of states tax capital gains as ordinary income at the state's regular rates. A few, such as Arizona and New Mexico, offer a partial exclusion. Nine states have no income tax on wages at all, which also means no state tax on gains. Check your state revenue department for the exact treatment.

Estimates, not advice. This calculator provides educational estimates based on the inputs you enter and the assumptions shown on this page. It is not financial, tax or investment advice, and it cannot see your full situation. Verify important figures against official sources, and consider a qualified professional for decisions about your own money. See our Disclaimer and Methodology.