SoftPak
Home/Resources/Blogs/Wash Sale: Definition, How the Rule Works, and How to Avoid It
BLOG

Wash Sale: Definition, How the Rule Works, and How to Avoid It

Naaz ScheikNaaz Scheik· November 19, 2026
Wash Sale: Definition, How the Rule Works, and How to Avoid It

You sold a losing stock to trim your tax bill, then bought it back two weeks later. Smart move? Not quite. A wash sale happens when you sell a security at a loss and buy the same or a substantially identical one within 30 days before or after the sale. The Internal Revenue Service (IRS) then blocks that capital loss for the year. Here’s how the wash sale rule works, what triggers it, and how to stay clear.

Key Takeaways

  • A wash sale is a loss sale paired with a purchase of a substantially identical security within a 30-day window before or after the sale.
  • The wash sale rule covers a 61-day stretch in total, and it applies to stocks, options, contracts, and other securities.
  • The loss isn’t gone for good. It usually gets added to the cost basis of the replacement shares, so you get the credit later.
  • Wash sales aren’t illegal, but they can quietly raise your tax liability.
  • Buying in an individual retirement account (IRA) or through a spouse can trigger the rule too.

What Is a Wash Sale?

What Is a Wash Sale?

Before getting into mechanics, it helps to see the idea in plain language, because the rule is easier to follow once you know what it’s trying to stop.

Wash Sale Definition: Understanding Wash Sales

A wash sale is a strategy in which an investor realizes a loss by selling an asset, then buys a comparable asset within a 30-day window to help lower their tax bill. The rule exists because of exactly that move. The IRS instituted the wash sale rule to prevent taxpayers from using the practice to reduce their tax liability without really changing their position. 

In short, investors who sell a security at a loss cannot claim it if they bought the same or a similar security within 30 days, before or after the sale. The rule applies to stocks, contracts, options, and all other types of securities and trading.

Why the IRS Created the Wash Sale Rule

Here’s the backstory. Many countries’ tax laws allow investors to claim a specific amount of capital losses as an income reduction. In the United States (U.S.), you can use losses to offset capital gains, and if losses exceed gains, you can deduct up to $3,000 of the remainder against other income each year, per IRS Topic 409. Anything beyond that can be carried forward into later years.

That created a loophole. Investors figured they could sell a losing security, claim the capital loss to reduce their tax bill, and buy a substantially similar one right away. Their portfolio looked the same, but their taxes looked smaller. The wash sale rule closes that door to prevent the abuse of this incentive.

How Does the Wash Sale Rule Work?

Now that the purpose is clear, let’s walk through the moving parts, starting with the three steps that make up a typical wash sale.

The Three Parts of a Wash Sale

Generally, a wash sale has three parts:

  • Step 1: The losing position. An investor notices they are in a losing position, so they close it by selling the stock or exiting a trading position.
  • Step 2: The claimed loss. The sale creates a realized loss that, in theory, they can claim on their tax returns as a reduction of their earnings for that year.
  • Step 3: The quick repurchase. The investor buys the security back at or below the price at which they sold it. If that purchase happens 30 days before or after the sale, it’s a wash sale and the loss can’t be claimed.

Is a Wash Sale Window 30 or 60 Days?

This is the question people ask most. The short answer: it’s both, depending on how you count. The rule looks at 30 days before the sale and 30 days after the sale. Add the sale date itself and you get a 61-day window, which is why you’ll sometimes see it called a 60-day window. Either way, the rule is symmetrical.

That “before” half trips people up. If you bought more shares of the same stock three weeks ago and then sell the older lot at a loss today, you may already have a wash sale. Count calendar days, too. Weekends and holidays don’t pause the clock.

Wash Sale Example: What It Looks Like With Real Numbers

Numbers make the rule click, so here are two quick scenarios. The first shows why investors care. The second shows what happens to the loss afterward.

Example 1: How a Loss Lowers Your Tax Bill

Say you have a $15,000 capital gain from the sale of ABC stock. If you fall in the highest tax bracket, you’d owe a 20% capital gains tax of $3,000. 

