How Selling Stock Affects Your Taxes: Rates, Losses, and Wash Sales

Selling stock affects your taxes by creating a capital gain or loss that you must report to the IRS, with federal rates running from 0% to 37% depending on how long you owned the shares and your total taxable income. Short holds are taxed like wages. Long holds get lower rates. Your brokerage reports every sale to the IRS on Form 1099-B, and you reconcile those numbers on Form 8949 and Schedule D when you file, whether you made money or lost it.

Figuring Your Gain or Loss

The taxable number on a stock sale is the difference between what you got and what you paid. Federal law defines a gain as the excess of your “amount realized” over your “adjusted basis,” and a loss as the reverse.1Office of the Law Revision Counsel. 26 USC 1001 – Determination of Amount of and Recognition of Gain or Loss Amount realized is your sale price minus selling costs like commissions.2Internal Revenue Service. Publication 544 – Sales and Other Dispositions of Assets Adjusted basis is usually what you originally paid for the shares, including purchase fees.

Buy 50 shares at $40 for $2,000, sell them for $3,000 after a $10 commission, and your amount realized is $2,990 and your gain is $990. Sell those same shares for $1,500 instead and you have a $500 loss. Each lot runs through the calculation separately, which matters once you’ve bought the same stock at different prices.

Which Shares Count as Sold

When you own multiple lots of the same stock, you can pick which shares you’re selling if you identify them to your broker before the trade settles. The IRS then uses that lot’s cost as your basis.3Internal Revenue Service. Stocks (Options, Splits, Traders) Selling your highest-cost shares first shrinks your taxable gain. If you don’t specify, the default is first-in, first-out, which often produces a larger gain because your oldest shares were usually cheapest. Most brokerages let you set a default in your account settings, and it’s worth doing before you start selling.

How Long You Held the Shares

Holding period drives everything else. Federal law draws the line at one year.4Office of the Law Revision Counsel. 26 USC 1222 – Other Terms Relating to Capital Gains and Losses The clock starts the day after you buy and runs through the day you sell. One year or less is short-term. More than one year is long-term.

A single day changes the classification. Shares bought March 1, 2025 and sold March 1, 2026 are short-term. Wait until March 2 and the same profit is long-term. Short-term gains are taxed as ordinary income; long-term gains get a much lower schedule.

What You’ll Pay in 2026

Short-term gains get added to your other income and taxed at your ordinary rate. For 2026, ordinary rates run from 10% to 37% across seven brackets.5Internal Revenue Service. Revenue Procedure 2025-32 A stock you flipped after two months is taxed exactly like a paycheck.

Long-term gains have their own three-tier structure.6Office of the Law Revision Counsel. 26 USC 1 – Tax Imposed The 2026 thresholds, based on taxable income:5Internal Revenue Service. Revenue Procedure 2025-32

  • 0% on taxable income up to $49,450 single, $98,900 married filing jointly, $66,200 head of household.
  • 15% on income above those amounts but below $545,500 single, $613,700 joint, or $579,600 head of household.
  • 20% on income above those upper thresholds.

Most investors land in the 15% bracket. The 0% rate is genuinely zero: if your taxable income stays under the threshold, you owe nothing on those long-term gains, which opens real planning room for retirees and anyone in a lower income year.

The 3.8% Surtax on Higher Incomes

On top of the regular rates, a 3.8% Net Investment Income Tax applies once modified adjusted gross income crosses $200,000 for single filers or $250,000 for married couples filing jointly.7Internal Revenue Service. Topic No. 559, Net Investment Income Tax These thresholds aren’t indexed to inflation, so more taxpayers cross them every year. Someone in the 20% long-term bracket who also owes the surtax faces an effective federal rate of 23.8% on long-term stock gains.

State Taxes

Federal tax is only part of the bill. Most states tax capital gains as ordinary income, a handful impose rates above 10%, and several have no income tax at all. Check your state’s treatment before large trades, because the combined federal-and-state rate is what actually leaves your account.

Using Losses to Reduce What You Owe

A losing sale isn’t wasted at tax time. Capital losses offset capital gains dollar for dollar. If your losses for the year exceed your gains, you can deduct up to $3,000 of the excess against ordinary income like wages, or $1,500 if married filing separately.8Office of the Law Revision Counsel. 26 USC 1211 – Limitation on Capital Losses

Anything past that $3,000 carries forward to future years indefinitely, keeping its short-term or long-term character.9Office of the Law Revision Counsel. 26 USC 1212 – Capital Loss Carrybacks and Carryovers Take a $15,000 net loss in 2026, deduct $3,000 that year, and carry $12,000 into future returns at $3,000 a year (assuming no gains to absorb it faster). The IRS does not track this for you; keep a running total or it disappears.

