Tax-Loss Harvesting: How It Works and When It Is Worth It
Tax-loss harvesting is the practice of selling investments at a loss to reduce your tax bill, then reinvesting the proceeds so you stay in the market. It is one of the most talked-about year-end strategies, and it is also one of the most misunderstood. It does not create money; it defers tax. This guide explains the mechanics, the traps and how to decide whether to do it. The loss harvesting calculator can estimate the effect for your own numbers.
The basic mechanics
When you sell an investment in a taxable account for less than your basis, you have a capital loss. Capital losses are used in a set order under the tax code. First, short-term losses offset short-term gains, and long-term losses offset long-term gains. Next, a net loss in one category offsets a net gain in the other. If you still have a net loss, you can deduct up to $3,000 ($1,500 if married filing separately) against ordinary income such as wages. Whatever is left carries forward to later years indefinitely, keeping its short- or long-term character. IRS Publication 550 and the Schedule D instructions walk through the order.
Why short-term versus long-term matters
Short-term gains are taxed like wages, up to 37%, while long-term gains are taxed at 0%, 15% or 20%. A dollar of short-term loss used against a short-term gain saves you your full marginal rate; a dollar of long-term loss used against a long-term gain saves 15% or 20% for most people. This is why investors look first for short-term losses to harvest. A filer in the 24% bracket who has an $8,000 short-term gain can save $1,920 by harvesting an $8,000 short-term loss.
A simple example
Suppose you are single with $100,000 of taxable income and you sold a stock earlier this year for a $10,000 long-term gain. In December you notice a fund you bought in 2023 is down $10,000. If you sell it, the loss cancels the gain and you avoid about $1,500 of tax (15% of $10,000). If instead you had no gains, the same loss would reduce your income by $3,000, saving about $660 in the 22% bracket, and the remaining $7,000 would carry into 2027.
The wash-sale rule
The rule in section 1091 of the Internal Revenue Code stops you from selling a security for a loss and buying it right back. If you buy the same or a “substantially identical” security within 30 days before or after the sale, the loss is disallowed for now and added to the basis of the new shares. That means the loss is not gone, but you cannot use it this year. Important details:
- The window is 61 days: 30 days before, the day of sale and 30 days after.
- It applies across all your accounts, including an IRA, and to purchases by your spouse.
- Dividend reinvestment can trigger it if shares are bought automatically during the window.
- It does not apply to a gain, only a loss.
To stay invested during the window, investors often buy a similar, but not identical, holding, such as a fund that tracks a different index, or wait 31 days. There is no official test for “substantially identical,” so be cautious with funds that track the same index from different providers.
What harvesting really does
The replacement investment has a lower basis than the one you sold. When you eventually sell it, your gain will be larger by the amount of the loss you took. So harvesting mostly defers tax, and that can still be valuable: the money you save now can be invested, and if you hold until death the heirs receive a stepped-up basis, which erases the deferred gain. It is most helpful when you can use the loss against gains taxed at a higher rate than you expect to pay later, or when you will donate the replacement shares to charity.
When it is not worth doing
- You are in the 0% bracket. If your gains are already taxed at 0%, harvesting wastes the loss; consider harvesting gains instead.
- The loss is small. Trading costs, bid-ask spreads and the time you spend may exceed the saving.
- It is in a retirement account. Losses in an IRA or 401(k) are not deductible.
- You would break your investment plan. Selling a good investment just to get a deduction is a bad trade, and the replacement should fit your allocation.
- You are in a lower bracket now than you will be later. Using a loss today against income taxed at 12% while deferring a gain that will be taxed at 24% later can cost you.
A year-end process
- Print or export your realized gains and losses for the year from your brokerage.
- List the positions with unrealized losses and their holding periods.
- Estimate your tax with and without each sale using the calculator.
- Check the last 30 days of purchases and any automatic reinvestments for wash-sale conflicts.
- Place the sale orders before the last trading day of the year; the trade date, not the settlement date, determines the tax year for publicly traded securities.
- Record the replacement and the date you can repurchase the original, if you wish.
Pitfalls investors run into
- Buying in the wrong account. Purchasing the same fund in an IRA during the 61-day window can disallow the loss permanently, because the basis adjustment is lost inside the IRA.
- Forgetting dividends. A dividend reinvestment of a few dollars in the window counts as a purchase. Turn off automatic reinvestment for the position before you sell.
- Harvesting too early or too late. Losses that exist in October may be gone by December, and a sale placed on the last trading day can be disrupted by an outage. Many investors review in early December.
- Ignoring the state. Some states do not follow the federal $3,000 cap or have other rules for losses.
Remember also that the wash-sale rule counts purchases made by your spouse and by entities you control. If you are unsure whether a trade will count, assume it does.
Prior-year carryovers
If you have a loss carried forward from an earlier year, it shows up on the Schedule D worksheet of your prior-year return. Use it before creating new losses, because a carryover offsets this year’s gains automatically. Many people forget to enter a carryover when they change preparers or software, which means losing the benefit. Confirm yours before deciding how much more to harvest.
Tax software, robo-advisers and direct indexing
Some brokers and robo-advisers harvest automatically. These services can help, but they may use similar funds across several accounts that trigger wash sales if you hold the same fund elsewhere. Direct indexing, owning the individual stocks of an index, creates more losses to harvest but also more complexity and cost. Check the fees and keep the wash-sale rule in mind when you manage several accounts, including your spouse’s and your IRA.