How to File Taxes for Stocks: Form 8949, Cost Basis, and Wash Sales

To file taxes on stocks, report each sale on Form 8949, carry the short-term and long-term totals to Schedule D, and move the final figure to your Form 1040. Short-term gains (shares held one year or less) are taxed at your ordinary income rate up to 37%. Long-term gains (held more than a year) are taxed at 0%, 15%, or 20% depending on your income. Losses can offset gains and, up to a limit, ordinary income too. Here is how the pieces fit together for the 2025 return you file by April 15, 2026.1Internal Revenue Service. IRS Opens 2026 Filing Season

What You Need Before You Start

Your brokerage sends Form 1099-B (Proceeds From Broker and Barter Exchange Transactions), usually by mid-February.2Internal Revenue Service. About Form 1099-B, Proceeds From Broker and Barter Exchange Transactions It lists every stock you sold, the sale date, gross proceeds, and whether the broker reported your cost basis to the IRS.

The 1099-B separates transactions into “covered” and “non-covered” securities. For covered securities, the broker has already sent your cost basis to the IRS, so the numbers should match. Non-covered securities are older holdings or certain complex assets where the broker wasn’t required to track basis. For those, you need your original trade confirmations or account statements to calculate basis yourself.

Cost basis is what you paid for the stock, including any commissions or fees at purchase. Your gain or loss is sale proceeds minus that basis. Getting basis wrong means overpaying or underpaying, and the IRS catches the latter because brokers report proceeds directly.

If you received dividends, you’ll also get Form 1099-DIV. Ordinary dividends appear in Box 1a, and qualified dividends (a subset taxed at the lower capital gains rates) appear in Box 1b. Both flow to Form 1040 but follow different rate schedules.

Need more time? You can request an automatic extension to October 15, but that extends only the filing deadline, not the payment deadline.3Internal Revenue Service. Get an Extension to File Your Tax Return

Short-Term vs. Long-Term Holding Periods

The IRS splits every stock gain or loss into two buckets based on how long you held the shares. One year or less is short-term. More than one year is long-term.4Internal Revenue Service. Topic No. 409, Capital Gains and Losses The holding period starts the day after you buy and includes the day you sell.

Short-term gains are taxed at your ordinary income rate, which ranges from 10% to 37% depending on your total taxable income.4Internal Revenue Service. Topic No. 409, Capital Gains and Losses A short-term gain gets stacked on top of your wages and taxed at your marginal rate. No discount.

Long-term gains get preferential rates of 0%, 15%, or 20%, based on taxable income and filing status. The difference is significant enough that holding a winning position past the one-year mark can meaningfully change your after-tax return.

Long-Term Capital Gains Thresholds for 2026

For tax year 2026, the IRS has set the following income thresholds:5Internal Revenue Service. Revenue Procedure 2025-32

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

For married individuals filing separately, the 0% rate applies up to $49,450, and the 15% rate applies up to $306,850.5Internal Revenue Service. Revenue Procedure 2025-32 These thresholds are indexed for inflation, so they shift each year.

Most middle-income investors land in the 15% bracket. The 0% rate quietly benefits many retirees and lower-income filers, who may owe nothing on long-term stock gains.

Filling Out Form 8949 and Schedule D

Form 8949 is where every individual stock sale gets reported before the numbers roll up to Schedule D.6Internal Revenue Service. Instructions for Form 8949 – Sales and Other Dispositions of Capital Assets The form has two sections: Part I for short-term transactions and Part II for long-term transactions.

Within each part, a checkbox tells the IRS whether the broker reported your cost basis:

  • Box A (short-term) or Box D (long-term): basis was reported to the IRS by your broker.
  • Box B (short-term) or Box E (long-term): basis was not reported to the IRS by your broker.
  • Box C (short-term) or Box F (long-term): the transaction wasn’t reported to you on a 1099-B at all, so you supply everything manually.

Stock sales use Boxes A through F. Boxes G through L, added for the 2025 tax year, are for digital asset transactions reported on Form 1099-DA.7Internal Revenue Service. Form 8949 – Sales and Other Dispositions of Capital Assets

