What Is the Wash-Sale Rule?

By Laurel Tincher. November 05, 2026 · 9 minute read

This content may include information about products, features, and/or services that SoFi does not provide and is intended to be educational in nature.

What Is the Wash-Sale Rule?

A wash sale occurs when an investor sells a stock or other security at a loss and, within 30 days before or after the sale, buys or acquires the same or a “substantially identical” security. The wash-sale rule is an Internal Revenue Service (IRS) regulation that generally prevents investors from deducting losses on these transactions immediately for tax purposes.

Investors may sell securities at a loss as part of a tax strategy called tax-loss harvesting, which involves using investment losses to offset capital gains. However, if they repurchase the same or a substantially identical security within the wash-sale window, they may not be able to claim the loss as a tax deduction when they expect to.

Understanding the wash-sale rule can help investors account for potential tax consequences when selling securities at a loss.

Key Points

•   The wash-sale rule disallows claiming tax losses if you buy the same or a substantially identical security within 30 days before or after the sale.

•   This regulation generally applies to stocks, bonds, mutual funds, ETFs, and options transactions across your taxable and retirement accounts.

•   Disallowed losses in taxable accounts are typically added to the cost basis of the replacement security, deferring the tax benefit until it is sold.

•   Purchasing replacement securities inside an IRA can result in permanently losing the tax deduction for the original loss.

•   To avoid triggering a wash sale, investors can wait at least 31 days before repurchasing or invest in non-substantially identical assets like broader ETFs.

Which Investments are Subject to the Wash-Sale Rule?

The wash-sale rule applies to most common stocks and securities, including:

•   Stocks

•   Bonds

•   Mutual funds

•   Exchange-traded funds (ETFs)

•   Options and certain other contracts to acquire securities

The rule can also apply to purchases made in an individual retirement account (IRA) or Roth IRA, as well as purchases made by a spouse. Certain securities futures contracts may also be subject to the rule.

The wash-sale rule generally does not apply to commodity futures or foreign currency trades. It also does not apply to sales of securities at a profit. For example, if an investor sells a stock at a gain and buys the same stock within 30 days, the transaction does not trigger a wash sale.

What Happens When You Trigger a Wash Sale?

Investors may sell securities at a loss as part of a tax-loss harvesting strategy, or they may decide to repurchase a security after selling it during a market downturn. The wash-sale rule is intended to prevent investors from claiming a tax deduction for a loss while maintaining substantially the same position in the security.

If an investor triggers a wash sale, the loss generally cannot be deducted immediately or used to offset capital gains on that year’s tax return. Instead, the disallowed loss is typically added to the cost basis of the replacement security, which can defer the tax benefit until the replacement security is sold.

There is an important exception: If an investor sells a security at a loss in a taxable account and purchases a substantially identical security in an IRA or Roth IRA within the wash-sale window, the loss is disallowed, but it generally is not added to the IRA’s cost basis. This means the tax benefit may be permanently lost.

The wash-sale rule can also apply if one spouse sells a security at a loss and the other spouse purchases a substantially identical security within the applicable window.

Understanding these rules can help investors account for potential tax consequences when making investment decisions. Investors with questions about how the wash-sale rule applies to their circumstances may want to consult a tax professional.

Avoiding a Wash Sale

The best way to avoid a wash sale is to understand how the rule applies to your transactions and keep track of purchases and sales across your accounts, whether you use a traditional brokerage or prefer online investing. The IRS generally considers a security a wash sale if you sell it at a loss and purchase or acquire the same or substantially identical security within 30 days before or after the sale.

Because the IRS does not provide a simple, universal definition of what makes two securities substantially identical, determining whether a particular transaction triggers a wash sale can be complicated. Investors who use tax-loss harvesting may want to review their transactions carefully and consult a tax professional when they’re unsure about a potential wash sale.

What to Do After Selling an Asset at a Loss

One straightforward way to avoid a wash sale is to wait at least 31 days after selling a security at a loss before purchasing the same or a substantially identical security.

Alternatively, an investor might choose to purchase a different security that provides similar, but not substantially identical, market exposure. However, determining whether two securities are substantially identical can be difficult, so investors may want to consult a tax professional before making the transaction.

Selling a security at a loss can potentially help investors offset capital gains and, subject to applicable limits, some ordinary income. However, if an investor wants to repurchase the same security shortly after selling it, the wash-sale rule may affect the timing or tax treatment of the transaction.

In some cases, selling stock in one corporation and purchasing stock in another corporation may not trigger a wash sale. Similarly, selling a company’s stock and purchasing its bonds may not trigger the rule. However, the tax treatment depends on the specific securities and transaction.

Investing in ETFs or Mutual Funds Instead

Investors who want to maintain exposure to a particular industry or market segment after selling a security at a loss may consider purchasing a different ETF or mutual fund.

For example, an investor who sells an individual technology stock at a loss might consider purchasing a diversified technology ETF. Because the fund holds multiple securities rather than just the stock that was sold, it may not be considered substantially identical to the individual stock. However, this is not a guarantee that the transaction will avoid a wash sale. The IRS considers whether securities are substantially identical, and the analysis depends on the specific investments involved.

