Tax-Loss Harvesting & the Wash Sale Rule: A Practical Guide

Selling a losing position isn’t only a way to cut further losses — realized losses can also offset capital gains elsewhere, and up to $3,000 of extra loss against ordinary income, per year. This guide covers the mechanics, and the rule that can quietly undo the tax benefit if timed wrong.

Step 1 — Calculate the Loss

Run the position through the stock profit calculator with the actual buy price, sell price, shares, and fees to get the exact dollar loss. A realized loss only counts for tax purposes once the position is actually sold — an unrealized (“paper”) loss on a position still held does nothing for that year’s taxes.

Step 2 — Use the Loss to Offset Gains First

Realized capital losses offset realized capital gains first, matched by category — short-term losses offset short-term gains, long-term losses offset long-term gains, with any remaining excess in one category applied against the other. Only after gains are fully offset does any leftover loss reduce ordinary income, capped at $3,000 per year ($1,500 if married filing separately) under IRS Topic 409, with the remainder carried forward to future tax years.

Step 3 — Understand the Wash Sale Rule Before Rebuying

This is the step that catches people off guard: if the same or a “substantially identical” security is bought within 30 days before or after the loss-generating sale, the loss is disallowed for that tax year under IRS Publication 550’s wash sale rules. The 61-day window (30 days before, the sale day itself, and 30 days after) is wider than most people expect — it’s not just “don’t buy back the same day.”

Sell at a loss:      June 15
Wash sale window:    May 16 – July 15  (30 days before + 30 days after)

Buying the same stock — or a security the IRS considers substantially identical — anywhere in that window disallows the loss.

Step 4 — Know That the Loss Isn’t Necessarily Gone Forever

A disallowed wash sale loss doesn’t just disappear. Per IRS Publication 550, the disallowed amount is added to the cost basis of the newly purchased shares, effectively deferring the tax benefit until those new shares are eventually sold (assuming no further wash sale occurs at that point). This is a deferral, not a permanent loss of the deduction — but it does mean the tax benefit doesn’t land in the year originally intended.

Example:

Sold 100 shares at a $2,000 loss on June 15
Bought 100 shares of the same stock on July 1 (within the 30-day window)
→ $2,000 loss disallowed for this year's taxes
→ $2,000 added to the cost basis of the shares bought July 1

Step 5 — Common Ways to Avoid Triggering It Unintentionally

  • Automatic dividend reinvestment (DRIP) on the same stock during the 61-day window counts as a purchase and can trigger the rule — this is one of the most common accidental triggers, since investors often forget DRIP is still active.
  • Buying in a different account (including an IRA) doesn’t avoid the rule — the wash sale rule applies across all accounts under common ownership, not just the account where the sale happened.
  • Buying a similar-but-different fund (a different S&P 500 index fund from a different provider, for example) is a common way investors intentionally stay invested in the same market segment without triggering the rule, since it isn’t the same or a substantially identical security — though “substantially identical” isn’t rigidly defined for every security type, so this carries some judgment.

Step 6 — Recalculate After Confirming the Rule Doesn’t Apply

Once the 61-day window has passed without a repurchase (or a repurchase happened in a genuinely different security), the loss stands as calculated. Re-run the exact numbers through the stock profit calculator to confirm the dollar loss being reported, and check it against common stock profit calculation mistakes for other reporting errors that show up around loss transactions specifically.

Bottom Line

Tax-loss harvesting is a legitimate, common strategy — but the wash sale rule’s 61-day window (30 days each side of the sale) is wider than most people plan for, and it applies across all accounts under the same ownership, not just the one where the trade happened. Calculate the loss with the stock profit calculator first, confirm no repurchase falls in the window, and remember that even a disallowed loss isn’t wasted — it rolls into the new position’s cost basis instead. For profit, return percentage, and break-even calculated end to end on real trades, see stock profit, return % and break-even worked examples.

References & Sources

  1. [1]
  2. [2]