Selling an investment at a loss feels bad. Doing it deliberately -- on purpose, before December 31 -- feels worse. But tax-loss harvesting converts paper losses into real tax savings by using those losses to offset gains elsewhere in your portfolio. Done correctly, it can reduce your federal tax bill by thousands of dollars in a single year, with unused losses carrying forward indefinitely. Done incorrectly, the wash sale rule can disallow the entire deduction.

Note

Tax-loss harvesting is a deferral strategy, not tax elimination. You sell investments at a loss to offset gains now, but the reduced cost basis on replacement investments means you will eventually owe the deferred tax. The value comes from the time benefit: a dollar of tax deferred for 10 or 20 years is worth considerably less than a dollar owed today.

## What Tax-Loss Harvesting Actually Is

Tax-loss harvesting is the practice of selling investments that are currently worth less than what you paid for them, then using those realized losses to offset realized capital gains. The "harvesting" metaphor is deliberate: you are picking losses at the moment they are most useful, the way you would pick fruit when it is ripe.

Suppose you bought 500 shares of a broad market ETF at $200 per share ($100,000 total) and it is now trading at $160. You have a $20,000 unrealized loss. If you sell, that loss becomes realized and available to offset gains. If you also sold another position earlier in the year for a $25,000 gain, that $20,000 harvested loss reduces your taxable gain to $5,000. At a 20% long-term capital gains rate plus the 3.8% net investment income tax, that is roughly $4,760 in federal taxes you no longer owe.

The loss does not evaporate -- it reduces the basis of whatever you buy as a replacement, which means you will eventually owe those taxes when you sell the replacement. Tax-loss harvesting is a deferral strategy, not elimination. But a dollar of tax deferred for 10 or 20 years is worth considerably less than a dollar of tax owed today.

How Tax-Loss Harvesting Works
1
Identify Losing Positions
Review Portfolio
Scan your taxable brokerage account for investments currently trading below your cost basis. Retirement accounts do not qualify.
2
Sell the Losing Position
Execute Trade
Sell the investment to realize the loss. The trade must settle by December 31 to count for the current tax year (T+1 settlement).
3
Buy a Non-Identical Replacement
Within 0-30 Days
Reinvest in a similar but not "substantially identical" security to maintain your portfolio allocation. Buying the same or substantially identical security within 30 days triggers the wash sale rule.
4
Apply Losses Against Gains
Tax Return
Losses first offset gains dollar-for-dollar (short-term vs. short-term, then cross-netting). Up to $3,000 of excess losses offset ordinary income per year, with the rest carrying forward indefinitely.
## How Losses Offset Gains: The Netting Order

The IRS does not let you pick which gains your losses offset. There is a specific netting order defined by the tax code.

Technical detail
IRC Section 1222 defines the categories of capital gains and losses and the netting sequence. Short-term means held one year or less; long-term means held more than one year.

The process works in two stages:

  1. Net within each category first. Short-term losses offset short-term gains. Long-term losses offset long-term gains.
  2. Cross-net between categories. If one category has a net loss and the other has a net gain, they offset each other.

This order matters because short-term gains are taxed at ordinary income rates (up to 37%), while long-term gains are taxed at preferential rates (0%, 15%, or 20% depending on income). A short-term loss offsetting a short-term gain saves more tax per dollar than that same loss offsetting a long-term gain. You do not get to choose -- the netting is automatic -- but understanding it helps you decide which positions to harvest.

The $3,000 Limit Against Ordinary Income

If your total capital losses exceed your total capital gains for the year, you can deduct up to $3,000 of the excess against ordinary income ($1,500 if married filing separately).

Technical detail
IRC Section 1211(b) limits the deduction of net capital losses against ordinary income to $3,000 per year ($1,500 for married filing separately).
That $3,000 cap has not been adjusted for inflation since it was set in 1978. For a taxpayer in the 37% bracket, $3,000 against ordinary income saves $1,110 in federal taxes per year.

Any losses beyond the $3,000 limit are not wasted. They carry forward to the next tax year -- and the year after that, and every year after that -- until they are fully used.

Technical detail
Unused capital losses carry forward indefinitely under IRC Section 1212(b). They retain their character as short-term or long-term in the carryforward year.
A retiree who harvests a large loss in a down-market year might carry it forward for a decade, using $3,000 per year against ordinary income while also offsetting any future gains from portfolio rebalancing.