The Wash Sale Trap

There’s a catch to harvesting losses. If you sell a stock at a loss and buy the same or a substantially identical security within 30 days before or after the sale, the IRS disallows the loss.10Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities The 30-day window runs both directions. Buying replacement shares ten days before you sell at a loss triggers the rule as clearly as buying them ten days after.

The disallowed loss isn’t gone forever. It gets added to the basis of the replacement shares, deferring the benefit until you sell those.11Internal Revenue Service. Case Study 1 – Wash Sales Your broker reports wash sales in Box 1g of your 1099-B, but automated tracking is unreliable when you trade the same stock across multiple accounts, so watch this yourself if you do.

When the Regular Rules Don’t Apply

Retirement Accounts

Everything above assumes a taxable brokerage account. Selling stock inside a traditional IRA or 401(k) triggers no capital gains tax at the time of the trade; you can buy and sell freely inside the account.12Internal Revenue Service. Topic No. 451, Individual Retirement Arrangements (IRAs) Tax happens on withdrawal, and the entire distribution is taxed as ordinary income regardless of whether the internal gains were short or long-term. Qualified distributions from a Roth IRA are completely tax-free, since you funded it with after-tax dollars.13Internal Revenue Service. Roth IRAs

Inherited Shares

If you’re selling stock you inherited, your basis is generally the fair market value on the date the previous owner died, not what they paid.14Office of the Law Revision Counsel. 26 USC 1014 – Basis of Property Acquired From a Decedent This step-up in basis can erase decades of unrealized appreciation. Shares bought for $5,000 in 1990 and worth $80,000 at death give you an $80,000 basis; selling at $82,000 produces a $2,000 gain. Inherited stock also counts as long-term automatically, no matter how long the decedent held it.

Gifted Shares

Gifted stock is less favorable. Your basis is generally the donor’s original basis, whatever they paid.15Office of the Law Revision Counsel. 26 USC 1015 – Basis of Property Acquired by Gifts and Transfers in Trust If the fair market value on the gift date was below the donor’s basis, a split rule applies: you use the donor’s basis to figure a gain and the lower fair market value to figure a loss.16Internal Revenue Service. Property (Basis, Sale of Home, Etc.) Sell between those two numbers and there’s neither gain nor loss. Ask the donor what they paid before you sell.

Reporting the Sale to the IRS

Your brokerage must send you Form 1099-B by February 15 of the year after the sale, listing proceeds, cost basis for covered securities, and whether each transaction was short- or long-term.17Office of the Law Revision Counsel. 26 USC 6045 – Returns of Brokers A copy goes to the IRS, so the agency already has your numbers before you file. Most brokerages package multiple 1099s into a single consolidated statement.

You transfer the sales onto Form 8949, which sorts them by whether basis was reported to the IRS.18Internal Revenue Service. Instructions for Form 8949 Where basis was reported correctly and you have no adjustments, you can skip Form 8949 for those transactions and put summary totals straight on Schedule D. The Form 8949 totals flow to Schedule D of your 1040, which computes your net gain or loss for the year.

After you file, the IRS matches your return against the 1099-B data. If the numbers disagree, you’ll receive a CP2000 notice proposing changes.19Internal Revenue Service. Understanding Your CP2000 Series Notice A CP2000 is a proposed adjustment, not a bill, and you can respond with documentation if you disagree. The most common trigger is a cost basis mismatch, especially when you used specific identification or adjusted your figures. Keep your records for at least three years after filing.20Internal Revenue Service. How Long Should I Keep Records

When You Need to Pay Before April

Selling a large position mid-year can put you into estimated tax territory. For 2026, you owe estimated tax if you expect to owe at least $1,000 after withholding and credits, and your withholding will cover less than 90% of your current-year tax or 100% of your prior-year tax.21Internal Revenue Service. 2026 Form 1040-ES Estimated Tax for Individuals If your 2025 adjusted gross income exceeded $150,000 ($75,000 if married filing separately), the prior-year safe harbor rises to 110%.

The 2026 quarterly due dates are April 15, June 15, September 15, and January 15, 2027.21Internal Revenue Service. 2026 Form 1040-ES Estimated Tax for Individuals If you realize a large gain late in the year, the annualized income installment method lets you concentrate the estimated tax in the quarter you earned the income rather than spreading it evenly. Skipping estimated payments after a big sale is one of the more expensive mistakes an individual investor can make; the underpayment penalty runs like non-deductible interest that compounds quarterly.