Selling an investment for a profit triggers a tax, and how much depends mostly on one thing: how long you owned it. This guide explains the federal rules in plain terms, lists the 2026 thresholds published by the IRS, and works through an example you can check yourself.
Updated November 2026
What counts as a capital gain
When you sell an asset such as stock for more than your cost basis, the difference is a capital gain. If you sell for less, it is a capital loss. Your basis is generally what you paid, adjusted for things like commissions or improvements. For the rules, start with IRS Topic No. 409.
Short-term vs long-term
The holding period decides the tax treatment. The IRS says that if you hold an asset more than one year before you dispose of it, the gain or loss is long-term. If you hold it one year or less, it is short-term. Net short-term gains are taxed as ordinary income at graduated rates. Long-term gains get lower rates of 0, 15 or 20 percent depending on your taxable income.
2026 long-term capital gains thresholds
These amounts come from IRS Revenue Procedure 2025-32, section 4.03, for tax year 2026. They apply to taxable income, including the gain.
| Filing status | 0% up to | 15% up to | 20% above |
|---|---|---|---|
| Single | $49,450 | $545,500 | $545,500 |
| Married filing jointly | $98,900 | $613,700 | $613,700 |
| Head of household | $66,200 | $579,600 | $579,600 |
| Married filing separately | $49,450 | $306,850 | $306,850 |
Worked example
All numbers here are illustrations. You bought shares for $20,000 and sell them for $35,000, a gain of $15,000. You file as single with $40,000 of other taxable income.
- Held more than a year, income $40,000: The first $9,450 of the gain fits under the $49,450 zero-rate threshold. The remaining $5,550 is taxed at 15 percent. Tax is $832.50.
- Held more than a year, income $120,000: Your income is already above the zero-rate threshold, so the whole gain is taxed at 15 percent. Tax is $2,250.00.
- Held one year or less, 22 percent ordinary rate: The gain is taxed like wages. Tax is $3,300.00. The 22 percent rate is an assumption for the example.
Waiting past the one-year mark cut the tax from $3,300.00 to $832.50 in the first case. A married couple filing jointly with $90,000 of other taxable income would owe $915.00 on the same gain, because $8,900 of it falls in the 0 percent band.
The 3.8 percent net investment income tax
Higher earners may also owe the net investment income tax (NIIT). According to IRS Topic No. 559, it is 3.8 percent and applies to the lesser of net investment income or the amount your modified AGI exceeds $250,000 for married filing jointly, $125,000 for married filing separately, or $200,000 for single and head of household. Gains from selling stocks, bonds, mutual funds and real estate generally count as net investment income, except for items such as an excluded principal residence gain.
Excel formula
With the gain in B1, other taxable income in B2, the zero-rate threshold in B3 and the 15 percent ceiling in B4, the long-term tax is: =0.15*MAX(0,MIN(B2+B1,B4)-MAX(B2,B3))+0.2*MAX(0,B2+B1-MAX(B4,B2,B3)). For a short-term gain use =B1*ordinary_rate. Our capital gains tax calculator applies the same logic and adds the NIIT estimate.
What this does not cover
- State taxes.
- Special rates for collectibles and certain real estate depreciation.
- Capital loss carryovers, wash sales and the home sale exclusion.
This is general information and not tax advice. To judge whether a sale made sense, compare the result with the ROI calculator, and if you are self-employed, see the self-employment tax calculator for your other tax bills.

Frequently asked questions
How long must I hold an asset for long-term treatment?
More than one year. IRS Topic No. 409 says holding an asset for more than one year makes the gain or loss long-term.
What are the 2026 long-term capital gains rates?
0, 15 and 20 percent. For 2026 the 0 percent rate applies up to $49,450 of taxable income for single filers, $98,900 for married filing jointly and $66,200 for head of household, per IRS Revenue Procedure 2025-32.
What is the 3.8 percent net investment income tax?
A tax on net investment income for taxpayers whose modified adjusted gross income is above $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately).
Do capital losses reduce my tax?
Capital losses can offset capital gains. The rules for deducting excess losses and carrying them forward are in IRS guidance, so check them or ask a tax professional.