The Wash Sale Rule: The Trap That Disallows Your Deduction

Warning

The wash sale rule applies across all your accounts -- including your spouse's accounts and IRAs. Selling at a loss in your taxable brokerage account while your spouse buys the same security in their IRA, or having dividend reinvestment plans automatically purchase shares during the 61-day window, can disallow the entire deduction.

This is where most people make the mistake that wipes out the benefit entirely.
Technical detail
IRC Section 1091 disallows a loss deduction if the taxpayer acquires substantially identical stock or securities within a 61-day window: 30 days before through 30 days after the sale.

If you sell a security at a loss and buy the same or "substantially identical" security within 30 days before or 30 days after the sale, the IRS disallows the loss entirely for that tax year. The disallowed loss is not lost forever -- it gets added to the basis of the replacement security -- but it defeats the purpose of harvesting it now.

The 30-day window runs in both directions, creating a 61-day blackout period (30 days before the sale + the sale date + 30 days after). If you bought additional shares of the same fund on November 15 and then sell at a loss on December 1, you have triggered a wash sale even though the purchase came first.

The rule applies across accounts. Selling at a loss in your taxable brokerage account while your spouse buys the same security in their IRA can trigger a wash sale. Dividend reinvestment plans that automatically buy shares during the 61-day window can also trigger it.

What "Substantially Identical" Means -- and What It Does Not

The IRS has never published a bright-line definition of "substantially identical." The determination depends on the facts and circumstances of each case, but decades of guidance and case law provide useful boundaries.

Generally considered substantially identical:

  • Selling shares of an S&P 500 index fund from one provider and buying an S&P 500 index fund from a different provider that tracks the same index
  • Selling a stock and buying a call option on that same stock

Generally not considered substantially identical:

  • Selling an S&P 500 index fund and buying a total stock market fund (different index, different composition, different weightings)
  • Selling shares of Company A and buying shares of Company B, even in the same industry
  • Selling a bond fund and buying a different bond fund with a different duration, credit quality, or benchmark
Investor sells S&P 500 index fund at a $20,000 loss in December
Without Planning
Violates Wash Sale Rule
  • Sells Vanguard S&P 500 ETF (VOO) at $20,000 loss
  • Buys iShares S&P 500 ETF (IVV) within 30 days
  • Both track the same index -- substantially identical
  • Entire $20,000 loss is disallowed for the current year
Result$0 tax benefit this year
With Planning
Proper Replacement Strategy
  • Sells Vanguard S&P 500 ETF (VOO) at $20,000 loss
  • Immediately buys Vanguard Total Stock Market ETF (VTI) -- different index, different composition
  • Maintains similar market exposure without triggering wash sale
  • After 31 days, can swap back to VOO if preferred
Result$4,760 tax savings at 23.8% combined rate
The practical approach: sell the losing position and replace it with something that maintains your overall portfolio allocation without tracking the identical index or holding the identical security. Wait 31 days. If you still prefer the original holding, buy it back.
Technical detail
The IRS position on "substantially identical" is based on facts and circumstances. See Rev. Rul. 56-406 for guidance on stocks of different corporations. IRS Publication 550 provides additional examples.

Connection to Step-Up in Basis for Inherited Portfolios

Tax-loss harvesting and the step-up in basis at death are related but work in opposite directions. When someone dies, inherited assets receive a new basis equal to their fair market value on the date of death under IRC Section 1014. All unrealized gains disappear from the tax ledger. (For a detailed explanation, see Step-Up in Basis Explained.)

This creates an important planning consideration for widowed individuals or anyone who has recently inherited a portfolio. If you inherited securities that have since declined below the stepped-up basis, those losses are available for harvesting. The stepped-up basis becomes your cost basis, and any decline from that point is a real, harvestable loss.

Conversely, if you are elderly and expect your heirs to inherit your portfolio, harvesting losses aggressively may be counterproductive. The step-up at death will reset the basis of everything anyway, so the deferred tax from harvesting never comes due. In that case, the benefit of harvesting is limited to the $3,000 annual offset against ordinary income during your remaining lifetime.

When Harvesting Makes Sense -- and When It Does Not

Tax-loss harvesting is not always beneficial. The decision depends on your current and expected future tax situation.

Harvesting tends to help when:

  • You have realized gains elsewhere in the portfolio this year that need offsetting
  • You are in a high tax bracket now and expect to be in a lower bracket later (e.g., approaching retirement)
  • You have a long time horizon, so the deferred tax has many years to compound
  • You are rebalancing your portfolio anyway and can sell losing positions as part of that process