For each sale, you enter the stock name, dates acquired and sold, sale proceeds, cost basis, and any adjustment codes. Column (g) is where adjustments like wash sale disallowances go. Picking the wrong box is one of the most common filing mistakes: even if your final gain or loss is correct, a box mismatch triggers an automated IRS notice.

If all your transactions fall into Box A or Box D and require no adjustments, you can skip Form 8949 and enter the totals directly on Schedule D, lines 1a or 8a.7Internal Revenue Service. Form 8949 – Sales and Other Dispositions of Capital Assets This covers most people who buy and sell through a modern brokerage, since brokers report cost basis for virtually all shares purchased after 2011. Tax software handles this routing automatically.

Schedule D (Capital Gains and Losses) aggregates the Form 8949 numbers into short-term and long-term totals, then nets gains against losses in each category.8Internal Revenue Service. Instructions for Schedule D (Form 1040) The final figure flows to your Form 1040.

Choosing a Cost Basis Method

When you’ve bought the same stock at different times and prices, the cost basis method decides which shares you’re “selling” for tax purposes. The IRS allows two approaches for individual stocks:9Internal Revenue Service. Publication 551 (12/2025), Basis of Assets

  • Specific identification: you tell your broker exactly which shares to sell. This gives you the most control, because you can choose higher-basis shares to minimize gains or lower-basis shares to harvest losses.
  • First in, first out (FIFO): if you don’t identify specific shares, the IRS defaults to treating the oldest shares as sold first. FIFO can produce larger gains if your earliest purchases were at the lowest prices.

Average cost is available for mutual fund shares but not for individual stocks.9Internal Revenue Service. Publication 551 (12/2025), Basis of Assets Most brokerages let you set your preferred method in account settings. Choose before you sell. Once shares are sold under FIFO, you can’t go back and retroactively apply specific identification.

The Wash Sale Rule

The wash sale rule blocks you from selling a stock at a loss for the tax deduction and then immediately buying it back. If you repurchase the same or a “substantially identical” security within 30 days before or 30 days after the loss sale, the IRS disallows the loss.10Office of the Law Revision Counsel. 26 U.S.C. 1091 – Loss From Wash Sales of Stock or Securities

The full window is 61 days: 30 days before the sale, the sale date, and 30 days after. The disallowed loss isn’t gone forever. It gets added to the basis of the replacement shares, so you recognize it when you eventually sell those new shares.10Office of the Law Revision Counsel. 26 U.S.C. 1091 – Loss From Wash Sales of Stock or Securities Your broker will typically flag wash sales on your 1099-B and in Box (g) of Form 8949, but the reporting responsibility is yours.

The rule reaches across accounts. If you sell a stock at a loss in your taxable brokerage and your spouse buys the same stock in their IRA within 30 days, the IRS can disallow your loss. And the basis adjustment doesn’t help inside an IRA, because IRA gains aren’t tracked on a per-share basis.

What Happens When Losses Exceed Gains

When your total capital losses exceed your total capital gains for the year, you can deduct up to $3,000 of the net loss against ordinary income like wages or business earnings. Married filing separately caps the deduction at $1,500.11Office of the Law Revision Counsel. 26 U.S.C. 1211 – Limitation on Capital Losses

Anything above the $3,000 limit carries forward to the next tax year, keeping its character as short-term or long-term.12Office of the Law Revision Counsel. 26 U.S.C. 1212 – Capital Loss Carrybacks and Carryovers No expiration. A $50,000 loss in a market crash can carry forward year after year, offsetting future gains and deducting $3,000 against ordinary income annually until fully used. Keep records of your carryover, because the IRS doesn’t track it for you.

The 3.8% Net Investment Income Tax

On top of the regular capital gains rates, higher-income taxpayers face an additional 3.8% Net Investment Income Tax (NIIT). It applies to the smaller of your net investment income or the amount your modified adjusted gross income (MAGI) exceeds these thresholds:13Internal Revenue Service. Topic No. 559, Net Investment Income Tax

  • Single or head of household: $200,000
  • Married filing jointly: $250,000
  • Married filing separately: $125,000

