Skip to content
Tax Strategies

How Does Capital Gains Tax Work? Short-Term vs. Long-Term Rates on Stocks and Funds

How capital gains tax works on stocks and funds: cost basis, the one-year holding rule, 0/15/20% long-term rates, loss offsets and ways to cut the bill.

How Does Capital Gains Tax Work? Short-Term vs. Long-Term Rates on Stocks and Funds

Capital gains tax is charged on the profit when you sell an investment for more than your cost basis. If you held it one year or less, the gain is taxed at your ordinary income rate. If you held it longer than a year, it usually gets a lower long-term rate of 0%, 15% or 20%.

Key takeaways: Your gain is the sale price minus your cost basis, and how long you held the asset decides which rate applies. Losses, holding periods and account type are the main levers you control.

How is a capital gain calculated when you sell?

Your capital gain is the amount you received from the sale minus your cost basis, which is basically what you paid, including any commissions. Say you buy 10 shares at $100 each, so your basis is $1,000, and later sell them for $150 each, or $1,500. Your gain is $500, and only that $500 is exposed to capital gains tax, not the full $1,500. You owe nothing on an investment you still hold, because the gain is only "realized" when you sell, which is why unrealized gains in your portfolio do not show up on your tax return. The IRS explains capital gains and losses in its Topic 409.

Cost basis gets trickier than it sounds once you buy the same investment many times. Reinvested dividends count as new purchases and add to your basis, so ignoring them means paying tax on money you already taxed once. If you own several lots bought at different prices, the method your broker uses to pick which lot you sold changes the result. Many brokers default to first-in, first-out, but most let you choose specific lots before you place the sale. Your broker reports proceeds and usually basis on Form 1099-B, and the details of what counts as basis are in IRS Publication 550.

What is the difference between short-term and long-term capital gains?

The difference is the holding period: a gain is long-term if you held the asset for more than one year, and short-term if you held it for one year or less. The holding period starts the day after you acquire the investment and ends the day you sell it, so selling a day early can move a gain into the higher-taxed bucket. Short-term gains are added to your other income and taxed at your ordinary rate, while long-term gains get their own, lower schedule. The gap can be large, so a few weeks of patience on a big winner is sometimes worth real money.

Short-termLong-term
Holding periodOne year or lessMore than one year
Federal rateYour ordinary income rate (10% to 37%)0%, 15% or 20%
Where it landsStacked on top of wages and other incomeTaxed on a separate, lower schedule

What are the long-term capital gains rates?

For most investors the federal long-term rate is 0%, 15% or 20%, depending on your taxable income and filing status. The income thresholds for each rate are adjusted every year, so look up the current figures on the IRS capital gains page instead of relying on a number from an older article. Because your gain is stacked on top of your other income, a single sale can be taxed at two rates if it straddles a threshold. If you want a refresher on how that stacking works, our piece on marginal vs. effective tax rates covers it.

Two extras can raise the bill. Higher earners may owe the 3.8% net investment income tax on top of capital gains, which applies once modified adjusted gross income passes a set threshold, as described in the IRS guidance on net investment income tax. And most states tax capital gains too, some at ordinary income rates, so the total depends on where you live. None of this is personal advice, and your exact result depends on your income, filing status and state.

How do capital losses offset gains?

Losses reduce gains: you first net short-term gains against short-term losses and long-term against long-term, then net the two results against each other. If your losses exceed your gains for the year, you can deduct up to $3,000 of the excess against other income ($1,500 if married filing separately), and carry the rest forward to future years, per the IRS Topic 409. So a $4,000 loss on one position can wipe out a $4,000 gain on another. Selling a loser on purpose to offset gains is called tax-loss harvesting, and it comes with the wash-sale rule, which disallows the loss if you buy the same or a substantially identical investment within 30 days before or after. We walk through the details in tax-loss harvesting and the wash-sale rule.

Do mutual funds and ETFs work differently?

