Skip to main content
Tax-Loss Harvesting

Harvesting and the Wash-Sale Rule

Pomegra Learn

Harvesting and the Wash-Sale Rule

The wash-sale rule is a single IRS regulation that can erase the entire tax benefit of a harvested loss if you're not careful. It prevents investors from harvesting losses while keeping the same economic exposure—a form of "tax avoidance" the IRS wants to block. Understanding the rule's mechanics, the 30-day window, the definition of "substantially identical," and how to navigate it with replacement securities is essential to successful harvesting.

Quick definition: The wash-sale rule disallows a capital loss if you buy a substantially identical security within 30 days before or 30 days after selling at a loss; violating it defers the loss and adds it to the new purchase's cost basis.

Key takeaways

  • The wash-sale window is 61 days total: 30 days before the sale, the sale date itself, and 30 days after
  • "Substantially identical" means the same security (same CUSIP), not merely similar holdings or overlap
  • A violation defers the loss indefinitely and adds it to the replacement security's cost basis
  • The rule applies to mutual funds, ETFs, stocks, and bonds but not commodities or real property
  • Replacement securities must differ in ticker, fund family, or index methodology to safely avoid the rule

The 30-day window: before and after

The wash-sale rule prohibits buying a "substantially identical" security within 30 days before or after the sale at a loss. This creates a 61-calendar-day window during which you cannot repurchase the same security:

  • 30 days before the sale: If you sell at a loss on December 15, you cannot have bought the identical security between November 15 and December 14.
  • 30 days after the sale: If you sell on December 15, you cannot buy the identical security between December 15 and January 14.