Harvesting may not help -- or may hurt -- when:

  • You are in a low tax bracket now and expect to be in a higher one later (the deferred tax will eventually be paid at a higher rate)
  • You are near the end of your life and the step-up in basis will eliminate the deferred tax regardless
  • Transaction costs or the complexity of tracking wash sales outweigh the tax savings
  • You let the tax decision override your investment strategy -- the phrase in planning circles is "don't let the tax tail wag the investment dog"

A retired taxpayer in the 12% bracket with no capital gains to offset receives only $360 per year from the $3,000 ordinary income offset. That may not justify the record-keeping burden and the risk of triggering a wash sale.

Automated Harvesting vs. CPA-Guided Strategy

Robo-advisors check for harvesting opportunities daily and execute trades automatically. That frequency is a genuine advantage -- markets can recover quickly, and a loss that exists on Tuesday may be gone by Friday. Some platforms claim the added after-tax return from harvesting offsets or exceeds their advisory fees.

Those claims deserve scrutiny. The 1%-or-more benefit frequently cited by automated platforms assumes ideal conditions: frequent contributions, short-term losses to harvest, and many individual security positions. Real-world results for most investors are more modest. Platform fees of 0.25% or more can eat into the savings.

A CPA or tax advisor brings something automated systems cannot: knowledge of your full tax picture. A robo-advisor does not know about the rental property gain you realized in March, the stock options vesting in September, or the inherited IRA distributions pushing you into a higher bracket. It optimizes the portfolio it manages in isolation.

The most effective approach for investors with complex situations -- multiple income sources, equity compensation, inherited assets, business income -- is often CPA-guided strategy with tax-aware investment management handling the execution. The CPA identifies the optimal amount and character of losses to harvest based on the full tax return, and the investment manager executes the trades within the portfolio.

Frequently Asked Questions

Can I harvest losses in a retirement account like a 401(k) or IRA?

No. Gains and losses inside tax-deferred accounts (traditional IRA, 401(k)) and tax-exempt accounts (Roth IRA, Roth 401(k)) are not recognized for tax purposes until distribution. There is nothing to "harvest" because the IRS does not tax transactions within these accounts. Tax-loss harvesting only works in taxable brokerage accounts.

Does the wash sale rule apply to cryptocurrency?

Under IRC Section 1091, the wash sale rule technically applies to "stock or securities." Through the 2024 tax year, the IRS had not extended the rule to cryptocurrency, and many investors harvested crypto losses without observing the 30-day window. However, the tax treatment of digital assets continues to evolve, and legislation to extend wash sale rules to crypto has been proposed repeatedly. Check current guidance for your tax year or consult a CPA before assuming the exemption still applies.

What happens if I accidentally trigger a wash sale?

The loss is disallowed for the current tax year, but it is not permanently gone. The disallowed loss is added to the cost basis of the replacement shares. When you eventually sell the replacement shares, that higher basis reduces the gain (or increases the loss) on that future sale. The economic result is the same as if you had never sold -- you just lost the timing benefit of recognizing the loss now.

Can I harvest losses and offset them against income from a job or business?

Only up to $3,000 per year ($1,500 if married filing separately) of net capital losses can be deducted against ordinary income such as wages, salary, or business income. Capital losses first offset capital gains dollar-for-dollar without limit. The $3,000 cap applies only to the excess after all gains have been offset.

Year-End Tax-Loss Harvesting Calendar
Early November
Portfolio Review
Run initial analysis of unrealized gains and losses across all taxable accounts
Mid-November
Identify Candidates
Flag positions with meaningful unrealized losses and evaluate replacement securities
Early December
Execute Trades
Sell losing positions and purchase non-identical replacements to maintain portfolio allocation
December 15-20
Final Review
Last safe window to execute trades with certainty of T+1 settlement before December 31
December 31
Settlement Deadline
All trades must settle by this date to count for the current tax year
### Is there a deadline for tax-loss harvesting?

The sale must settle by December 31 to count for that tax year. Stock trades typically settle in one business day (T+1), so executing the trade on the last business day of December usually works. But mutual fund trades and certain international securities may settle on a different schedule. Do not wait until December 31 to start evaluating your portfolio -- run the analysis in early to mid-December to leave room for execution and any needed adjustments.