The short answer
When you sell stock for more than your cost, the profit is a capital gain and is generally taxable. How much tax you pay depends mainly on how long you held the shares. Shares held one year or less produce a short-term gain, taxed at your ordinary income tax rates. Shares held more than one year produce a long-term gain, taxed at 0%, 15%, or 20% depending on your taxable income. There is no single flat rate for all stock gains.
Realized vs. unrealized
A gain is generally taxed only when it is realized — when you sell. If your shares went up but you still own them, that is an unrealized gain and nothing is reported as a capital gain yet.
Step 1: figure the gain or loss
For each sale, your gain or loss is generally the amount you received minus your cost basis. Basis usually starts with what you paid for the shares, including certain costs of buying them. If you bought the same stock at different times, each lot can have a different basis and holding period.
If you got the shares through RSUs, an ESPP, or stock options, the income you already reported as wages is part of your basis. For awards granted after 2013, the basis on Form 1099-B won't include that income, so you may need to correct it on Form 8949 to avoid being taxed twice. See cost basis and Form 1099-B.
Step 2: short-term or long-term?
| Held for | Type | How it is generally taxed |
|---|---|---|
| One year or less | Short-term | At your ordinary income tax rates, like wages |
| More than one year | Long-term | At 0%, 15%, or 20%, depending on your taxable income |
You generally count from the day after you acquired the shares up to and including the day you sold them. Shares you inherited are treated as long-term regardless of how long you held them.
Long-term capital gain rates by tax year
The rate brackets are based on your total taxable income, not on the gain alone. The thresholds are adjusted for inflation every year, so use the table for the year of the sale.
| Tax year 2025 — filing status | 0% rate up to | 15% rate up to | 20% rate above |
|---|---|---|---|
| Single | $48,350 | $533,400 | $533,400 |
| Married filing jointly | $96,700 | $600,050 | $600,050 |
| Married filing separately | $48,350 | $300,000 | $300,000 |
| Head of household | $64,750 | $566,700 | $566,700 |
| Tax year 2026 — filing status | 0% rate up to | 15% rate up to | 20% rate above |
|---|---|---|---|
| Single | $49,450 | $545,500 | $545,500 |
| Married filing jointly | $98,900 | $613,700 | $613,700 |
| Married filing separately | $49,450 | $306,850 | $306,850 |
| Head of household | $66,200 | $579,600 | $579,600 |
Sources: IRS Rev. Proc. 2024-40 (2025) and Rev. Proc. 2025-32 (2026). The Schedule D instructions include the worksheet that applies these rates to your return.
The net investment income tax is a separate 3.8% tax that can apply to investment income, including capital gains, when modified adjusted gross income exceeds $200,000 (single or head of household), $250,000 (married filing jointly or qualifying surviving spouse), or $125,000 (married filing separately). These thresholds are not adjusted for inflation. See the net investment income tax guide.
Step 3: report it
- Form 1099-B from your broker lists your sales, and often your basis and whether each sale is short-term or long-term.
- Form 8949: short-term sales go in Part I and long-term sales in Part II. The box you check depends on whether the broker reported your basis to the IRS.
- Schedule D totals your gains and losses and carries the result to your Form 1040.
Exception: not every sale has to be listed on Form 8949. If your Form 1099-B shows that basis was reported to the IRS, shows no adjustments, and the sale needs no correction or adjustment (and is not a collectible), the Schedule D and Form 8949 instructions let you report the totals directly on Schedule D line 1a (short-term) or line 8a (long-term). Sales where basis was not reported, or where the basis shown is wrong, still go on Form 8949.
Example (illustrative)
In 2023, Mei bought 100 shares for $4,000. In 2025 she sold them for $9,000. She held them more than one year, so she has a $5,000 long-term gain. As a single filer, the part of that gain that falls within taxable income up to $48,350 would be taxed at 0%, and the part above it at 15%. If she had sold after only ten months, the same $5,000 would be a short-term gain taxed at her ordinary rates.
Exceptions to know about
- Gains on collectibles can be taxed at up to 28% — see the collectibles guide — and some gain on real property (unrecaptured section 1250 gain) at up to 25% — see selling a rental property. Both are maximum rates, not flat rates.
- Qualified small business stock has its own rules.
- Crypto is also property but has its own reporting details — see Crypto taxes explained. Brokers report digital asset sales on the new Form 1099-DA, not Form 1099-B, and they go in their own Form 8949 boxes (G through L).
- A brokerage account abroad also raises FBAR and Form 8938 questions — see Foreign brokerage accounts and stocks.
If you sold at a loss, see I lost money on stocks — can I deduct it?