Tax-Loss Harvesting Explained
Introduction: The One Useful Thing About a Losing Investment
Every investor eventually holds something worth less than they paid for it. Tax-loss harvesting is the discipline of making that loss do useful work: you sell the investment in a taxable account, realize the capital loss for tax purposes, and use the loss to cancel out taxable gains elsewhere, or to shelter a slice of ordinary income. Done correctly, it converts a position you no longer want, or still want but can replace, into a smaller tax bill, without changing your overall investment strategy very much.
Harvesting is legal, routine, and described in the IRS’s own publications, but it is fenced in by rules that punish carelessness. The wash-sale rule can erase the loss entirely if you repurchase too quickly, and the worst version of that mistake, repurchasing inside an IRA, destroys the loss permanently. This guide explains the mechanics, the limits, and the traps, following the rules as the IRS states them in Topic No. 409 on capital gains and losses and Publication 550.
First, the Rules Every Harvest Stands On
A capital loss arises when you sell a capital asset, which includes stocks, bonds, and funds held as investments, for less than your adjusted basis, usually what you paid for it. Losses are classified by holding period: an asset held one year or less produces a short-term loss, and one held more than a year produces a long-term loss. Losses on personal-use property, such as your home or car, are not deductible at all, which is why harvesting only exists in the investment world.
On your tax return, losses are applied in a set order. They first offset capital gains, short-term losses against short-term gains and long-term against long-term, and then any remaining gains of the other type. Only after your gains are fully absorbed does a leftover loss touch other income, and then only up to a fixed annual limit, with the rest carried forward. Understanding that order matters, because a harvested loss is most valuable when it shelters gains that would otherwise be taxed, especially short-term gains, which are taxed as ordinary income. Our capital gains tax guide walks through the gain side of this ledger in full.
How Harvesting Works, Step by Step
The basic sequence is simple. In a taxable brokerage account, you identify a holding trading below your basis. You sell it, which realizes the loss. You then decide what to do with the proceeds: leave them in cash for at least 31 days, or immediately buy a different investment that keeps your portfolio’s exposure roughly intact without being substantially identical to what you sold. At tax time, the loss flows onto Form 8949 and Schedule D, where it offsets gains and, within limits, other income.
Two boundaries are absolute. First, harvesting only works in taxable accounts. Selling a loser inside a traditional IRA, Roth IRA, or 401(k) produces no deductible loss at all, because gains inside those accounts are not taxed year by year in the first place. Second, harvesting never creates wealth by itself. If you repurchase a similar investment at the lower price, your basis in the new holding is lower by roughly the amount of the loss, so the tax is largely deferred into a larger future gain rather than forgiven. The genuine wins are narrower and real: offsetting gains at a higher rate today than the rate you will pay later, sheltering ordinary income within the annual limit, and losses that are eventually erased if the replacement holding receives a stepped-up basis at death or is sold in a year when your capital gains rate is zero.
One refinement separates careful harvesters from casual ones: which shares you sell. Most investors hold the same security in lots bought at different prices, and brokers let you identify the specific lots a sale comes from. Selling the highest-basis lots produces the largest loss from the same position, and sometimes lets you harvest a loss from a holding that is profitable overall. Set the lot-selection method before the trade settles, keep the confirmation, and make sure the method you chose is the one your broker actually applied, because the default is often first-in, first-out whether it suits you or not.
The $3,000 Rule and the Carryforward: A Worked Example
If your capital losses exceed your capital gains for the year, the IRS lets you deduct the excess against other income, but only up to $3,000 per year, or $1,500 if you are married filing separately. Anything beyond that is not lost; it carries forward to future years, keeping its short-term or long-term character, and can offset future gains or be drawn down $3,000 at a time. There is no expiration date on a carryforward, though it does die with the taxpayer.
A clearly hypothetical example shows the flow. Suppose that during the year you realize $10,000 of capital losses through harvesting and $4,000 of capital gains from other sales. The losses first absorb the $4,000 of gains entirely, leaving $6,000. You may deduct $3,000 of that against salary or other income this year, and the remaining $3,000 carries forward to next year. The arithmetic: $10,000 minus $4,000 is $6,000, and $6,000 minus the $3,000 deduction leaves $3,000 carried forward. If the sheltered gains would otherwise have been taxed at a hypothetical 15 percent, wiping out $4,000 of them saves $600 of tax this year, since 15 percent of $4,000 is $600, plus whatever your marginal rate saves you on the $3,000 income deduction. Note what harvesting did not do: it did not require the losing investments to recover, or any prediction about markets at all.
The Wash-Sale Rule: The 61-Day Trap
The wash-sale rule is the fence around the whole strategy. Under IRS Publication 550, if you sell stock or securities at a loss and buy substantially identical stock or securities within 30 days before or after the sale, a 61-day window centered on the sale date, the loss is disallowed for now. The rule also reaches purchases by your spouse, purchases of options or contracts to buy the same security, and, most dangerously, purchases inside your IRA or Roth IRA.
The rule also works proportionally, which cuts both ways. If you sell 100 shares at a loss and repurchase only 40 substantially identical shares inside the window, only the loss on 40 shares is disallowed and added to the new shares’ basis; the loss on the other 60 is deductible now. Publication 550 matches repurchases to sold shares in the order bought, so partial repurchases, staggered purchases, and dividend reinvestment plans, which buy small amounts automatically and can quietly wash a carefully planned harvest, all need watching. Turning off automatic reinvestment in the security you intend to harvest, in every account you control, is standard hygiene in the month around a harvest.
In an ordinary taxable repurchase, a disallowed loss is postponed rather than destroyed: you add it to the basis of the replacement shares, and your holding period in the old shares carries over, so you recover the benefit when you eventually sell the new shares and stay out. A hypothetical illustration, in the same pattern as the IRS’s own example: you buy 100 shares at $50, for $5,000, sell them at $40, for $4,000, realizing a $1,000 loss, then rebuy 100 shares within the window at $42, for $4,200. The $1,000 loss is disallowed today, but your basis in the new shares becomes $4,200 plus $1,000, or $5,200. The IRA version has no such consolation. Because the replacement sits in an account with no basis tracking of that kind, the IRS treats a loss disallowed by an IRA repurchase as gone permanently, the single most expensive harvesting mistake a do-it-yourselfer can make. Also note the reporting blind spot: your broker’s Form 1099-B flags wash sales only for identical securities in the same account, so wash sales you create across accounts, or in an IRA, will not be flagged for you, even though the rule still applies.
Staying Invested Without Tripping the Rule
Most harvesters do not want to sit in cash for a month, so they swap into a replacement holding immediately. The legal standard is “substantially identical,” a facts-and-circumstances test the IRS has never reduced to a bright line for funds. Shares of the same company are obviously identical. Funds tracking the same index from different providers occupy a gray zone that practitioners debate; funds tracking different indexes, or an index fund swapped for a diversified fund with a different mandate, are the more conservative pattern. What is clear is that the economic exposure can be kept similar while the security itself changes, and that the differences between fund types matter here, which is one reason the distinctions in our ETFs vs mutual funds comparison are worth understanding before you swap.
The alternative is patience: sell, wait at least 31 days, and buy back the original holding if you still want it. That route carries market risk, since the price may run away from you during the month out, but it eliminates all doubt about the substantially identical question. Either way, keep records of every leg. Harvesting multiplies trades, lots, and basis adjustments, and the person who has to reconstruct them at tax time is you.
Timing, State Taxes, and the Mirror-Image Strategy
Harvesting is a year-end sport because a loss only counts for the tax year in which the sale actually happens; a sale executed in January belongs to the new year, however December-like it feels. That deadline is why brokers’ systems groan in late December, and why a calmer approach, reviewing taxable accounts for harvestable losses a few times a year, especially after market declines, usually captures more than a single December scramble. Remember also that the 61-day wash-sale window ignores the calendar: a sale on December 20 is still exposed to repurchases through the middle of January.
Two footnotes complete the picture. State treatment varies: many states follow the federal approach to capital losses, but not all do in every detail, so confirm your own state’s rules before counting a state-level benefit. And there is a mirror-image strategy worth knowing. In a year when your income is low enough that long-term gains fall in the zero percent federal bracket described in Topic No. 409, you can deliberately realize gains, pay no federal tax on them, and immediately repurchase the same holding at a higher basis. The wash-sale rule does not apply, because it only restricts losses. Gains harvesting and loss harvesting are the same insight pointed in opposite directions: your basis is a tax asset, and you manage it deliberately.
When Harvesting Is Not Worth It
The strategy has clear dead zones. If your taxable income is low enough that your long-term gains would be taxed at the zero percent rate anyway, harvested losses shelter gains that cost you nothing, and are better saved, implicitly, by simply not realizing them. If the loss is small, commissions, bid-ask spreads, and your own time can consume the benefit. If you cannot resist repurchasing the same security immediately, the wash-sale rule will simply hand your loss back as a basis adjustment, leaving you the paperwork and none of the timing benefit. And if all your losing positions sit inside retirement accounts, there is nothing to harvest at all, only the IRA repurchase trap to avoid while harvesting in your taxable account.
The Bottom Line
Tax-loss harvesting turns realized losses into offsets: first against capital gains, then up to $3,000 a year against ordinary income, with unlimited carryforward of the rest. Its value comes from rate differences and timing, not from the losses themselves, which mostly defer tax through a lower replacement basis. Respect the 61-day wash-sale window, never repurchase a harvested security inside an IRA, and keep meticulous records. Follow those three rules and harvesting is a modest, repeatable tax saving; break the second one and it becomes an expensive lesson.
Disclaimer: This article is for educational purposes only and is not financial, tax, or legal advice. Investing involves risk, including the possible loss of principal. Examples are hypothetical and do not represent actual or future returns. Consider speaking with a qualified financial or tax professional about your own situation.
