US rules
Tax-Loss Harvesting in the U.S.
Educational only, not financial advice.
Selling at a loss to cut your tax bill, and the 30-day wash-sale rule that can undo it.
The short version
Tax-loss harvesting means selling an investment that is worth less than you paid so you can use the loss to reduce taxes on gains, and up to a limit on other income. It only works in a taxable brokerage account. The main trap in the U.S. is the wash-sale rule: if you buy the same or a substantially identical investment within 30 days before or after the sale, the IRS does not let you deduct the loss at that time.
This page covers U.S. federal rules. Canada has a similar but separate rule called the superficial loss rule; see tax-loss harvesting in Canada.
How a harvested loss is used
Capital losses first offset capital gains. If losses are larger than gains for the year, the IRS lets you deduct up to $3,000 of the net loss ($1,500 if married filing separately) against other income, and carry the rest forward to future years. See capital gains tax in the U.S. for how short-term and long-term gains are taxed.
Example: you sold a fund earlier in the year for a $6,000 gain. Another holding is down $4,000. Selling it realizes the $4,000 loss, which offsets part of the gain, so only $2,000 of gain is left to tax.
Harvesting usually delays tax rather than removing it. When you sell a loser and buy something else, the new holding starts with a lower cost basis than the old one had, so a later sale may produce a bigger gain. The benefit comes from having the money working in the meantime, and from cases where the later gain is taxed at a lower rate or never realized.
The wash-sale rule
Investor.gov, summarizing IRS rules, says a wash sale happens when you sell or trade securities at a loss and within 30 days before or after the sale you:
- buy substantially identical securities,
- acquire substantially identical securities in a fully taxable trade, or
- acquire a contract or option to buy substantially identical securities.
IRS Publication 550 adds two cases people often miss. Buying substantially identical stock in your IRA or Roth IRA within the window also counts. So does your spouse, or a corporation you control, buying it.
The window covers 61 days in total: the 30 days before the sale, the day of the sale and the 30 days after. Automatic dividend reinvestment in the same fund during that window can trigger a wash sale on part of the position.
What happens if you trigger it
A wash sale does not usually destroy the loss. Publication 550 says to add the disallowed loss to the cost of the new shares. That raises the new basis and postpones the deduction until you sell the new shares. Your holding period for the new shares also includes the time you held the old ones.
The IRS example: you buy 100 shares for $1,000, sell them for $750, and within 30 days buy 100 shares of the same stock for $800. You cannot deduct the $250 loss. Your basis in the new shares becomes $1,050, the $800 you paid plus the $250 disallowed loss.
The exception is the IRA case. If the replacement shares are bought in your IRA or Roth IRA, the basis adjustment does not apply, so the loss can be lost for good. Avoid buying the same holding in your retirement account around the time you harvest a loss in your taxable account.
Staying invested without a wash sale
Many investors sell the losing fund and buy a similar, but not substantially identical, fund so their money stays in the market. For example, they might switch from one broad stock index fund to a fund that tracks a different index. The IRS does not publish a list of what counts as substantially identical, and two funds tracking the same index from different providers could be challenged. If you are unsure, the simplest safe choice is to wait 31 days before buying back the original holding, accepting that the market may move while you wait.
A short checklist
- Confirm the holding is in a taxable account. Losses inside a 401(k) or IRA cannot be harvested.
- Check whether the loss is short-term or long-term, because short-term losses offset short-term gains first.
- Look back 30 days for any purchase of the same holding in any of your accounts, including dividend reinvestments and your spouse's accounts.
- Decide what you will hold for the next 31 days, and make sure it is not substantially identical.
- Turn off automatic reinvestment in the sold fund for the window.
- Keep records. Your broker's Form 1099-B may flag wash sales it can see, but it cannot see your IRA at another firm or your spouse's account.
Compared with Canada
Canada's superficial loss rule is similar in shape: buying identical property in the 30 days before or after a sale, and still holding it 30 days later, denies the loss, and affiliated people such as a spouse count. The Canadian loss is also usually added to the cost of the replacement. Canada has no equivalent of the $3,000 deduction against other income; net capital losses can only reduce taxable capital gains, carried back three years or forward indefinitely. See tax-loss harvesting in Canada.
FAQs
Does the wash-sale rule apply to gains?
No. It only stops you deducting a loss. Selling at a gain and buying back the next day does not create a wash sale, though the gain is taxable.
Is tax-loss harvesting worth it for small amounts?
It depends on your tax rate, the size of the loss and your trading costs. For small losses the tax saving may not justify the effort or the risk of a mistake. A tax professional can help you decide.
Related Guides
Sources
- IRS: Publication 550, Investment Income and Expenses (wash sales)
- Investor.gov (SEC): Wash Sales
- IRS: Topic no. 409, Capital gains and losses
Reviewed by Greg Parsons. Links checked October 14, 2026. Educational only, not financial advice.