Home › Articles › Capital gains tax

Capital gains tax on stocks: short-term vs long-term (US)

6 min read · Updated 2026-11-17

When you sell a stock for more than you paid, the profit is a capital gain, and in the US it is taxed. How long you held the stock can make a big difference to how much tax you pay. This is a simplified overview, not tax advice.

The one-year rule

High earners may also owe an extra 3.8% net investment income tax. Many states tax capital gains too.

A simple example

You buy shares for $5,000 and sell them for $7,000. Your gain is $2,000. If that is a long-term gain taxed at 15%, the federal tax is $300. If you had sold a few weeks earlier, inside one year, and your income tax rate is 24%, the same gain would cost $480.

Cost basis

Your gain is the sale price minus your cost basis, which is what you paid including fees. If you bought at different prices, your broker tracks each purchase. Reinvested dividends add to your basis, so keep them in mind.

Using losses: tax-loss harvesting

Losses can offset gains. If you have a $2,000 gain and sell another stock at a $1,500 loss, you are taxed on $500. Watch the wash sale rule: if you buy the same or a substantially identical investment within 30 days before or after selling at a loss, the loss is disallowed for now.

Accounts that avoid the issue

Gains inside a 401(k) or IRA are not taxed each year. That is one reason retirement accounts are so powerful for long-term investors.

Key takeaways
  • Holding more than a year usually means a lower rate.
  • Gain = sale price − cost basis.
  • Losses can offset gains, but mind the wash sale rule.
Now try it yourselfPractice this in the "Capital gains tax" lesson. It takes about 3 minutes.
Start the lesson

Keep reading