Net investment income includes capital gains, dividends, interest, rental income, and royalties.14Internal Revenue Service. Instructions for Form 8960 Net Investment Income Tax It excludes wages, Social Security benefits, and retirement plan distributions. If you owe it, calculate the amount on Form 8960 and attach it to your return.

These thresholds are not indexed for inflation, so they catch more filers every year. A married couple with steady six-figure incomes who sells a concentrated stock position can easily trip over the $250,000 line even in a year that doesn’t feel particularly high-income. The practical top rate on long-term gains for someone well above the threshold is 23.8% (20% plus 3.8%).

When to Send an Estimated Tax Payment

If you sell a stock for a large gain mid-year and don’t have enough tax withheld elsewhere, you may owe an underpayment penalty when you file. The IRS expects you to pay through the year, not just in April. You can avoid the penalty by meeting any one of these safe harbors:15Office of the Law Revision Counsel. 26 U.S.C. 6654 – Failure by Individual to Pay Estimated Income Tax

  • You owe less than $1,000 when you file (after withholding and credits).
  • Your total payments during the year cover at least 90% of what you owe.
  • Your total payments equal at least 100% of the tax shown on last year’s return.
  • If your prior-year adjusted gross income exceeded $150,000 ($75,000 if married filing separately), the prior-year safe harbor rises to 110%.

Quarterly estimated payments are due April 15, June 15, September 15, and January 15 of the following year. This is where big gains catch people off guard. You sell in May, feel good about the profit, and forget the tax bill until the following April. By then penalties and interest sit on top of the tax itself. If you have a windfall gain, run the numbers early and send an estimated payment for the quarter in which you realized the gain.

Inherited and Gifted Stock Follow Different Basis Rules

Shares you acquired by inheritance or gift don’t use the price you’d pay on the open market as basis, and mixing them up is a common and expensive mistake.

Inherited Stock

When you inherit stock, your cost basis resets to the fair market value on the date the original owner died.16Office of the Law Revision Counsel. 26 U.S.C. 1014 – Basis of Property Acquired From a Decedent If a grandmother bought shares for $5,000 decades ago and they were worth $80,000 when she passed, your basis is $80,000. Sell shortly after for $82,000 and your taxable gain is only $2,000. All the prior appreciation is permanently erased for income tax purposes.

If the estate filed a federal estate tax return, the executor may have elected an alternate valuation date up to six months after death; in that case your basis is the value on the alternate date.16Office of the Law Revision Counsel. 26 U.S.C. 1014 – Basis of Property Acquired From a Decedent The step-up also works in reverse: if the stock declined before the owner’s death, your basis steps down to the lower value.

Gifted Stock

Stocks received as a gift carry over the donor’s original cost basis.17Office of the Law Revision Counsel. 26 U.S.C. 1015 – Basis of Property Acquired by Gifts and Transfers in Trust If a parent bought shares for $10,000 and gifted them to you when they were worth $25,000, your basis for a future gain is still $10,000. You inherit the built-in tax liability along with the stock.

One wrinkle: if the stock’s fair market value at the time of the gift was lower than the donor’s basis (the stock was underwater), and you later sell at a loss, you must use the lower fair market value as basis for calculating that loss.17Office of the Law Revision Counsel. 26 U.S.C. 1015 – Basis of Property Acquired by Gifts and Transfers in Trust If you sell at a price between the donor’s basis and the gift-date fair market value, you have no gain or loss at all. This “no-man’s land” rule trips up plenty of filers.

Splits, Mergers, and Other Corporate Actions

Corporate actions can change how many shares you own or swap one stock for another, and each event requires a basis adjustment. In a 2-for-1 split, your total basis stays the same but gets divided across twice as many shares. If you paid $5,000 for 100 shares, you now hold 200 shares with a basis of $25 each instead of $50.

In a merger where you receive shares of the acquiring company in exchange for shares of the target, your old basis generally transfers to the new stock. If cash is part of the deal, the cash portion may trigger a taxable gain even though you didn’t sell on the open market. Your brokerage should adjust the basis in your account, but check it against the merger terms rather than trusting it blindly.