A tax swap is a simple move with a tricky rulebook: you sell an investment that’s down, immediately buy a different-but-similar one, and claim the loss on your taxes without ever leaving the market. The rulebook is Section 1091 of the Internal Revenue Code, the wash sale rule, which disallows the loss if what you buy is “substantially identical” to what you sold within a 61-day window around the sale. Get the replacement right and you keep both the deduction and your market exposure. Get it wrong and the IRS strips the deduction, sometimes permanently.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities
How a Tax Swap Works
You sell a security trading below your cost basis and, in the same session, buy a different security that gives you similar market exposure. The sale realizes a loss the IRS lets you deduct. The replacement keeps your dollars invested so you don’t miss a rebound while sitting in cash.
Say 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 small-cap U.S. equity exposure, but the two indices use different selection criteria and hold different companies. That distinction is what makes the swap compliant.
What the Loss Is Actually Worth
Realized losses first offset realized capital gains from 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.2Internal Revenue Service. Topic No. 409, Capital Gains and Losses
If your losses exceed your gains, you can deduct up to $3,000 of the remaining net loss against ordinary income such as wages or interest. The cap is $1,500 if you’re married filing separately. Anything beyond that carries forward indefinitely to offset gains or ordinary income in future years.2Internal Revenue Service. Topic No. 409, Capital Gains and Losses
High earners should factor in the 3.8% Net Investment Income Tax, which applies to capital gains when modified adjusted gross income exceeds $200,000 for single filers or $250,000 for joint filers.3Office of the Law Revision Counsel. 26 USC 1411 – Imposition of Tax Harvesting losses against gains subject to that surtax saves the capital gains rate plus 3.8%, which tilts the math noticeably further in your favor.4Internal Revenue Service. Net Investment Income Tax
The Wash Sale Rule You Have to Beat
Section 1091 disallows a loss if you buy a substantially identical security within 30 days before or 30 days after the sale. Count the sale date itself and you get a 61-day restricted window.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities
The “before” half trips people up. If you bought shares of the same fund three weeks ago and sell at a loss today, those earlier shares can retroactively trigger the wash sale.5Internal Revenue Service. Publication 550 (2025), Investment Income and Expenses
A triggered wash sale usually defers the deduction rather than destroying it. The disallowed loss gets added to the cost basis of the replacement shares, so when you eventually sell those shares your higher basis produces a smaller gain or larger loss.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities Your holding period on the original shares also carries over to the replacement, which can matter for whether a future gain qualifies as long-term.5Internal Revenue Service. Publication 550 (2025), Investment Income and Expenses
The IRA Trap That Makes the Loss Permanent
The rule reaches across all your accounts, including retirement accounts. If you sell a fund at a loss in your taxable brokerage and buy the same fund inside your IRA within the window, you’ve triggered a wash sale. And because an IRA is tax-advantaged, the disallowed loss cannot be added to the basis of the IRA shares. Revenue Ruling 2008-5 confirmed this. The loss simply disappears, with no future recovery.6Internal Revenue Service. Revenue Ruling 2008-5, Section 1091
What “Substantially Identical” Actually Means
This is where the IRS gives the least guidance and where most swap decisions are made. Publication 550 tells you to “consider all the facts and circumstances in your particular case,” which is less a rule than a warning.5Internal Revenue Service. Publication 550 (2025), Investment Income and Expenses
Individual Stocks
Buying back the same company’s stock is clearly a wash sale. So is buying a convertible bond or preferred stock that converts into the same company’s shares, exercising a call option on it, or writing a put option that could put the shares back on you. Selling Company A and buying Company B is ordinarily not a wash sale, even if the two compete in the same industry.5Internal Revenue Service. Publication 550 (2025), Investment Income and Expenses
ETFs and Mutual Funds
IRS guidance has historically said that shares issued by one fund are not ordinarily considered substantially identical to shares issued by another fund. The IRS has never issued a ruling specifically on two index funds from different providers tracking the same benchmark.
In practice, most tax professionals draw the line at the underlying index. Selling an S&P 500 ETF and buying a different S&P 500 ETF creates real wash sale risk, because the holdings overlap almost entirely even though the funds are separate legal entities. Selling an S&P 500 tracker and buying a total U.S. stock market fund is grayer, with substantial but not complete overlap. The safest swaps use genuinely different indices built with different methodologies.
Bonds
For individual bonds, the analysis turns on issuer, maturity, and coupon. A 10-year municipal bond from one state swapped for an 11-year muni from another state is clearly compliant: both the obligor and the maturity differ. Corporate bonds from different companies are likewise safe. The risky move is swapping bonds from the same issuer with only slight differences in coupon or maturity.
Picking a Compliant Replacement
The job is to preserve your market exposure without crossing the substantially identical line. Some common pairings:
- 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 tracking a different index.
- Small-cap U.S. equity: swap between a Russell 2000 tracker and an S&P SmallCap 600 tracker.
- International developed equity: sell a fund tracking MSCI EAFE and buy one tracking FTSE Developed All Cap ex US.
- Fixed income: sell a total bond 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 your plan is to return to the original holding after the swap, wait at least 31 days after the sale. The sale date is day zero; day 31 is the first safe day to repurchase.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities
Mistakes That Quietly Trigger a Wash Sale
Careless investors trigger the rule more often than aggressive ones do. A few recurring patterns:
Automatic Dividend Reinvestment
If a dividend reinvestment plan is active on a fund you sell at a loss, any dividend that reinvests within the 61-day window buys substantially identical shares and triggers a wash sale. The purchase happens automatically. Before harvesting a loss, turn off reinvestment on the position being sold and on any identical holdings in your other accounts.
Purchases in Other Accounts
The rule covers your whole household. A purchase in a spouse’s account, a joint account, or a retirement account counts. The IRA version is the worst-case scenario because the disallowed loss becomes permanent. Investors often focus on their taxable brokerage and forget that a 401(k) or IRA holding the same fund can wreck the swap through routine contributions or rebalancing.
Options Contracts
Entering a contract or option to buy substantially identical stock within the window triggers the rule, even if you never exercise it. Buying a call on the stock you just sold, or writing a put that could force you to acquire the shares, is enough.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities
Year-End Timing
A loss has to be realized and settled by December 31 to count for that tax year. A sale in late December also stretches the 30-day post-sale window into January, so a January purchase of a substantially identical security can still disallow the prior-year loss.
Side Effects Worth Knowing
Qualified Dividend Holding Period Resets
For a dividend to qualify for the lower long-term capital gains rate rather than ordinary income rates, you must hold the paying stock more than 60 days during the 121-day period beginning 60 days before the ex-dividend date.7Internal Revenue Service. IRS Gives Investors the Benefit of Pending Technical Corrections on Qualified Dividends When you buy a replacement, that clock starts fresh. If the replacement pays a dividend soon after you buy it, that dividend may not qualify. For broad index ETFs paying quarterly, this rarely matters in practice, but check ex-dividend dates on high-yield positions before you swap.
Trading Costs
Every round-trip trade pays at least two bid-ask spreads: one on the sale, one on the replacement purchase. If you later swap back into the original, that’s four spreads. For liquid broad-market ETFs, spreads of a penny or two are trivial next to the tax savings. For thinly traded ETFs or individual bonds, spreads can eat the benefit.
The question is whether the tax saved exceeds the trading costs. A $5,000 loss at a 24% marginal rate saves about $1,200, which liquid-ETF spreads will not touch. A $200 loss at 15% saves $30, which a few wide spreads can erase. Bigger losses and higher rates make the math obvious; small losses on illiquid positions often aren’t worth the effort.
Reporting the Swap
A clean swap generates a realized loss you report on Form 8949, which feeds Schedule D.8Internal Revenue Service. Instructions for Form 8949 Your broker will generally report the sale on a 1099-B with proceeds and cost basis. If your records don’t match, Form 8949 is where you reconcile them.
Because no wash sale occurred, the cost basis of your replacement is simply what you paid. No adjustment needed. Keep your trade confirmations for both the sale and the replacement purchase, with dates, tickers, quantities, and prices, so you can show the replacement wasn’t substantially identical.8Internal Revenue Service. Instructions for Form 8949
If a wash sale happens anyway, your broker may flag it with a “W” code on the 1099-B, reporting both the disallowed amount and the adjusted basis of the replacement shares. If the broker doesn’t catch it, you make the adjustment yourself on Form 8949, adding the disallowed loss to the basis of the new shares.
A Note on Cryptocurrency
Section 1091 applies to “stock or securities,” and cryptocurrency is taxed as property rather than as a security. As a result, an investor can currently sell a digital asset at a loss and repurchase the identical asset immediately without triggering a wash sale.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities Congress has introduced proposals to extend wash sale treatment to digital assets. None has passed as of 2026, but aggressive same-day repurchase strategies designed only to manufacture deductions could still draw IRS scrutiny under broader doctrines such as economic substance, and any legislative change could apply to the full tax year in which it’s enacted.