Capital Gains Tax on Stocks: Rates, Rules, and How to Pay Less

Finance Europeanpersonal finance Capital Gains Tax on Stocks: Rates, Rules, and How to Pay Less
Capital Gains Tax on Stocks: Rates, Rules, and How to Pay Less
0 Comments

Selling stock at a profit feels good. Writing a check to the IRS afterward feels considerably less so. How much you actually owe hinges on one variable: how long you held those shares before clicking sell. Get that timing wrong and the difference can run into thousands of dollars.

Here is everything a stock investor needs to know — including the strategies that legally keep more of your returns.

Short-Term vs. Long-Term: The Rate Gap That Changes Everything

The IRS splits capital gains into two buckets: short-term (held 12 months or less) and long-term (held more than 12 months). Short-term gains are taxed as ordinary income — meaning they stack on top of your salary at whatever marginal bracket applies to you. Long-term gains get preferential rates: 0%, 15%, or 20%.

That gap is enormous. A single investor earning $80,000 in salary who sells a stock for a $10,000 gain faces this:

Scenario Holding Period Tax Rate Tax Owed
Short-term gain ($10,000) 8 months 22% (ordinary income) $2,200
Long-term gain ($10,000) 14 months 15% $1,500

Six extra months of holding saves $700 on a single $10,000 gain. Scale that to a $100,000 position and the difference is $7,000.

2026 Long-Term Capital Gains Tax Brackets

Filing Status 0% Rate 15% Rate 20% Rate
Single Up to $48,350 $48,351–$533,400 Above $533,400
Married Filing Jointly Up to $96,700 $96,701–$600,050 Above $600,050
Head of Household Up to $64,750 $64,751–$566,700 Above $566,700

High earners also face the 3.8% Net Investment Income Tax (NIIT) on top of the 20% rate if modified adjusted gross income exceeds $200,000 (single) or $250,000 (joint). That brings the effective federal ceiling to 23.8% — still well below the 37% short-term rate that applies to the same income bracket.

How Cost Basis Determines What You Actually Owe

Top view of cutout paper composition of male signing credit paper while counting cash and apartment cost against blue background

Your cost basis is what you paid for the shares, including any commissions. Capital gains tax applies only to the profit — the gap between your sale price and your basis. Get the basis wrong and you either overpay the IRS or underreport income. Neither ends well.

This gets complicated quickly when you have bought the same stock at different prices over time. Say you own 100 shares of Microsoft (MSFT) purchased at three different points:

  • 50 shares at $250 each — purchased January 2026
  • 30 shares at $310 each — purchased August 2026
  • 20 shares at $375 each — purchased March 2026

If you sell 50 shares today at $430, which shares did you actually sell? That choice is yours to make — and it changes your tax bill by a meaningful amount.

FIFO vs. Specific Lot Identification

Most brokerages default to FIFO (first-in, first-out), meaning the oldest shares sell first. In the Microsoft example, that means selling the 2026 shares with the lowest basis — generating the highest possible gain. Rarely the optimal tax outcome.

Specific lot identification lets you tell your broker exactly which shares to sell. Selling the March 2026 lot (basis: $375) instead of the January 2026 lot (basis: $250) cuts your taxable gain from $180 per share down to $55 per share. Fidelity, Charles Schwab, and Vanguard all support specific lot identification — you just have to actively select it before the trade settles, not after.

Adjusted Basis: What Changes Your Starting Number

Stock splits, dividend reinvestment plans (DRIPs), and return-of-capital distributions all change your basis. If you have been reinvesting dividends in Apple (AAPL) for six years, every reinvestment created a new cost lot at a different price. TurboTax and H&R Block both handle this automatically when you import your 1099-B from your brokerage. But the math matters if you are tracking gains manually.

One important exception: inherited stock receives a stepped-up basis to the market value on the date of death. That wipes out all prior appreciation for capital gains purposes. An investor who held a stock from $10 to $400 and passes it to an heir pays no capital gains tax — the heir’s basis resets to $400. Significant for estate planning involving large unrealized gains.

The Wash-Sale Rule Catches More Investors Than Expected

