A guide to staying legal on the wash-sale rule

The IRS hasn't defined the term "substantially identical," leading to gray areas for a popular tax benefit on investments.
The IRS hasn't defined the term "substantially identical," leading to gray areas for a popular tax benefit on investments.
Mathias Reding for Pexels

With markets volatile over the past two years, many investors have been easing some of the pain via a century-old slice of the tax code that provides a generous benefit for losses. But increasingly, that provision comes with a trap.

When an investor sells a losing stock, bond or fund, the loss — defined as the difference between the purchase price and the selling price — can offset the capital gains tax due on other investments, such as profitable stocks and funds that are cashed in and year-end distributions from mutual funds and exchange-traded funds.

The tax benefit lies at the heart of a popular investment strategy known as tax-loss harvesting, and it comes with one big tripwire: In what's known as the wash-sale rule, the Internal Revenue Service prevents investors from taking a deduction when selling a losing security if they fail to wait 30 days before or after the sale to buy the same thing or one that is "substantially identical."

What does "substantially identical" mean? The IRS hasn't defined the term, despite the rule's origin in a 1921 tax code provision and expansion decades later. Which means that amid the explosion of index funds and exchange-traded funds in recent years, many of them tracking the same index, the chances of an investor running afoul of the provision have grown.

"A lot of people just buy and sell, buy and sell, and don't think about the wash-rule sale rule at all," said Dan Herron, the founder of Elemental Wealth Advisors in San Luis Obispo, California. "The only time they think about it is when they get their tax forms and it comes to bite them in the butt at tax time."

'Quite squishy'
Under the tax code, capital losses can offset capital gains dollar for dollar. They're also available to reduce taxes on a broader set of assets. 

If an investor's overall portfolio is down and she doesn't have enough taxable gains, $3,000 of her realized — meaning taken, not solely on paper — losses can offset the taxes owed on ordinary income, such as salaries, and when selling property or cryptocurrencies. And any amount left over can be used to reduce taxes in future years.

Read more: Why it's the perfect time — and potentially the worst — for tax-loss harvesting

That part is clear. But like fraternal twins who look nothing like each other, or identical twins who are radically different individuals, or two unrelated individuals with an uncanny resemblance to each other, "substantially identical" is a term of art, not of science.

The wash-sale rule "is quite squishy," said Roni Israelov, the chief investment officer and president of NDVR, a quantitative investment firm in Boston. "How do you define when something is the same thing or not?"

Under the rule, you can't sell Exxon at a loss, immediately buy it back, then claim the loss as a deduction. But you can replace the stock with Mobil and take the deduction.

Meanwhile, you can sell a municipal bond at a loss, pocket the deduction and immediately buy another bond of similar quality, type and duration from the same issuer. 

Things become less clear with mutual funds and ETFs. Fidelity Investments says it "could also be argued" that selling a mutual fund and replacing it with an ETF that holds basically the same stocks doesn't trip the wash-sale rule, but it doesn't settle the question. 

Meanwhile, BlackRock argues that the risk of violating the wash-sale rule is "lower" for an investor who sells a U.S. small-cap mutual fund and immediately buys a U.S. small-cap ETF.

By contrast, the firm says, the risk of violating the rule is "higher" for an investor who sells a mutual fund or ETF focused on emerging markets and immediately buys a different fund following the same index.

What if you sell an actively managed mutual fund at a loss and buy a passive one with the same strategy? It's possible, but not certain, that move won't trigger the wash-sale rule, J.P. Morgan Private Bank says.

The gray areas get even woolier with index funds that track a single gauge, such as the S&P 500. Two funds may have the exact same holdings but be run by different companies and charge different fees. Does that make them "substantially identical"?

"Some would argue yes, some would argue no," said Israelov. "That one is as close to the line as you can imagine."

'Highly correlated'
The origins of the wash-sale rule date back to 1921, when the IRS sought to prevent investors from gaming the tax system by artificially generating losses — hence that 61-day window on the front end and back end of the sale. And the timeframe isn't restricted to a calendar year, as is the federal tax season. So selling in late December and buying back the same or "substantially identical" thing in the first week of January and trying to the claim the deduction won't fly.

A 1954 change beefed up language in the tax code to include the phrase "substantially identical" but did not define it. In 2008, the IRS raised the stakes for investors, through a notice that securities that aren't identical but "highly correlated" could be considered substantially identical. 

Read more: The most lucrative investment on the tax front? Hint: Not ETFs

Also that year, the agency closed a loophole in which some investors were selling losing stocks in their brokerage accounts then immediately buying them back through their individual retirement accounts or self-directed 401(k)s. In those situations, the IRS harshly ruled that such an investor permanently forfeited use of the loss to legitimately offset gains elsewhere. In 2013, the agency began requiring brokers to report wash sales to the IRS.

Yes. No. Maybe?
Things are also complicated when related parties are involved in the selling and buying. Court cases have found that a married couple can't game the system by having one spouse dump a losing fund while the other buys it back right away in a separate account, even if the couple files separate federal returns. 

But "while you could be inviting an IRS challenge if you proceed in this manner,  you may be able to prevail if you can establish that you and your spouse each made independent decisions to purchase and sell the same security," law firm SFBBG in Chicago says,  calling that "a somewhat risky strategy."

When a loss is disallowed, it gets added to the cost basis of the newly acquired stock. stock. The higher an investor's basis, the less gain there is to ultimately be taxed.

Read more: Who benefits from direct indexing's tax bounty? Probably not you

One industry where the wash-sale rule hasn't caught up is cryptocurrencies. An investor can sell bitcoin at a loss and buy back the notoriously volatile asset the next day, all without triggering the wash-sale rule. Why? Because the IRS considers crypto to be property, not a security. Meanwhile, the investor can deduct a capital loss from the sale.

What if you own stock in a company that makes tractors that's about to be acquired by a much larger company that makes a range of farming machines? While the two companies aren't "substantially identical," they're likely to be considered as such by the IRS, according to Fairmark, an online resource for investment strategies and tax planning and compliance. 

The reason: the two stocks are tied together in such a way that a change in the price of one will be reflected in the price of the other. That linkage falls under the IRS's "high correlation" provision.

For reprint and licensing requests for this article, click here.
Tax Investments Tax planning Index funds Tax code Capital gains taxes
MORE FROM FINANCIAL PLANNING