Yes, because funds can create taxable gains even when you do not sell. A mutual fund or ETF that sells holdings inside the fund must pass net realized gains to shareholders as capital gain distributions, and in a taxable account you owe tax on them for that year. Index funds and ETFs tend to distribute less because they trade less, but it is not guaranteed, and bond funds and actively managed funds can be more tax-heavy. When you eventually sell your own shares, the gain or loss is calculated the usual way, with reinvested distributions added to your basis. For how the two structures compare, see index funds vs. ETFs.

None of this applies inside a traditional IRA, Roth IRA or 401(k), where trades do not trigger capital gains tax in the year you make them. That is why where you hold an investment can matter as much as what you hold, a idea we cover in asset location vs. asset allocation.

How can you reduce your capital gains tax?

You cannot avoid the tax on a profitable sale in a taxable account, but you can often shrink it. These are the usual levers, and which ones fit depends on your situation:

  1. Hold past one year when the gain is close to qualifying for long-term treatment.
  2. Choose your lots. Selling the shares with the highest basis produces the smallest gain, if your broker supports specific lot identification.
  3. Harvest losses to offset gains, watching the wash-sale rule.
  4. Spread large sales across tax years so one year's income does not push you into a higher rate.
  5. Rebalance with new money instead of selling winners. Our guide to rebalancing without triggering taxes shows how.
  6. Use tax-advantaged accounts first for the investments that generate the most taxable income.

Each of these has trade-offs. Holding a stock longer just to save tax means carrying market risk for longer, and a tax saving rarely justifies keeping a position you no longer want. Let the investment decision lead and the tax decision refine it.

What should you check before selling near year-end?

Before you place a sale in the last weeks of the year, check three things: the date you bought each lot, your basis, and your gains and losses so far this year. Your broker's realized gain/loss page usually shows this, and a quick look can reveal that a lot is a few days from going long-term, or that you already have losses banked. Then estimate what the sale adds to your taxable income, since a big gain can also affect things like the net investment income tax. Our year-end financial checkup puts this alongside other reviews worth doing before December 31. If you trade often, day trading taxes covers the extra traps, and crypto has its own rules in crypto tax rules. You may also find this useful: How Do Dividends Work? Yield, Payout Dates, Taxes and Reinvestment Explained. You may also find this useful: How to Deduct Charitable Donations: Rules, Records and Giving Appreciated Stock.

Frequently asked questions

Do I pay capital gains tax if I reinvest the money?

Yes. The tax is triggered by the sale, not by what you do with the proceeds, so buying something else right away does not defer the gain in a regular taxable account.

Do I owe capital gains tax on investments I have not sold?

Generally no. Unrealized gains are not taxed until you sell. The exception is fund distributions, which can be taxable in a year even if you never sold any shares.

How are dividends taxed compared with capital gains?

Qualified dividends are taxed at the long-term capital gains rates, while ordinary dividends are taxed as regular income. See the IRS Topic 404 on dividends for the qualifying rules.

How do I report stock sales on my tax return?

Your broker sends Form 1099-B, and sales are generally reported on Form 8949 and summarized on Schedule D. Tax software usually imports the broker data for you.

Can capital losses reduce my regular income?

Yes, up to $3,000 a year after offsetting all your gains, with any extra carried forward to later years. The rule is in the IRS Topic 409.

This article is educational and not personalized tax or investment advice. Your result depends on your income, filing status, state and the specific investments involved. For a large sale, an inherited asset, or anything unusual, a qualified tax professional can run the numbers on your actual return, and that usually costs far less than a mistake.

Not financial advice. This guide is general education, not personal financial, tax, legal or investment advice. Figures, limits and rates change; check them with the official source or a licensed professional before you act. Last reviewed November 26, 2026. How we write and fact-check · Report an error.

Run the numbers yourself

Free calculators for budgets, debt payoff, emergency funds and more. No sign-up.

Try the free tools
Keep reading

More on Tax Strategies

See all