If you sell a stock at a loss and buy the same — or substantially identical — security within 30 days before or after the sale, the IRS disallows that loss for the current tax year. The loss is not permanently gone; it gets added to the basis of the repurchased shares and deferred. But if you needed the deduction now, your timing is wrecked.

The rule applies across accounts. Selling at a loss in your taxable Schwab account and buying the same stock in your Roth IRA the next day still triggers the wash-sale rule. Most investors do not realize the 30-day window runs in both directions — buying the replacement stock before the sale counts too. The fix is straightforward: wait 31 days, or buy a similar-but-not-identical ETF in the meantime (selling SPY and buying VOO likely triggers the rule; selling SPY and buying VTI probably does not, though the IRS has not issued definitive guidance on ETF substitutes).

Four Strategies That Legally Cut Your Capital Gains Bill

A notebook with 'tax planning' written on a grid paper next to a percent symbol on a black background.

None of these require expensive advisors or complex structures. They are standard techniques any self-directed investor can apply.

  1. Hold past 12 months. The most straightforward move in investing. Waiting one day past the one-year mark converts a short-term gain into a long-term one. For a high earner, that is the difference between 37% and 20% — or 37% and 15% for middle-income investors. Patience is literally worth money here.
  2. Tax-loss harvesting. Selling underperforming positions to generate realized losses offsets gains elsewhere in your portfolio. If your position in an underperforming stock is down $4,000 and you have $9,000 in realized gains from other sales, harvesting the loss cuts net taxable gains to $5,000. Up to $3,000 of excess losses can offset ordinary income annually. The rest carries forward indefinitely until used.
  3. Time income strategically to hit the 0% bracket. If your taxable income in a given year falls below $48,350 (single) or $96,700 (joint), long-term capital gains are taxed at 0%. Retirees with flexible income sources, people taking sabbaticals, or investors in low-income transition years can often harvest significant gains completely free of federal capital gains tax by timing sales carefully.
  4. Donate appreciated shares directly. Giving stock to a donor-advised fund through Fidelity Charitable or Schwab Charitable lets you claim a deduction at full market value while paying zero capital gains tax on the appreciation. Far more efficient than selling first, paying tax, then donating cash. For investors holding positions with large embedded gains, this is one of the highest-leverage charitable strategies available.

Which Accounts Make Capital Gains Tax Irrelevant

Minimalist pastel pink envelope labeled 'TAXES' perfect for finance or tax-themed visuals.

Does a Roth IRA really have zero capital gains tax?

Yes. Qualified withdrawals from a Roth IRA — including every dollar of gains — come out completely tax-free. Buy a stock at $50 in your Roth IRA, watch it grow to $500 over 20 years, sell it, and withdraw: zero capital gains tax owed. That is not a loophole; it is the account’s core design. Contribution limits for 2026 are $7,000 per year (under 50) or $8,000 (50 and older), with income limits for direct contributions that phase out above $150,000 single and $236,000 joint.

Traditional IRA and 401(k): tax-deferred, not tax-free

These accounts skip capital gains tax on transactions inside the account, but withdrawals are taxed as ordinary income regardless of how the money grew. For investors sitting on large long-term gains, that can mean paying a higher effective rate at withdrawal than they’d have paid on long-term capital gains rates in a taxable account. The traditional versus Roth decision depends heavily on your expected tax rate in retirement — not a simple rule, but worth modeling before making large contributions.

Is a Health Savings Account actually an investment account?

Yes — and one of the most tax-efficient available. An HSA through Fidelity HSA or Lively allows you to invest contributions once your balance clears a minimum threshold (often $1,000). Gains inside an HSA are completely tax-free when used for qualified medical expenses. Many investors treat it as a stealth retirement account: pay medical expenses out of pocket now, let the HSA compound for decades, then reimburse yourself later using saved receipts. There is no deadline on reimbursements.

Capital gains tax is one of the few areas of personal finance where patience and account structure — not market timing or stock picking — determine your net return. The rules are fixed. The strategies are available to any investor willing to use them deliberately.

Disclaimer: The information on this page is for educational purposes only and does not constitute financial advice. Rates, terms, and eligibility requirements are subject to change. Always compare multiple lenders and consult a licensed financial advisor before borrowing.