Switching between two ETFs or mutual funds can also be complicated. Funds that track the same index or have nearly identical holdings may raise wash-sale concerns, even if they have different names or expense ratios.

Investors considering these transactions may want to review the funds’ underlying holdings and consult a tax professional before making a decision.

Wash-Sale Penalties and Benefits

If a transaction qualifies as a wash sale, the investor generally cannot deduct the disallowed loss immediately to reduce taxable income or offset capital gains. However, when a replacement security is purchased in a taxable account, the disallowed loss is generally added to its cost basis. This adjustment can defer the tax benefit until the replacement security is sold.

For example, suppose an investor purchases 10 shares of a stock for $1,000 and later sells them for $800, realizing a $200 loss. If the investor purchases 10 substantially identical shares for $850 within the wash-sale window, the $200 loss is disallowed.

The investor’s cost basis in the replacement shares becomes $1,050 ($850 purchase price + $200 disallowed loss). If the investor later sells the replacement shares for $1,200, the taxable capital gain would generally be $150 rather than $350, assuming no other adjustments apply.

The holding period of the original security is also generally added to the holding period of the replacement security. This may affect whether a future gain or loss is classified as short-term or long-term for tax purposes.

The treatment differs when the replacement security is purchased in an IRA or Roth IRA. In that case, the disallowed loss generally is not added to the IRA’s cost basis, so the tax benefit may be permanently lost.

The Takeaway

The wash-sale rule applies when an investor sells a stock or other security at a loss and buys or acquires the same or a substantially identical security within 30 days before or after the sale. The rule generally prevents investors from deducting the loss immediately, although the disallowed loss may be added to the cost basis of a replacement security in a taxable account.

Understanding the wash-sale rule can help investors account for potential tax consequences when selling securities at a loss. Because the rule can apply across multiple accounts and involves some uncertainty about what qualifies as substantially identical, investors may want to consult a tax professional when planning transactions.

Tax considerations are one part of managing an investment portfolio, and understanding how different transactions may affect a tax return can help investors make more informed decisions.

Invest in what matters most to you with SoFi Active Invest. In a self-directed account provided by SoFi Securities, you can trade stocks, exchange-traded funds (ETFs), mutual funds, alternative funds, options, and more — all while paying $0 commission on every trade. Other fees may apply. Whether you want to trade after-hours or manage your portfolio using real-time stock insights and analyst ratings, you can invest your way in SoFi's easy-to-use mobile app.

Invest with as little as $5 with a SoFi Active Investing account.

Options involve substantial risk of loss and the possibility an investor may lose the entire amount invested. Before starting options trading, investors should be familiar with the Characteristics and Risks of Standardized Options . TTax implications with options should be considered. Consult your tax advisor to understand any impacts to your taxes.

FAQ

How do I avoid a wash sale?

To avoid a wash sale, you need to wait at least 31 days after selling a security at a loss before purchasing the same or a substantially identical security. You can also consider purchasing a different security that provides similar market exposure but is not substantially identical. Keep in mind that the wash-sale rule applies across relevant accounts, including taxable accounts and IRAs, and can also apply to purchases made by a spouse. Since wash-sale rules can be complicated, you may want to consult a tax professional.

What is the wash-sale rule in the IRS?

The IRS wash-sale rule generally prevents investors from deducting a loss on a security if they purchase or acquire the same or a substantially identical security within 30 days before or after selling it at a loss. The rule is intended to prevent investors from claiming tax deductions for losses while maintaining substantially the same investment position. In a taxable account, the disallowed loss is generally added to the cost basis of the replacement security.

What happens if I sell a wash-sale stock?

If you sell a stock at a loss and trigger the wash-sale rule, you generally cannot deduct the loss immediately on your tax return. If you purchase the replacement stock in a taxable account, the disallowed loss is typically added to its cost basis, which may reduce a future taxable gain or increase a future deductible loss. However, if you purchase the replacement security in an IRA or Roth IRA, the loss generally cannot be added to the account’s cost basis.

What is the downside of a wash sale?

The main downside of a wash sale is that you may not be able to deduct an investment loss when you expected to. In a taxable account, the tax benefit is generally deferred until you sell the replacement security. If you purchase a substantially identical security in an IRA or Roth IRA, the loss may be permanently disallowed. Wash sales can also complicate tax reporting and make it more difficult to plan transactions around tax-loss harvesting.



This content is for educational and informational purposes only. The products, services, or features discussed may not currently be available via the SoFi platform. Any references to third-party products, services, or companies do not constitute an endorsement, recommendation, or solicitation by SoFi. Readers should independently evaluate their options and consider their individual financial needs and circumstances before making any decisions. ©2026 SoFi Technologies, Inc. All rights reserved.
Tax Information: This article provides general background information only and is not intended to serve as legal or tax advice or as a substitute for legal counsel. You should consult your own attorney and/or tax advisor if you have a question requiring legal or tax advice.

SOIN-Q426-082

TLS 1.2 Encrypted
Equal Housing Lender