Taxes
MONEYGUYMUTANTS
Taxes

Capital Gains Tax on Stocks: Rates, Rules, and How to Reduce What You Owe

How capital gains tax works when you sell stock, the 2026 rate brackets, and legal ways to reduce or defer what you owe — from holding periods to tax-loss harvesting.

By Money Guy Mutants Research 7 min read
#capital-gains-tax#investing#taxes#tax-loss-harvesting

Selling stock at a profit triggers capital gains tax — but how much you owe depends heavily on how long you held the position and how it fits into your overall taxable income. This guide walks through the 2026 rates and thresholds, how short-term and long-term gains are taxed differently, and the legal strategies investors use to reduce or defer the bill.

Short-term vs. long-term capital gains

The single biggest factor in your tax rate is how long you held the stock before selling.

  • Short-term capital gains apply to assets held one year or less. They're taxed as ordinary income, at the same rates that apply to your wages — anywhere from 10% up to 37%, depending on your tax bracket.
  • Long-term capital gains apply to assets held more than one year. They're taxed at preferential rates of 0%, 15%, or 20%, depending on your taxable income and filing status.

The holding period is counted starting the day after you acquired the asset through the day you sell it. Crossing the one-year mark before selling can meaningfully lower your tax bill, since the gap between the top ordinary rate (37%) and the top long-term capital gains rate (20%) is substantial.

2026 long-term capital gains rate thresholds

For the 2026 tax year, the IRS adjusted long-term capital gains income thresholds upward by roughly 2.7% from 2025. The rates themselves are unchanged — 0%, 15%, and 20% — but the income ranges that determine which rate applies shifted:

Filing status 0% rate applies up to 15% rate applies up to 20% rate applies above
Single $49,450 $533,400 $533,400
Married filing jointly $98,900 $600,050 $600,050

These thresholds are based on taxable income, not just your investment gains — your gains stack on top of your other income to determine which bracket they fall into. It's entirely possible for part of a large gain to be taxed at 15% and part at 20% if it straddles a threshold.

Run your specific numbers — including how your gain interacts with your other income — with the Capital Gains Tax Calculator.

The Net Investment Income Tax (NIIT)

Higher earners face an additional 3.8% tax on top of the capital gains rate. The Net Investment Income Tax (NIIT) applies once modified adjusted gross income exceeds:

  • $200,000 for single filers
  • $250,000 for married couples filing jointly

The NIIT applies to the lesser of your net investment income or the amount your income exceeds the threshold. For someone in the top capital gains bracket, this effectively pushes the marginal rate on long-term gains to 23.8%.

Tax-loss harvesting and the wash sale rule

Tax-loss harvesting means deliberately selling a losing investment to realize a capital loss, which can offset gains elsewhere in your portfolio. If your losses exceed your gains in a given year, you can deduct up to $3,000 ($1,500 if married filing separately) of the excess against ordinary income. Any loss beyond that carries forward to future tax years indefinitely, and there's no limit on how much of that carryforward can offset capital gains in a later year.

The catch is the wash sale rule. If you sell a security at a loss and buy the same or a "substantially identical" security within 30 days before or after the sale, the loss is disallowed for that year's taxes. This creates a 61-day window in total (30 days before, the day of sale, and 30 days after) during which repurchasing the same holding — including in a spouse's account or an IRA — will trigger the rule. A disallowed loss doesn't vanish entirely; it gets added to the cost basis of the replacement shares, but you lose the immediate deduction.

Investors who want to stay invested while harvesting a loss typically swap into a similar-but-not-identical fund (for example, one S&P 500 index fund for a different one) rather than repurchasing the exact security. If you're comparing index funds for this kind of swap, the Index Fund Visualizer can help you see how different fund choices track similar exposure.

Cost basis and the step-up rule for inherited stock

Your capital gain is calculated as sale price minus cost basis — generally what you originally paid, adjusted for fees. Two situations change that calculation in ways worth knowing:

  • Gifted stock generally keeps the original owner's cost basis. If someone gives you shares they bought for $50,000, your basis is still $50,000, even if the shares are worth more on the day of the gift.
  • Inherited stock gets a "step-up in basis" to the fair market value on the date of the original owner's death. If those same $50,000 shares had grown to $150,000 by the time of death, the heir's new cost basis becomes $150,000 — erasing the capital gain that built up during the original owner's lifetime. Inherited assets also automatically qualify for long-term capital gains treatment, regardless of how briefly the heir holds them before selling.

This distinction matters for estate and gifting decisions: appreciated assets are often better transferred at death (for the step-up) than gifted during life, from a purely tax-efficiency standpoint.

Letting gains compound instead of realizing them

Capital gains tax is only triggered when you sell. Holding appreciated positions and letting them compound — rather than trading frequently and realizing gains along the way — is one of the simplest ways to defer the tax bill, sometimes for decades. Modeling how a lump sum or regular contributions grow over time, undisturbed by trading, is exactly what the Compound Interest Calculator is built to show.

Frequently asked questions

Do I owe capital gains tax if I don't sell my stock?

No. Capital gains tax is only triggered when you actually sell (or otherwise dispose of) an appreciated asset — an unrealized gain sitting in your brokerage account isn't taxed. This is why "buy and hold" strategies can be more tax-efficient than frequent trading.

What's the difference between capital gains tax and the taxes on dividends?

Capital gains tax applies to the profit from selling an asset. Dividends are a separate category of investment income, taxed either as "qualified" dividends (generally at the same 0/15/20% long-term capital gains rates, if holding-period requirements are met) or "ordinary" dividends (taxed at your regular income tax rate).

Can I avoid capital gains tax entirely?

Not entirely, but you can reduce or defer it: holding for more than a year to get long-term rates, harvesting losses to offset gains, staying within the 0% bracket in a low-income year, using tax-advantaged accounts like IRAs and 401(k)s for trading, or holding appreciated assets until death so heirs receive a stepped-up basis.

Does state tax apply on top of federal capital gains tax?

In most states, yes — many states tax capital gains as ordinary income at the state level, on top of federal capital gains tax. A handful of states have no state income tax at all, which changes the total tax picture significantly. Check your specific state's rules, since they vary widely.

How does the wash sale rule apply across different accounts?

The rule applies across all accounts you or your spouse control, not just the one where you sold at a loss. Repurchasing the same or a substantially identical security in a different taxable account, an IRA, or a 401(k) within the 61-day window still triggers the wash sale rule and disallows the loss.

Disclaimer

This guide is for general educational purposes only and does not constitute personalized financial, tax, or legal advice. Every reader's situation is different — consult a licensed financial advisor, accountant, or attorney before making decisions based on this content. Figures and rules cited here reflect the most recent information available at time of publication and may change; verify current limits and regulations before acting.

PUT IT INTO PRACTICE
Capital Gains Tax CalculatorTry it free Index Fund VisualizerTry it free Compound Interest CalculatorTry it free

More guides

Browse all guides.

View all guides