How to Report a Sale of Stock on Your Tax Return

To report a sale of stock on your tax return, you list each transaction on IRS Form 8949, total the short-term and long-term results on Schedule D, and carry the net figure to Line 7 of Form 1040. The tax you owe on any gain depends on how long you held the shares: one year or less is taxed at your ordinary income rate, more than one year at the lower long-term capital gains rate of 0%, 15%, or 20%.{1Internal Revenue Service. Topic No. 409, Capital Gains and Losses} The details below matter because your brokerage’s 1099-B often doesn’t tell the whole story, and small reporting errors can cost real money.

Calculating Gain or Loss on Each Sale

Your taxable gain or loss is the difference between what you received from the sale and what the stock cost you. Your broker reports the gross proceeds on Form 1099-B.{2Internal Revenue Service. Instructions for Form 1099-B (2026)} Subtract any selling costs like commissions not already netted out, and you have your net proceeds.

Your cost basis is the original purchase price of the shares, adjusted for reinvested dividends, stock splits, and any commissions paid at purchase. Subtract that adjusted basis from your proceeds. A positive result is a capital gain; a negative result is a capital loss. You do this calculation separately for every block of shares (each “lot”) you sold during the year.

Which Shares Did You Sell

If you bought shares of the same company at different times and prices, the shares you’re deemed to have sold changes the tax. Unless you tell your broker otherwise, they default to First-In, First-Out (FIFO), treating the oldest shares as sold first.{3Internal Revenue Service. Stocks (Options, Splits, Traders) 3} Because older shares usually have the lowest basis, FIFO tends to produce the largest taxable gain.

The alternative is Specific Identification: you tell your broker exactly which lots to sell before the trade settles. To minimize a gain, pick lots with the highest basis. To harvest a loss, pick lots that are underwater. Some brokers also offer Highest-Cost, First-Out (HIFO), which does this automatically. Average cost is available for mutual fund and certain ETF shares, but not for individual stocks.{4Vanguard. Average Cost Method}

Holding Period and the Rate You’ll Pay

Federal law draws the line at one year. Stock held one year or less produces a short-term gain or loss; held more than one year, it’s long-term.{5Office of the Law Revision Counsel. 26 USC 1222 – Definitions}

Short-term gains are taxed at your ordinary income rate. For 2026, the top federal rate is 37% for single filers with taxable income above $640,600 and married joint filers above $768,700.{6Internal Revenue Service. IRS Releases Tax Inflation Adjustments for Tax Year 2026} Even moderate earners in the 22% or 24% bracket pay those rates on short-term stock gains.

Long-term gains get preferential rates of 0%, 15%, or 20% depending on taxable income and filing status. For 2026:

  • 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% threshold up to $545,500 (single), $613,700 (married filing jointly), or $579,600 (head of household).
  • 20% rate: taxable income above the 15% threshold.

The difference is real. Selling $50,000 of appreciated stock one day before the one-year mark instead of one day after can push the rate on that gain from 24% to 15%.

The 3.8% Net Investment Income Tax

High earners face an additional 3.8% Net Investment Income Tax (NIIT) on top of the regular rate. It applies to the lesser of your net investment income or the amount your modified adjusted gross income exceeds $200,000 (single), $250,000 (married filing jointly), or $125,000 (married filing separately).{7Internal Revenue Service. Net Investment Income Tax} Those thresholds aren’t indexed for inflation. A married couple filing jointly with $300,000 in modified AGI pays NIIT on $50,000 of investment income, not the full amount.{8Internal Revenue Service. Questions and Answers on the Net Investment Income Tax}

What Your 1099-B Tells You (and What It Misses)

Your brokerage sends Form 1099-B reporting every stock sale in your taxable account. It includes gross proceeds, sale date, and acquisition date. For stock purchased in 2011 or later, brokers must also report your cost basis to you and to the IRS.{9Internal Revenue Service. IRS Issues Final Regulations on New Basis Reporting Requirement} These are “covered” securities; the form indicates the basis was reported.

Stock purchased before 2011 is “non-covered.” The basis box may be blank. You’re still responsible for calculating and reporting the correct basis using trade confirmations, account statements, and dividend reinvestment records. If you’re audited, the burden of proving basis falls on you.

Consolidated 1099-Bs usually arrive by mid-February. Check the numbers. Brokers sometimes get the acquisition date or basis wrong, especially after mergers, spin-offs, or share transfers between firms. Contact your broker before filing if anything looks off.

Filling Out Form 8949 and Schedule D

Two IRS forms do the work. Form 8949 lists every transaction. Schedule D summarizes the totals and feeds the final number into your 1040.{10Internal Revenue Service. About Form 8949, Sales and Other Dispositions of Capital Assets}

Form 8949

Form 8949 has Part I for short-term sales and Part II for long-term sales. Within each part, check the box indicating whether the broker reported basis to the IRS (Box A or D), reported proceeds but not basis (Box B or E), or didn’t issue a 1099-B (Box C or F). For each transaction, enter the stock name, acquisition and sale dates, proceeds, and basis. The difference is your gain or loss.

When the 1099-B needs correcting, you enter an adjustment code in column (f) and the dollar adjustment in column (g). The most common:{11Internal Revenue Service. 2025 Instructions for Form 8949}

  • Code B when the basis shown on your 1099-B is incorrect. Enter the reported basis in column (e) and the correction in column (g).
  • Code W for a wash sale loss that’s non-deductible. Enter the disallowed loss as a positive number in column (g), reducing or eliminating the reported loss.
  • Code E for selling expenses not already reflected on the 1099-B. Enter as a negative number in column (g).

