Tax Deductions on Share Profits: Losses, Wash Sales, and NIIT

Profits from selling shares are taxed as capital gains, and the deductions available to shrink that bill fall into a short list: hold the shares long enough to qualify for the preferential long-term rate, offset gains with losses (including up to $3,000 against ordinary income), adjust your cost basis for fees and specific lots, use the stepped-up basis on inherited shares, and, if you itemize, deduct margin interest. Each has specific rules, and one common maneuver, selling at a loss and buying right back, will get the deduction disallowed.

Hold Longer Than a Year for the Lower Rate

The single biggest factor in what you owe is whether the gain is short-term or long-term. Stock held one year or less produces a short-term gain, taxed at ordinary income rates from 10% to 37% in 2026.1Internal Revenue Service. Topic No. 409, Capital Gains and Losses Stock held more than one year produces a long-term gain, taxed under a separate three-bracket schedule.2Office of the Law Revision Counsel. 26 USC 1222 – Definitions

For 2026, the long-term brackets are:3Office of the Law Revision Counsel. 26 USC 1(h) – Maximum Capital Gains Rate

  • 0% on taxable income up to $49,450 (single) or $98,900 (married filing jointly)
  • 15% from $49,451 to $545,500 (single) or $98,901 to $613,700 (married filing jointly)
  • 20% above $545,500 (single) or $613,700 (married filing jointly)

These thresholds adjust for inflation each year.4Internal Revenue Service. IRS Releases Tax Inflation Adjustments for Tax Year 2026 If your taxable income is modest, long-term share profits may be taxed at nothing. Selling one day short of the one-year mark can move the same profit into a bracket that’s twice as high, so the calendar itself is a deduction of sorts.

Offset Gains With Capital Losses

The most direct deduction for share profits is offsetting them with losses on other sales. A realized loss reduces a realized gain dollar for dollar.5Office of the Law Revision Counsel. 26 USC 1211 – Limitation on Capital Losses

The Netting Order Matters

The IRS requires a specific sequence. Short-term losses first offset short-term gains, and long-term losses first offset long-term gains. Only after each category settles internally does a net loss in one category cross over to reduce the other. Because short-term gains are taxed at higher ordinary rates, a short-term loss used against a short-term gain saves more tax than the same loss applied against a 15% long-term gain.

$3,000 Against Ordinary Income

If your total losses exceed your total gains for the year, up to $3,000 of the excess deducts against ordinary income like wages. Married filing separately gets $1,500.5Office of the Law Revision Counsel. 26 USC 1211 – Limitation on Capital Losses The cap has been $3,000 since 1978 and is not inflation-adjusted.

Carry the Rest Forward

Losses above the $3,000 annual limit carry forward indefinitely and keep their short-term or long-term character.6Office of the Law Revision Counsel. 26 USC 1212 – Capital Loss Carrybacks and Carryovers Investors who took large losses in a downturn can chip away at them for years, applying them to future gains or taking the $3,000 ordinary-income deduction each year until the pile runs out.

Worthless Stock

If a stock becomes completely worthless because the company went bankrupt or dissolved, you don’t have to find a buyer. The IRS treats a worthless security as sold on the last day of the tax year for zero proceeds, generating a capital loss equal to your full cost basis.7eCFR. 26 CFR 1.165-5 – Worthless Securities That loss then runs through the same netting and $3,000 rules.

Do Not Trigger the Wash Sale Rule

Selling a stock at a loss and buying it right back to lock in the deduction while keeping your position is the exact move the wash sale rule blocks. If you sell at a loss and buy substantially identical stock within 30 days before or 30 days after the sale, the loss is disallowed.8Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities The window covers 61 days total, centered on the sale.

The disallowed loss isn’t destroyed in a normal case. It gets added to the basis of the replacement shares, so the tax benefit shows up when you sell those shares later, and the original holding period tacks on. There’s an exception with real teeth: if you repurchase inside an IRA or Roth IRA, the loss is permanently forfeited, because a basis increase inside a tax-sheltered account has no practical effect. Your broker generally flags a wash sale in Box 1g of Form 1099-B and you carry it to Form 8949 with adjustment code “W.”9Internal Revenue Service. Publication 550 – Investment Income and Expenses If the broker misses one, you’re still on the hook to identify and report it.

