Skip to main content
All posts

What is the Wash Sale Rule? Definition, Formula, and Example

The wash sale rule is an IRS regulation that disallows claiming a capital loss if you buy the same or substantially identical security within 30 days before or after selling it at a loss.

Plain-English Definition

The wash sale rule is an Internal Revenue Service regulation, codified in IRC Section 1091, that blocks investors from booking a capital loss for tax purposes if they repurchase the same or a substantially identical security within a 61-day window centered on the sale — 30 days before plus 30 days after. The disallowed loss does not vanish; it is added to the cost basis of the replacement shares and recovered when those shares are eventually sold. The rule exists to prevent investors from harvesting artificial tax losses while maintaining identical economic exposure.

How It's Calculated and Triggered

A wash sale occurs when all three conditions hold:

1. You sell stock, an ETF, or an option at a realized loss.

2. Within 30 calendar days before or after that sale, you buy (or enter a contract to buy) the same or a substantially identical security.

3. The purchase is held at the end of the window.

"Substantially identical" covers the same CUSIP, but the IRS has also applied it to equivalent options on the same stock, and to share classes of the same company. Different companies in the same sector are not substantially identical — selling KO at a loss and buying PEP is fine.

Cost-basis adjustment formula:

New basis = Replacement purchase price + Disallowed loss

New holding period = Original purchase date (holding period carries over)

The rule applies across all accounts owned by the same taxpayer, including IRAs and a spouse's accounts — a 2008 IRS ruling (Rev. Rul. 2008-5) confirmed that buying in an IRA after selling in a taxable account triggers a permanent loss of the deduction, because the basis adjustment cannot be applied to IRA shares.

Worked Example

An investor buys 100 shares of AAPL on 2026-01-15 at $200, total cost $20,000. On 2026-03-10 she sells all 100 at $180 for $18,000, booking a $2,000 realized loss.

On 2026-03-25 — 15 days later, inside the 30-day window — she buys 100 shares back at $185, total cost $18,500.

The $2,000 loss is disallowed for the current tax year. Her new cost basis becomes:

$18,500 + $2,000 = $20,500, or $205 per share.

Her holding period also carries over from the January 15 purchase. When she eventually sells at, say, $230, her taxable gain is $230 − $205 = $25 per share — the deferred loss is recovered at that point.

When Traders Use It

Active traders structure year-end tax-loss harvesting around the rule. To realize a loss on QQQ without triggering a wash sale, a common tactic is to sell QQQ and immediately buy a similar-but-not-identical ETF such as VGT or SPY, then switch back after 31 days. Options traders watch it carefully: selling a call at a loss and buying the same-strike call within 30 days is a wash sale; selling a call and buying the stock is not. Crypto is currently exempt, though proposed legislation has targeted this loophole repeatedly.

Limitations and Common Misconceptions

Brokers report wash sales on Form 1099-B only within the same account and the same CUSIP. Losses triggered across two brokers or between a taxable account and an IRA are the taxpayer's responsibility to track — the IRS can still disallow them on audit. The rule does not apply to gains; you can sell at a profit and rebuy the next minute with no consequence. Finally, pattern day traders often accumulate large nominal wash sale adjustments throughout the year that net to zero by December 31 — the year-end position is what matters for tax reporting.

Institutional-grade tools, browser-based.

Get every ticker in this post on a real terminal, scanner, charts, filings, insider trades, and 800K+ economic series in one tab. Free tier, no credit card.

Try Tapeboard free → 14-day Pro trial · no card