Capital Gains Tax Calculator
Selling an investment almost always triggers capital gains tax, and how long you held it changes the rate dramatically. Holding for more than a year can cut your rate from your ordinary income bracket to 0, 15 or 20 percent.
The sale
What you sold the asset for, before commissions and fees.
What you paid, including reinvested dividends and purchase commissions.
The holding period starts the day after you buy and ends on the day you sell.
Wages and other income. Long-term gains stack on top of this.
Short-term vs long-term on this exact gain
The only difference between these two columns is how long you held the asset. On a $30,000 gain that is a $2,100 difference.
Held 1 year or less
Held more than 1 year
What you keep
2026 federal rates. The 0% long-term bracket is used up by your ordinary income first, so a high salary pushes gains into the 15% bracket. State tax on capital gains is not included, and neither is the Section 121 exclusion for a primary residence. Short-term gains may also be subject to the 3.8% net investment income tax.
Short-term versus long-term
Hold for one year or less and the gain is short-term, taxed at your ordinary income rates, up to 37 percent. Hold for more than one year and it becomes long-term, taxed at 0, 15 or 20 percent depending on your income.
The one-year mark is measured from the day after you bought to the day you sold. Missing it by a day can cost thousands of dollars.
Long-term rates stack on your ordinary income
Long-term capital gains do not start in the 0 percent bracket from dollar zero. They stack on top of your ordinary income, so a high salary can push gains out of the 0 percent bracket entirely.
For 2026, single filers pay 0 percent on long-term gains up to $49,450 of total taxable income, 15 percent up to $545,500, and 20 percent above that.
The 3.8 percent net investment income tax
High earners pay an additional 3.8 percent on the smaller of net investment income or the amount of modified adjusted gross income above $200,000 for single filers and $250,000 for couples.
That surtax pushes the top effective long-term rate to 23.8 percent.
Frequently asked questions
Do I pay capital gains tax if I lost money?
No. You can also use capital losses to offset gains dollar for dollar, plus up to $3,000 of ordinary income per year. Excess losses carry forward indefinitely.
How do I avoid capital gains tax when selling my home?
Under Section 121 you can exclude up to $250,000 of gain if single, or $500,000 if married filing jointly, provided you owned and lived in the home for two of the past five years.
What is the wash sale rule?
If you sell at a loss and buy a substantially identical security within 30 days before or after, the loss is disallowed for tax purposes. It does not apply to gains.
Are capital gains taxes different in retirement accounts?
Yes. Gains inside a 401(k) or IRA are not taxed when you sell, only when you withdraw, and then at ordinary income rates for traditional accounts. Roth accounts are tax-free if you meet the qualified distribution rules.
This calculator is an educational tool and does not constitute financial, tax or legal advice. Results are estimates based on the inputs and assumptions described above. Verify important figures with a qualified professional or the relevant government agency before acting on them.