The rule applies to both taxable and tax-deferred accounts (a spouse's IRA, for example). It also applies to community property if you're married; coordinate with your spouse to avoid inadvertent violations.

Example timeline:

November 15: Window opens (cannot buy identical security)
November 20: You buy VTI by coincidence; wash-sale risk now active
December 15: You sell VTI at a loss (violation occurs retroactively)
December 16: Wash-sale loss now disallowed; cost basis of new purchase adjusted
January 14: Window closes; you can safely repurchase identical security
January 15: Window expires; safe to buy back VTI without wash-sale consequences

If you violate the rule, the loss is disallowed for tax purposes, and the disallowed loss is added to the cost basis of the replacement security. This defers the tax benefit indefinitely—you'll eventually recognize it if and when you sell the replacement at a different time, but the benefit shifts to the future and is no longer useful for this year's taxes.

Substantially identical: the CUSIP test

The IRS defines "substantially identical" conservatively. Two securities are substantially identical if they are the same security—same CUSIP (Committee on Uniform Security Identification Procedures) number. This means:

  • The same stock by ticker is the same security. Selling Apple (AAPL) at a loss and buying Apple (AAPL) again within 30 days violates the rule. You cannot escape it by buying shares in a different brokerage or under a different name.
  • Different share classes of the same company are different securities. Berkshire Hathaway Class A (BRK.A) and Class B (BRK.B) have different CUSIPs and are not substantially identical.
  • The same fund by different tickers is the same security. If you sell an Investor Share class of a mutual fund at a loss, buying an Admiral Share (or Institutional Share) class of the same fund violates the rule if they have the same CUSIP. However, most fund families issue different CUSIPs for different share classes, so check your broker's documentation.
  • Different index funds tracking the same index are not the same security. Vanguard Total Stock Market Index (VTI) and SPDR Portfolio U.S. Total Stock Market Index (SPLG) track the same index but have different CUSIPs and different holdings (due to fund methodology). The IRS considers them different securities, so trading one for the other avoids the wash-sale rule.

How to safely select replacement securities

The safest strategy is to replace a harvested position with a security that is objectively not substantially identical:

1. Different fund family, same index

Sold (Loss)Replacement (Safe)
Vanguard Total Market (VTI)Schwab U.S. Broad Market (SWTSX)
iShares Core S&P 500 (IVV)Vanguard S&P 500 ETF (VOO)
Fidelity NASDAQ-100 (FXAIX)Invesco QQQ Trust (QQQ)
Vanguard Developed Markets (VEA)iShares MSCI EAFE (EFA)

2. Different index, same asset class

If you want to stay in the same broad asset class but avoid a specific index, you can harvest and replace within category:

Sold (Loss)Replacement (Safe)
S&P 500 ETF (IVV)Total U.S. Market ETF (VTI) — includes small-caps
Dividend Aristocrats (NOBL)High Dividend Yield ETF (VYM)
Developed Markets (EFA)Emerging Markets (EEM) — different region
Investment-Grade Bonds (BND)Corporate Bond Fund (LQD) — different type

3. Sector or strategy overlap

For more niche positions, you can rotate within a sector or strategy:

Sold (Loss)Replacement (Safe)
Tech XLK (Utilities excluded)Tech XLV + IYW (broader tech)
Growth Stock FundValue Stock Fund
High-Yield Bond FundIntermediate Bond Fund

4. Individual stocks: companion holdings

If you own individual stocks, you can harvest a loss and buy a sector ETF or diversified portfolio:

Sold (Loss)Replacement (Safe)
Intel (INTC)Technology Sector ETF (XLK or IYW)
General Motors (GM)Automotive/Industrial ETF or S&P 500 ETF
Dividend StockDividend ETF or Broad Market ETF

Real-world wash-sale traps

Trap 1: Automatic dividend reinvestment (DRIP)

You sell a dividend ETF at a loss on December 1 and buy a replacement on December 2. But the original ETF's dividend ex-date is December 15—it distributes cash on December 20. If your account is enrolled in automatic dividend reinvestment (DRIP), the dividend is automatically reinvested in the same original ETF on December 20, creating a wash-sale violation. You've inadvertently bought the identical security within 30 days of selling it at a loss.

Solution: Before harvesting a position that pays a dividend near year-end, turn off DRIP in that position or temporarily disable it. Reinvest dividends manually only after the 30-day window closes.

Trap 2: Scheduled contributions or automatic investments

If you participate in automatic monthly contributions (e.g., 401(k) automatic investing, automatic IRA contributions, or regular scheduled purchases), you may inadvertently buy a security you recently sold at a loss.

Example: You harvest a loss by selling your $10,000 employer stock position on November 15. On the 15th of every month, your employer deposits $1,500 in company stock. December 15 arrives, and $1,500 is deposited. Wash-sale violation.

Solution: Before harvesting, check your automatic investment schedule. Pause automatic contributions to the harvested security during the 30-day window, or change the automatic purchase to a different security.

Trap 3: Spouse's trades in community property or jointly filed returns

The wash-sale rule applies to your spouse's trades if you file jointly, regardless of whose account the positions are in. If you harvest a loss in your taxable account and your spouse buys the same security in her account within 30 days, the violation applies to your loss.

Solution: Inform your spouse of your harvesting plans, especially in December. Coordinate account activity to avoid inadvertent violations.

Trap 4: Fund mergers or name changes

If a fund is acquired or renamed, and your broker issues a new CUSIP, it's technically a different security for wash-sale purposes. However, the IRS may scrutinize this closely if the fund is substantially the same in fact. Avoid this complexity by replacing a harvested fund with a truly different fund, not by attempting to rely on a merger or name change.

Trap 5: Fund share-class conversions

Some brokerages automatically convert share classes of the same fund (e.g., Investor Shares to Admiral Shares). If the conversion happens within the 30-day window of a harvested loss, it may trigger a wash-sale violation depending on whether the CUSIP changed. Check your broker's specific rules.

Solution: Review your statements carefully after a harvest. If a share-class conversion occurs, confirm with your broker whether a new CUSIP was issued. If not, contact the broker and request that the conversion be delayed until after the 30-day window closes.

Before harvesting a loss, verify the following:

  1. Identify the security: What is the exact ticker and CUSIP of the position you're harvesting?
  2. Select a replacement: Choose a replacement with a different CUSIP (different fund family, different index, or different asset class).
  3. Check upcoming dividends: Are there dividend ex-dates or distributions in the next 30 days for either the harvested or replacement security?
  4. Disable DRIP: If dividends will be paid, turn off automatic reinvestment in both positions.
  5. Review automatic contributions: Are you enrolled in automatic monthly purchases of the harvested security? Pause them for 30 days.
  6. Coordinate with your spouse: Inform her of the harvest and the 30-day window to avoid inadvertent purchases.
  7. Execute the sale and purchase: Sell first, then immediately buy the replacement (same day or next business day).
  8. Document the trade: Save the brokerage statements and any receipts confirming the sale date, replacement date, and tickers.
  9. Monitor for 30 days: Watch for any automatic transactions, dividend reinvestments, or account activity that might violate the rule.
  10. Mark your calendar: 31 days after the sale, you can safely repurchase the original security if desired.

FAQ

Can I sell a position at a loss and buy a nearly identical fund (different ticker but same holdings)? Generally yes, if the funds have different CUSIPs. However, if the IRS perceives the funds as substantially identical in substance (not just CUSIP), it could challenge the harvest. The safest approach is to choose a replacement with objectively different holdings or methodology (different index, different asset class, different fund family).

What if I inadvertently violate the wash-sale rule? The loss is disallowed for the current year. The disallowed loss is added to the cost basis of the replacement security. If you later sell the replacement at a gain, the inflated cost basis reduces your taxable gain. The loss isn't lost forever; it's deferred.

Does the wash-sale rule apply to losses in my IRA or 401(k)? No. Tax-deferred accounts don't report gains or losses to the IRS, so the wash-sale rule doesn't apply inside them. However, it applies between a taxable account and a tax-deferred account if you have both. Selling a loss in a taxable account and buying the same security in your IRA within 30 days violates the rule (applies to the taxable account loss).

How do I know if two funds have the same CUSIP? Ask your broker or look up the CUSIP on the SEC's EDGAR database or your fund's prospectus. Most brokerages also show the CUSIP on your statements. When in doubt, call your broker and ask, "Are the CUSIPs different?"

If I sell a position at a loss and the price drops further, do I regret harvesting? No. The harvested loss is already realized and deductible. You've separated the tax benefit from the investment exposure. If you bought a replacement security, you maintain the economic exposure and benefit from any recovery. You're not worse off because of the harvest.

Can I harvest a loss in one account and buy the same security in another account? No. The wash-sale rule applies across all your accounts (and your spouse's in community property or joint-filing states). If you sell a security at a loss in your taxable brokerage account, you cannot buy it in your workplace 401(k), spouse's IRA, or any other account within 30 days.

Is there a statute of limitations on wash-sale violations? No. The IRS can challenge a wash-sale violation in any year, even many years after the fact. Maintain records of all harvested losses and replacements indefinitely.

Summary

The wash-sale rule disallows a capital loss if you buy a substantially identical security (same CUSIP) within 30 days before or after the sale. The rule applies across all your accounts and affects mutual funds, ETFs, stocks, and bonds. Avoiding the rule requires choosing a replacement security with a different CUSIP (different fund family, different index, or different asset class), disabling dividend reinvestment near the 30-day window, pausing automatic contributions, and coordinating with your spouse to prevent inadvertent violations. Careful planning and documentation ensure the harvested loss is deductible and not deferred indefinitely.

Next

Finding Replacement Securities