Now suppose you also sold XYZ security for a loss of $7,000. Your net capital gain for tax purposes would be $15,000 − $7,000 = $8,000, so you’ll have to pay only $1,600 in capital gains tax. 

The realized loss on XYZ reduces the gain on ABC and trims your tax bill by $1,400.

But if you repurchase XYZ stock, or a stock substantially identical to XYZ, within 30 days of the sale, the loss is not allowed to offset any gains. Your tax bill goes right back to $3,000 for that year.

Example 2: What Happens to the Disallowed Loss

Now a smaller case. You buy 100 shares at 50(5,000), sell them at 40(4,000), and buy 100 shares back at 42(4,200) three weeks later. The $1,000 loss is disallowed for now, but it’s added to the cost basis of the new shares, which becomes $5,200. If you later sell at 55(5,500), your taxable gain is $300 instead of $1,500. The loss didn’t vanish. It just moved.

Scenario

Sale result

Repurchase

Loss claimed this year?

Sell at loss, rebuy same stock after 31+ days

$1,000 loss

Day 32

Yes

Sell at loss, rebuy same stock in 3 weeks

$1,000 loss

Day 21

No (wash sale)

Sell at loss, buy a different company’s stock

$1,000 loss

Day 1

Yes

Buy more shares 10 days before selling a lot at a loss

$1,000 loss

Day −10

No (wash sale)

What Triggers the Wash Sale Rule?

Knowing the timing is half the battle. The other half is knowing which purchases count, and that’s where most accidental wash sales come from.

What Counts as Substantially Identical?

The tax code never gives a precise list. Substantially identical means the replacement is basically the same investment, based on the facts and circumstances. Buying the same stock again is the obvious trigger. Buying a call option or contract on it counts too.

The IRS does not ordinarily consider bonds and preferred stock of an issuing company to be substantially identical to the company’s common stock. But there’s a catch. Preferred stock may be considered substantially identical if it’s convertible into common stock without any restriction, has the same voting rights as the common stock, and trades at a price close to the conversion ratio.

What about ETFs? Two funds that track different indexes are usually fine. Two funds tracking the same index from different providers sit in a gray area, so it pays to understand ETF overlap before you pick a swap.

Do IRA Purchases, Spouses, and Other Accounts Count?

Yes, and this is where the rule surprises people. Individual retirement account (IRA) transactions can also trigger the wash sale rule. If shares are sold in a non-retirement account and substantially identical shares are bought in an IRA within 30 days, the investor can’t claim tax losses for the sale. Worse, under Revenue Ruling 2008-5, the basis in the IRA isn’t increased either, so that loss is effectively gone for good.

A spouse’s purchase counts too, and so does a purchase in another brokerage account. Your broker’s 1099-B only tracks activity in one account, so the rest is on you. Firms managing many accounts at once usually handle this with household-level rebalancing, which looks across every account a family owns instead of one at a time.

What Happens to a Wash Sale Loss?

What Happens to a Wash Sale Loss?

It’s natural to assume a disallowed loss is simply lost, so let’s clear that up before moving on.

Cost Basis Adjustment

Any loss realized on a wash sale is not entirely lost. The loss can be applied to the cost basis of the most recently purchased substantially identical security. That increases the cost basis of the purchased securities and reduces the size of any future taxable gains. The investor still receives credit for those losses, but at a later time.

Holding Period Adjustment

The holding period of the wash sale securities is added to the holding period of the repurchased securities. That can matter a lot when you’re qualifying for the 15% favorable tax rate on long-term capital gains, since a longer holding period can push a future sale into long-term territory.

How Do You Report a Wash Sale Loss?

Reporting is mostly paperwork, but errors here are common, so it’s worth being deliberate.

Form 8949 and Your Broker’s 1099-B

Your broker typically flags wash sales on your 1099-B for identical securities in the same account. You then report the transaction on Form 8949, using adjustment code “W” and entering the disallowed amount. Because brokers can’t see your other accounts, check your own records against the 1099-B before you file.

When to Call a Professional

The tax implications for day traders are complex, so it’s best to consult a tax professional if you’re day trading. The same goes for anyone with many accounts, frequent trades, or a mix of taxable and retirement holdings.