Schedule D

Once every transaction is on Form 8949, total the short-term and long-term columns separately and transfer the totals to Schedule D.{12Internal Revenue Service. About Schedule D (Form 1040), Capital Gains and Losses} Schedule D combines the net short-term result with the net long-term result to produce your overall capital gain or loss. That figure goes to Line 7 of Form 1040 and directly affects your adjusted gross income.{13Internal Revenue Service. 2025 Schedule D (Form 1040) – Capital Gains and Losses}

If your only capital gains come from distributions reported on Form 1099-DIV, you may not need Form 8949 or Schedule D at all; the Schedule D instructions include a worksheet for that case. Any actual stock sale requires the full process.

When the Reported Basis Is Wrong: Employee Stock

If you sold stock acquired through an employer plan, the basis reported on your 1099-B is often wrong for tax purposes. Brokers typically report only the exercise price or grant price, ignoring the portion you already reported as ordinary income when the stock vested or was exercised.{14Internal Revenue Service. Instructions for Form 8949}

For non-qualified stock options, the spread between exercise price and market price at exercise was included in your W-2 wages. Add that amount to your cost basis on Form 8949 or you’ll pay tax on it twice. Restricted stock units work the same way: the full market value at vesting was already taxed as W-2 income and becomes your basis.

Incentive stock options add complexity. If you held the shares long enough to meet both the two-year and one-year holding requirements, the gain above your exercise price qualifies for long-term rates. If you sold earlier (a “disqualifying disposition”), part of the gain is taxed as ordinary income. In either case, use Code B on Form 8949 to adjust the basis. Your employer’s stock plan administrator should provide a supplemental document showing the income already reported on your W-2.

Inherited or Gifted Stock

Stock you didn’t buy yourself follows different basis rules, and this is one of the most expensive places to get reporting wrong.

For inherited stock, your basis is the fair market value on the date the previous owner died.{15Office of the Law Revision Counsel. 26 USC 1014 – Basis of Property Acquired From a Decedent} If the original owner bought at $10 and the shares were worth $80 at death, your basis is $80. If the estate’s executor elected an alternate valuation date six months after death, you use the value on that date. Inherited stock is always treated as long-term, no matter how briefly you hold it.

Gifted stock is different. You take the donor’s original basis, and you tack on the donor’s holding period as well.{16Office of the Law Revision Counsel. 26 USC 1015 – Basis of Property Acquired by Gifts and Transfers in Trust}{17Office of the Law Revision Counsel. 26 USC 1223 – Holding Period of Property} If the fair market value at the time of the gift was lower than the donor’s basis, a special rule kicks in: you use the donor’s basis to figure a gain, but the lower FMV to figure a loss. If the sale price falls between those two numbers, you have neither a gain nor a loss.{18Internal Revenue Service. Property (Basis, Sale of Home, Etc.)}

Losses, Carryovers, and the Wash Sale Rule

Capital losses offset capital gains dollar for dollar. Short-term losses first offset short-term gains, long-term losses first offset long-term gains, and any remaining loss crosses over. If you still have a net loss, you can deduct up to $3,000 against ordinary income ($1,500 if married filing separately).{19Office of the Law Revision Counsel. 26 USC 1211 – Limitation on Capital Losses}

Anything beyond the $3,000 annual cap carries forward indefinitely, keeping its short-term or long-term character.{20Office of the Law Revision Counsel. 26 USC 1212 – Capital Loss Carrybacks and Carryovers} A large realized loss may take years to use up at $3,000 per year, but it doesn’t expire.

The wash sale rule catches investors trying to harvest a loss while staying in the position. If you sell stock at a loss and buy the same or a substantially identical security within 30 days before or after, the loss is disallowed.{21Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities} The disallowed loss isn’t gone; it gets added to the basis of the replacement shares. Sell on December 15 and buy back on January 5, and the loss is disallowed. The window runs in both directions, so a purchase shortly before the sale counts too.

Paying the Tax Before Filing Season

A large gain during the year often outruns your paycheck withholding. The IRS expects you to pay as you go; wait until you file, and you may owe an underpayment penalty.

You generally need to make estimated tax payments if you’ll owe $1,000 or more after withholding and refundable credits, and your withholding will cover less than the smaller of 90% of your current-year tax or 100% of your prior-year tax (110% if your prior-year AGI exceeded $150,000).{22Internal Revenue Service. Large Gains, Lump Sum Distributions, Etc.} If a gain hits in the third quarter, the annualized income installment method lets you size the payment to the quarter the gain occurred instead of spreading it evenly across four quarters. As an alternative to mailing quarterly payments, you can increase W-2 withholding for the rest of the year.{23Internal Revenue Service. Underpayment of Estimated Tax by Individuals Penalty}

State Taxes Are a Separate Layer

Federal reporting isn’t the whole picture. Most states tax capital gains as ordinary income, with top rates ranging from roughly 3% to over 13%. A handful of states have no income tax at all. In a high-tax state, the combined federal, state, and NIIT burden on a short-term gain can approach or exceed 50%. Your state return typically starts from the same gain or loss figures on your federal Schedule D, but some states have their own exclusions or additional surtaxes on investment income. Check your state’s rules before assuming the federal return is done.