Adjust Your Cost Basis

Your taxable gain is not just the sale price minus what the shares originally cost per share. The IRS defines cost basis as the total amount paid to acquire the investment, including certain expenses.10Internal Revenue Service. Topic No. 703, Basis of Assets Every dollar added to basis is a dollar less of taxable gain.

Fees and Commissions

Brokerage commissions, transfer fees, and regulatory charges paid at purchase get added to basis. Commissions and fees paid at sale get subtracted from proceeds.11Internal Revenue Service. Publication 551 – Basis of Assets Most brokerages fold these in automatically on the 1099-B, but if you used a full-service broker with real commission drag, confirm the reported basis includes them.

Choose Which Shares You Sold

When you bought the same stock across different lots at different prices, which lot you’re treated as selling controls the gain. The default rule is first in, first out: the oldest shares go first. Specific identification lets you pick a lot with a higher basis instead, cutting the taxable gain.11Internal Revenue Service. Publication 551 – Basis of Assets Most brokerage platforms let you select the lot at the moment of sale. Mutual funds also allow an average-cost method.

The math is real. Say you own 200 shares in two lots of 100, bought at $30 and at $50, and you sell 100 shares at $55. FIFO gives you a $25 per share gain, or $2,500. Specific identification of the $50 lot gives you $5 per share, or $500. Same sale, very different bill.

Stock Splits

A split changes your share count and per-share price but not your total basis. After a 2-for-1 split, you own twice as many shares at half the per-share basis. A reverse split works the opposite way. Update the per-share number so a later sale doesn’t overstate or understate the gain.

Inherited Shares Get a Stepped-Up Basis

Shares inherited after the owner’s death take a basis equal to fair market value on the date of death.12Office of the Law Revision Counsel. 26 USC 1014 – Basis of Property Acquired From a Decedent If a parent bought stock at $10 decades ago and it was worth $80 at death, your basis is $80. Sell at $85 and you have a $5 gain, not $75. The lifetime appreciation is never taxed. Beneficiaries who don’t know this rule often overpay by using the original purchase price.

Deduct Margin Interest If You Itemize

Interest on money borrowed through a margin account to buy stock may be deductible, capped at your net investment income for the year.13Office of the Law Revision Counsel. 26 USC 163(d) – Limitation on Investment Interest Net investment income for this purpose includes interest, ordinary dividends, and short-term capital gains. Qualified dividends and long-term capital gains are excluded by default; you can elect to include them, but only by giving up their preferential rate. Unused margin interest carries forward.14Internal Revenue Service. Form 4952 – Investment Interest Expense Deduction

The catch is that you claim this on Schedule A as an itemized deduction, filed with Form 4952. With the 2026 standard deduction at $16,100 for single filers and $32,200 for married couples filing jointly, most taxpayers don’t itemize and can’t use it.4Internal Revenue Service. IRS Releases Tax Inflation Adjustments for Tax Year 2026 It mostly helps investors already itemizing for mortgage interest, state taxes, or charitable gifts.

Watch the 3.8% Net Investment Income Tax

Higher earners owe an extra 3.8% on top of the regular capital gains rate. The Net Investment Income Tax kicks in when modified adjusted gross income exceeds $200,000 (single), $250,000 (married filing jointly), or $125,000 (married filing separately), and applies to the lesser of net investment income or the amount over the threshold.15Office of the Law Revision Counsel. 26 USC 1411 – Imposition of Tax Net investment income covers capital gains, dividends, interest, rental income, and royalties.

These thresholds are not adjusted for inflation, so more filers cross them each year. Someone with $250,000 in income and a $50,000 stock gain owes an extra $1,900 on top of the regular tax on that gain. At the top, a long-term gain effectively lands at 23.8% (20% plus 3.8%). None of the deductions above are canceled by the NIIT, but every dollar of gain you erase with a loss, a basis adjustment, or a specific-lot choice also erases the surtax it would have carried.