Every investor has positions that are underwater at some point. Most people just wait and hope the price recovers. Smart investors do something different: they sell the losing position, lock in the tax deduction, and immediately reinvest in a similar asset to maintain their market exposure. This is tax-loss harvesting, and it can save you thousands of dollars every single year.

The concept is simple. The execution requires knowing a few key rules, especially the wash sale rule that trips up most beginners. This guide covers everything you need to know to start harvesting losses effectively.

How Tax-Loss Harvesting Works

When you sell an investment at a loss in a taxable brokerage account, the IRS lets you use that loss to offset capital gains. If your losses exceed your gains in a given year, you can deduct up to $3,000 of the excess against your ordinary income. Any remaining losses carry forward to future tax years indefinitely.

Here is the key insight: you do not have to leave the market. You sell the losing position and buy a different but similar investment. Your portfolio stays roughly the same, your market exposure is maintained, but you have generated a tax deduction out of thin air.

A quick example

You bought $50,000 of a total US stock market fund (VTI) earlier this year. The market drops 15%, and your position is now worth $42,500. You have a $7,500 unrealized loss.

At a 24% marginal tax rate, that $3,000 deduction saves you $720. The carried-forward $4,500 saves you more in future years. And your investment portfolio is still positioned to capture the recovery. Run your own numbers with our Tax-Loss Harvesting Calculator.

The Wash Sale Rule: The One Rule You Cannot Break

The IRS is fine with tax-loss harvesting. What they do not allow is selling at a loss and buying back a "substantially identical" security within 30 days before or after the sale. This is the wash sale rule, and violating it means your loss is disallowed.

The 30-day window applies in both directions. If you buy the replacement security within 30 days before the sale, or 30 days after, the loss is disallowed. This creates a 61-day total window (30 days before + sale day + 30 days after).

What counts as "substantially identical"?

Safe swap pairs: VTI (Total US Market) to VOO (S&P 500). VXUS (Total International) to IXUS (iShares International). BND (Total Bond) to AGG (iShares Aggregate Bond). Different index, different provider, same broad exposure.

When to Harvest Losses

The best time to look for harvesting opportunities is not December, despite what most articles tell you. The best time is throughout the year, whenever a position drops meaningfully. Here is why:

See how much tax-loss harvesting could save you

Use our free calculator to estimate your annual tax savings from harvesting losses, based on your portfolio size and tax bracket.

Try the Tax-Loss Harvesting Calculator

Step-by-Step: How to Execute a Tax-Loss Harvest

Step 1

Identify Positions with Unrealized Losses

Review your taxable brokerage accounts for any positions currently trading below your cost basis. Focus on individual tax lots, not just the overall position. You might have some lots at a gain and others at a loss.

Important: Tax-loss harvesting only works in taxable accounts. Losses in your 401(k), IRA, or Roth IRA have no tax impact and cannot be harvested.

Step 2

Choose Your Replacement Investment

Before you sell, decide what you will buy. The replacement should:

Step 3

Sell the Losing Position Using Specific Lot Identification

When selling, use "specific lot identification" (SpecID) rather than the default FIFO (first in, first out) method. This lets you select exactly which tax lots to sell, maximizing your harvested loss. Most brokers support this in their trade settings.

Step 4

Buy the Replacement Immediately

Place the buy order on the same day, ideally within minutes. You want to minimize the time you are out of the market. Even one day out can mean missing a 2% recovery that wipes out the tax benefit.

Step 5

Wait 31 Days Before Swapping Back (If Desired)

After 31 days, you can sell the replacement and buy back your original fund if you prefer it for the long term. Many investors just keep the replacement permanently, since the broad exposure is similar enough that the difference does not matter.

The Real Dollar Impact

How much can tax-loss harvesting actually save? Let us look at a realistic scenario over 20 years.

Assume you have a $500,000 taxable portfolio. In an average year, you find 3-5% of the portfolio in harvestable losses (market volatility creates this naturally). That is $15,000 to $25,000 in harvested losses per year.

That is $70,000 to $120,000 in additional wealth from a strategy that takes maybe 30 minutes per quarter to execute. The returns on your time are exceptional.

Advanced Strategies

Pair harvesting with Roth conversions

If you harvest $20,000 in losses, you can convert $20,000 from a traditional IRA to a Roth IRA and pay zero additional tax. The loss offsets the conversion income. This is one of the most powerful combinations in tax planning, allowing you to shift money into tax-free accounts at no cost. Use our Roth Conversion Calculator to find your optimal annual conversion amount.

Harvest across accounts

The wash sale rule applies across all your accounts, including your spouse's accounts. If you sell VTI at a loss in your taxable account, your spouse cannot buy VTI in their taxable account within 30 days. Similarly, if your 401(k) automatically buys a fund that is substantially identical to what you just sold at a loss, it can trigger a wash sale. Review all accounts before harvesting.

Use losses to offset concentrated stock gains

If you are selling employer stock (RSUs, stock options, ESPP shares), the gains can be substantial. Harvested losses are the perfect offset. Plan your stock sales and loss harvesting together for maximum tax efficiency.

Common Mistakes

1. Triggering wash sales accidentally

The most common mistake is having automatic dividend reinvestment (DRIP) enabled. If you sell a fund at a loss and your DRIP buys more shares of the same fund 10 days later, that is a wash sale. Turn off DRIP for any fund you might harvest.

2. Harvesting in retirement accounts

Losses in a 401(k) or IRA are invisible to the tax code. Selling at a loss inside these accounts does not generate a deduction. Only harvest in taxable brokerage accounts.

3. Letting the tax tail wag the investment dog

Do not hold a losing investment just because you want to harvest the loss later. If the investment thesis is broken, sell it and take the loss now. The tax benefit is a bonus, not the reason to invest.

4. Forgetting to track cost basis adjustments

When you swap from one fund to another, your new cost basis is the purchase price of the replacement fund. If you swap back after 31 days, keep careful records. Your broker tracks this for securities they hold, but if you move between brokers, basis information can get lost.

Track cost basis and gains across all your accounts

Optionality pulls in your positions from every brokerage account and gives you a unified view of gains, losses, and tax optimization opportunities.

Get started free