How Does Tax-Loss Harvesting Lead to Wash Sales?

How Does Tax-Loss Harvesting Lead to Wash Sales?

This is where the rule hits real portfolios hardest, so let’s connect the dots.

Tax-loss harvesting means selling securities at a loss to offset a capital gains tax liability elsewhere, then buying back a replacement security to maintain the existing portfolio’s overall composition. The objective is to lower your overall tax bill by realizing those losses. But if you’re not careful about how you replace what you sold, you can trigger the wash sale rule. 

How to Avoid a Wash Sale When Harvesting Losses

Investors often look for alternative investments that are similar but not substantially identical. Here are the usual approaches:

  • Wait 31 days. The simplest fix. The risk is missing a rebound while you’re out of the market.
  • Swap into a comparable fund. Sell an S&P 500 fund and buy a total-market fund from a different provider, for example.
  • Switch to a different company. Sell one bank stock, buy another in the same sector.
  • Turn off dividend reinvestment. An automatic reinvestment is a purchase, and it can trigger a partial wash sale.
  • Use security-level tools. Holding the stocks of an index directly through direct indexing gives you far more replacement options than a single fund.

Special Considerations: Day Traders, the U.K., and Crypto

The core rule stays the same everywhere, but a few groups face their own wrinkles, so let’s cover them briefly.

Pattern Day Traders

Those who execute more than four day trades over a five-day period in a margin account are generally treated as pattern day traders, and they may encounter wash sales regularly. Trading the same ticker many times in a month means a lot of overlapping windows. Regulators have been reviewing day-trading rules, so check current requirements with your broker.

U.K. Rules and Bed-and-Breakfasting

The tax rules in the United Kingdom (U.K.) have an implementation similar to the wash sale rule. If an investor buys a security within 30 days before or after selling it, any losses made from that sale can’t be counted against reported income. That’s commonly known as bed-and-breakfasting, and it effectively removes the incentive to do a short-term wash sale.

Crypto

The IRS has generally classified cryptocurrency as property, so the wash sale rule has not applied to it. That gray area has drawn attention from lawmakers, so confirm the current status before you rely on it.

Is It OK to Have Wash Sales?

Short answer: yes, they’re legal. It isn’t illegal to buy a substantially similar security 30 days before or after selling one. You’re just not allowed to deduct any losses from the sale and purchase to offset your taxable income for that year. There’s no fine or penalty, but there is a real tax implication: the loss gets deferred, not used.

So a wash sale can be fine when you want to stay invested and don’t need the deduction this year. It’s a problem when you were counting on that loss to offset gains. That timing gap matters most around year-end, and it feeds into tax drag over the long run.

Wash Sale Rule at a Glance

Here’s a quick reference you can screenshot or share with clients.

Fact

Detail

Window

30 days before + sale day + 30 days after (61 days)

Applies to

Stocks, bonds, mutual funds, ETFs, options, contracts

Tax authority

IRS (U.S.), HMRC-style 30-day rule (U.K.)

Annual loss deduction cap

$3,000 against ordinary income, excess carried forward

Disallowed loss goes to

Cost basis of replacement shares

Long-term capital gains rate in example

15% (20% for highest bracket)

Key ruling for IRAs

Revenue Ruling 2008-5

 

Manage Wash Sale Risks With Smarter Rebalancing

Explore how SoftPak Financial Systems can help simplify portfolio rebalancing and tax management.

Book a call today!

The Bottom Line

A wash sale isn’t illegal, but it can erase the tax benefit you were counting on. The wash sale rule disallows a loss if you buy the same or a substantially identical security within 30 days before or after the sale. The loss moves into your cost basis and holding period, so you get it back later. Understanding and navigating the rule is crucial for tax planning and investment strategy. Track every account, watch IRAs and spouses, and talk to a tax professional when in doubt.

Frequently Asked Questions

It’s an IRS rule that denies your tax loss if you sell a security at a loss and buy the same or a substantially identical one within 30 days before or after the sale.

Naaz Scheik

About Author

Naaz Scheik is the Founder and CEO of SoftPak Financial Systems, leading innovation in financial software solutions and empowering portfolio managers with cutting-edge tools.