US Capital Gains Tax on Stocks: Brackets, Basis, and Losses

The federal capital gains tax on stocks depends on two things: how long you held the shares and your taxable income for the year. Sell after holding more than a year and you pay a long-term rate of 0%, 15%, or 20%. Sell at one year or less and the profit is taxed as ordinary income, at rates up to 37%. For 2026, a single filer stays in the 0% long-term bracket up to $49,450 of taxable income; a married couple filing jointly stays in it up to $98,900.

The Holding Period Sets Your Rate

The tax code draws a hard line at one year. The holding period starts the day after you buy shares and runs through the day you sell. Hold for more than a year and the profit is a long-term capital gain. Sell at exactly one year or sooner and it’s short-term.

The difference is large. A short-term gain stacks on top of your wages and gets taxed at rates as high as 37%. The same gain held one more day might be taxed at 15%, or even 0%. Missing the threshold by a single day is one of the more expensive timing mistakes in personal finance, and it’s easy to make if you bought the same stock on different dates and don’t check the lots you’re selling.

2026 Long-Term Capital Gains Brackets

Long-term gains are taxed at three rates, keyed to your taxable income. For the 2026 tax year:1Internal Revenue Service. Rev. Proc. 2025-32

  • 0% rate on taxable income up to $49,450 (single), $98,900 (married filing jointly), and $66,200 (head of household).
  • 15% rate above the 0% ceiling and up to $545,500 (single), $613,700 (joint), and $579,600 (head of household).
  • 20% rate on taxable income above the 15% ceiling.

Most investors land in the 15% bracket. The 0% rate is genuinely useful for retirees and anyone with a low-income year who can sell appreciated shares tax-free. The thresholds adjust for inflation each year.

Short-term gains get no preferential rate. They’re taxed at your ordinary income rates, which run from 10% to 37%.2Internal Revenue Service. Topic No. 409, Capital Gains and Losses

The 3.8% Surtax for Higher Earners

On top of the regular rates, high earners owe a 3.8% Net Investment Income Tax on capital gains and other investment income. It applies to individuals with modified adjusted gross income above $200,000, or $250,000 for married couples filing jointly.3Office of the Law Revision Counsel. 26 U.S. Code 1411 – Imposition of Tax The 3.8% is calculated on the lesser of your net investment income or the amount your modified AGI exceeds the threshold.4Internal Revenue Service. Questions and Answers on the Net Investment Income Tax These thresholds are not indexed to inflation, so more taxpayers cross them each year. Someone in the top long-term bracket who also owes the surtax pays an effective 23.8% federal rate on stock gains.

Figuring the Gain: Cost Basis

Your gain is what you sold for, minus your cost basis. Basis starts with the price you paid per share plus any purchase commissions or fees, which lift your basis and lower the taxable gain.

Corporate actions can change basis without a purchase or sale. A 2-for-1 split doubles your share count and halves your per-share basis. Dividend reinvestment creates a fresh purchase lot with its own basis every time a dividend is reinvested. Your broker tracks most of this and reports it at year-end, but the numbers are worth checking.

Which Shares You Sell Changes the Tax

If you own shares of the same stock bought at different prices, the lot you sell determines the gain. By default the IRS uses first-in, first-out, treating your oldest shares as sold first.5Internal Revenue Service. Stocks (Options, Splits, Traders) 3 Those oldest shares usually have the lowest basis and produce the biggest gain.

Specific identification is the alternative. You tell your broker exactly which lot to sell, at or before the time of the sale, and you keep records showing which lots you chose. If you bought 100 shares at $50 in January and another 100 at $80 in June, selling the June lot first produces a much smaller current-year gain.

Inherited and Gifted Shares

How you acquired the stock changes the basis rules. Inherited shares generally get a “stepped-up” basis equal to their fair market value on the date the original owner died, regardless of what that person originally paid.6Office of the Law Revision Counsel. 26 U.S. Code 1014 – Basis of Property Acquired From a Decedent If a parent bought stock at $10 and it was worth $150 the day they died, your basis is $150. Sell at $155 and you owe tax on $5 per share.7Internal Revenue Service. Gifts and Inheritances

Gifted stock is different. You take the donor’s original basis, called a carryover basis.8Office of the Law Revision Counsel. 26 U.S. Code 1015 – Basis of Property Acquired by Gifts and Transfers in Trust Same $10 stock, gifted rather than inherited: your basis is $10, and selling at $155 produces a $145 gain per share. One exception applies if the stock’s fair market value at the time of the gift was below the donor’s basis; when you later sell at a loss, you use the lower fair market value figure.

Offsetting Gains with Losses

Capital losses in the same tax year reduce capital gains. The netting follows an order: short-term losses first offset short-term gains, long-term losses first offset long-term gains, and any leftover net loss in one category then offsets the net gain in the other.

If total losses exceed total gains, you can deduct up to $3,000 of the excess against ordinary income like wages, or $1,500 if you’re married filing separately. Anything beyond that carries forward to future tax years indefinitely.2Internal Revenue Service. Topic No. 409, Capital Gains and Losses A bad year keeps giving you a deduction for as long as it takes to work off the balance.

The Wash Sale Rule

Selling at a loss and immediately buying the stock back looks like an easy deduction. The wash sale rule blocks it. If you sell shares at a loss and buy substantially identical stock within 30 days before or after the sale, the IRS disallows the loss for that tax year.9Office of the Law Revision Counsel. 26 U.S. Code 1091 – Loss From Wash Sales of Stock or Securities

The window covers 30 days on each side of the sale date, a 61-day danger zone in total. Buying replacement shares even one day before the loss sale triggers the rule, and so does buying them in a different account. The disallowed loss isn’t gone; it gets added to the basis of the replacement shares, so you recover the benefit when you eventually sell those without triggering another wash sale.

“Substantially identical” generally means shares of the same company. Buying a competitor’s stock or a different index fund usually doesn’t trigger the rule, though very similar products can blur the line. The safe approach is to wait 31 days before repurchasing, or replace the position with a meaningfully different investment.

Retirement Accounts Work Differently

All of the above applies only to stocks held in taxable brokerage accounts. Inside a traditional 401(k) or traditional IRA, selling shares triggers no capital gains tax; withdrawals are later taxed as ordinary income no matter what produced the growth. Inside a Roth IRA or Roth 401(k), qualified withdrawals are entirely tax-free, capital gains included. The tradeoff on retirement accounts is that losses inside them cannot be used to offset gains elsewhere.

Paying the Tax During the Year

Stock sales usually don’t have tax withheld. If a sale produces a large gain, you may owe quarterly estimated tax payments to avoid an underpayment penalty. The IRS generally expects estimated payments if you’ll owe at least $1,000 after withholding and credits.10Internal Revenue Service. 2026 Form 1040-ES

You can avoid the penalty by meeting a safe harbor: pay at least 90% of your current-year tax liability, or 100% of what you owed the prior year. If your adjusted gross income last year was over $150,000, that prior-year figure rises to 110%.11Internal Revenue Service. Topic No. 306, Penalty for Underpayment of Estimated Tax The 2026 quarterly due dates are April 15, June 15, September 15, and January 15, 2027.10Internal Revenue Service. 2026 Form 1040-ES

At tax time, your brokerage sends Form 1099-B listing proceeds and cost basis for each sale. Watch the basis figures on older holdings. Brokers were only required to start reporting basis for stocks purchased after certain dates, generally 2011, so shares held longer may show up with no basis reported. If nothing is entered, the IRS treats basis as zero and taxes the entire sale price as gain. Keep your own purchase records for older lots and enter the correct basis on your return.12Internal Revenue Service. Instructions for Form 8949