Tax Swaps: How They Work and the Wash Sale Rules

A tax swap is when you sell an investment that has dropped below what you paid, immediately buy a similar (but not identical) investment to keep your market exposure, and claim the realized loss on your tax return. Done right, you walk away with a deductible capital loss and a portfolio that still looks the way you want it to. Done wrong, the IRS disallows the loss under the wash sale rule and you get nothing for the trouble.

How the Swap Works

You sell a security at a loss. Within the same trading session, you buy a different security that gives you similar market exposure. The replacement has to track a comparable asset class or segment so your allocation stays intact, but it has to be different enough that the IRS doesn’t treat it as the same investment.

A common example: you hold a small-cap ETF tracking the Russell 2000, and it’s underwater. You sell it and buy an ETF tracking the S&P SmallCap 600. Both give you U.S. small-cap exposure, but the two indices use different selection criteria and hold different companies. That distinction is what makes the swap work.

What the Realized Loss Is Actually Worth

Realized losses first offset any capital gains you took during the same tax year, dollar for dollar, regardless of whether the gain was short-term or long-term. Short-term gains are taxed at ordinary income rates, so offsetting those delivers the biggest per-dollar savings.1Internal Revenue Service. Topic No. 409, Capital Gains and Losses

If your losses exceed your gains for the year, you can deduct up to $3,000 of the net loss against ordinary income like wages or interest. Married filing separately gets a $1,500 cap. Anything beyond those limits carries forward indefinitely to offset future gains or ordinary income.1Internal Revenue Service. Topic No. 409, Capital Gains and Losses

High earners get an extra kick. The 3.8% Net Investment Income Tax applies to capital gains when modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly).2Office of the Law Revision Counsel. 26 USC 1411 – Imposition of Tax Losses that offset gains subject to this surtax save you the capital gains rate plus 3.8%.3Internal Revenue Service. Net Investment Income Tax

The Wash Sale Rule

Section 1091 of the Internal Revenue Code is the guardrail. If you sell a security at a loss and buy something “substantially identical” within 30 days before or 30 days after the sale, the loss is disallowed.4Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities

That gives you a 61-day restricted window: 30 days before the sale, the sale date itself, and 30 days after. The “before” half catches people off guard. Shares of the same fund you bought three weeks ago and then sold at a loss today can retroactively trigger a wash sale on the earlier purchase.5Internal Revenue Service. Publication 550 (2025), Investment Income and Expenses

A wash sale usually doesn’t destroy the loss forever. The disallowed amount gets added to the cost basis of the replacement shares, so when you eventually sell those, your higher basis produces a smaller gain or a larger loss. The tax benefit is deferred, not erased. Your holding period on the original shares also transfers to the replacement.5Internal Revenue Service. Publication 550 (2025), Investment Income and Expenses

There is one situation where the loss really does disappear. If you sell a fund at a loss in your taxable account and buy the same fund in your IRA within the 61-day window, the wash sale triggers, but the disallowed loss cannot be added to the basis of shares held inside a tax-advantaged account. Revenue Ruling 2008-5 confirms the result: the loss is gone. No deferral, no future benefit.6Internal Revenue Service. Revenue Ruling 2008-5, Section 1091

What Counts as Substantially Identical

The IRS uses the phrase “substantially identical” but never fully defines it. Publication 550 says you “must consider all the facts and circumstances in your particular case.”5Internal Revenue Service. Publication 550 (2025), Investment Income and Expenses Most of the real risk in a tax swap lives here.

Individual Stocks

Buying the same company’s stock back is clearly a wash sale. So is buying a convertible bond or preferred stock that converts into shares of the same company, exercising a call option on it, or writing a put that could result in acquiring those shares. Selling Company A and buying Company B is ordinarily not a wash sale, even if both companies are in the same industry.5Internal Revenue Service. Publication 550 (2025), Investment Income and Expenses

ETFs and Mutual Funds

Funds are where things get murky. IRS guidance has historically stated that shares issued by one fund are not ordinarily considered substantially identical to shares issued by another fund. But the IRS has never issued a ruling specifically addressing two index funds from different providers that track the exact same benchmark.

In practice, most tax professionals draw the line at the underlying index. Selling an ETF tracking the S&P 500 and buying another ETF that also tracks the S&P 500 creates real wash sale risk, because the holdings overlap almost entirely even though the funds are separate legal entities. Swapping an S&P 500 tracker for a total U.S. stock market fund is grayer because the indices differ but still overlap significantly. The safest swaps involve genuinely different indices with different construction rules.

Bonds

For individual bonds, the analysis focuses on issuer, maturity, and coupon rate. Swapping bonds from different issuers is safe. Swapping bonds from the same issuer with only slightly different coupons or maturities can be viewed as substantially identical depending on how close the economic terms are.

Picking a Compliant Replacement

The compliance strategy comes down to preserving market exposure without crossing the substantially identical line. A few workable pairings by portfolio slot:

  • Large-cap U.S. equity: sell an S&P 500 ETF and buy a total U.S. stock market ETF, or a large-cap growth or value fund using a different index. Different underlying indices matter, not just different fund providers.
  • Small-cap U.S. equity: swap between a Russell 2000 tracker and an S&P SmallCap 600 tracker. The selection rules differ enough that these are generally treated as distinct.
  • International equity: sell a developed-markets fund tracking the MSCI EAFE Index and buy one tracking the FTSE Developed All Cap ex US Index. Different index families, different constituent lists.
  • Fixed income: sell a total bond market fund tracking the Bloomberg U.S. Aggregate and buy an intermediate-term bond fund using a different benchmark, or swap between government and investment-grade corporate bond funds.

If you want to return to your original holding, wait at least 31 days after the sale date to repurchase. The sale date is day zero; day 31 is the first safe day.4Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities

Traps That Quietly Trigger Wash Sales

The wash sale rule catches more people through carelessness than through intent.

Automatic Dividend Reinvestment

If a fund you’re about to sell at a loss has a dividend reinvestment plan enabled, any dividend that reinvests into that same fund within the 61-day window is a purchase of substantially identical shares and triggers a wash sale. It happens automatically, without you clicking anything. Before the swap, turn off automatic reinvestment on the position you’re selling and on any substantially identical holdings elsewhere.

Purchases Across Accounts

The rule applies across your entire household. Buying shares in a spouse’s account, a joint account, or a retirement account counts. The IRA scenario is the dangerous one, because that’s where the disallowed loss becomes permanent. Investors often watch their taxable brokerage carefully while forgetting the 401(k) or IRA holds the same fund and might be receiving contributions or rebalancing trades in that window.

Options Contracts

Entering into a contract or option to buy substantially identical stock within the 61-day window triggers the rule, even if you never exercise. That includes buying a call on the stock you just sold at a loss, or writing a put that could put those shares back into your account.4Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities

Year-End Timing

Trades must be executed and settled by December 31 to count for the current tax year. Standard equity trades settle in one business day (T+1). If December 31 falls on a weekend, the last settlement date shifts back to the preceding business day. A late-December loss sale also extends the 30-day post-sale window into January, so purchases of substantially identical securities in early January can still disallow the prior-year loss.

Whether the Swap Is Worth It

A tax swap isn’t free. Every round trip involves at least two bid-ask spreads: one on the sale, one on the replacement purchase. If you swap back into the original after 31 days, that’s four spreads total. For highly liquid ETFs, spreads are typically a penny or two per share and don’t matter. For thinly traded ETFs or individual bonds, spreads can eat meaningfully into the benefit.

The question is whether the tax saved on the realized loss exceeds total trading costs. A $5,000 loss at a 24% marginal rate saves roughly $1,200, which trading costs on liquid ETFs won’t touch. A $200 loss at 15% saves $30, and a few wide spreads could wipe that out. Larger losses at higher tax rates make the swap clearly worth it; small losses on illiquid positions often aren’t.

Reporting the Swap

A successful swap generates a realized loss that you report on Form 8949, which feeds into Schedule D.7Internal Revenue Service. Instructions for Form 8949 Your broker generally reports the sale on Form 1099-B with the proceeds and your cost basis. If your records don’t match, Form 8949 is where you make adjustments.

When no wash sale is triggered, the cost basis of your replacement is simply what you paid for it. No basis adjustment is needed. Keep the trade confirmations for both the sale and the replacement purchase, showing dates, tickers, quantities, and prices. Those records demonstrate that the replacement was not substantially identical.7Internal Revenue Service. Instructions for Form 8949

If a wash sale does occur, your broker may flag it with a “W” code on the 1099-B and report both the disallowed loss and the adjusted basis of the replacement shares. If the broker doesn’t catch it, you’re responsible for making the adjustment on Form 8949 yourself: add the disallowed loss to the basis of the replacement shares and report the corrected figures.

A Note on Cryptocurrency

Section 1091 applies to “stock or securities.” Cryptocurrency is taxed as property, not as a security, so the wash sale rule as currently written does not reach digital assets.4Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities Congress has introduced proposals that would extend wash sale treatment to digital assets, and the IRS has expanded transaction reporting through Form 1099-DA. Nothing has passed as of 2026, but the rules could change, and aggressive same-day crypto repurchases designed purely to manufacture deductions may still attract scrutiny under broader doctrines like economic substance.