Tax-loss harvesting is selling an investment at a loss in a taxable brokerage account to realize a capital loss, then staying invested in a similar—but not identical—holding. The loss can offset capital gains and, within limits, ordinary income. The point is to keep market exposure while improving after-tax results—not to “get out of the market because taxes.”
This is a U.S. federal overview for education. Wash-sale details, state taxes, and your 1099-B lots can get specific. Confirm with IRS Publication 550 and a tax professional when the dollars are large.
When it is worth doing
Harvesting is most useful when all of these are true:
- The asset sits in a taxable account (not a 401(k) or IRA)
- You have an unrealized loss large enough to bother with (after spreads and any trading costs)
- You will stay invested (a replacement purchase), rather than using the sale as an excuse to go to cash
- You can avoid a wash sale
It is especially handy in a year you already realized gains (sold a property piece, rebalanced a taxable account, received a fund capital-gains distribution) or when you want a loss to offset ordinary income up to the annual cap.
Inside a 401(k) or IRA, selling at a loss does not create a deductible capital loss on Form 1040 the same way. Do not “harvest” inside tax-advantaged accounts expecting a 1099 benefit.
How the tax math works
IRS Tax Topic 409 (Capital Gains and Losses) is the official short version: capital losses offset capital gains. If losses exceed gains, you may deduct up to $3,000 of the excess against ordinary income each year ($1,500 if married filing separately), with unused losses carrying forward.
A harvested loss is not “free money.” You usually lower your cost basis in the replacement (because you sold low and bought a cousin fund). You may pay more tax later when you sell the replacement at a gain. The typical benefit is deferral and possible rate shopping (ordinary-income offset this year versus gains later). It is a tactic, not a personality.
The basic sequence
Identify lots with unrealized losses
Use the broker’s tax-lot view, not just the account’s total gain. Specific identification of lots (when the broker supports it) is more precise than average cost.
Sell to realize the loss
Sell the lot(s) you intend to harvest. Keep a record of the trade date and proceeds.
Buy a replacement that keeps your allocation
Same job, different index or a clearly different fund: for example, a total U.S. market ETF replaced with an S&P 500 ETF, or a developed-international fund replaced with a similar but not identical international fund. The goal is to stay invested, as in our index fund framework.
Avoid wash-sale violations
Do not buy a substantially identical security within 30 days before or after the sale—including in an IRA, and including a spouse’s accounts in many cases. Dividend reinvestment can accidentally buy the same ticker.
What “substantially identical” tends to mean in practice
The IRS does not publish a friendly ETF pairing table. Same ticker is the easy “yes, problem.” Two funds that track the same index from the same or different issuers are risky to treat as “different enough.” Two funds that track different indexes (total U.S. market vs S&P 500, or U.S. vs international) are the kind of pair people commonly use to stay invested while arguing they are not substantially identical.
This is not a guarantee. If you need certainty on a large loss, ask a CPA before you trade. “Substantially identical” is a facts-and-circumstances standard, not a ticker-string test.
Turn off automatic dividend reinvestment on the sold ticker through the wash window so a $12 dividend does not buy $12 of the same fund on day 12.
Buying the same security in an IRA around a taxable sale is a classic way to disallow the loss. The IRS has treated IRA acquisitions as relevant to the wash-sale analysis; do not assume retirement accounts are a safe hiding place for the replacement trade.
Hypothetical dollar example
Assumptions: You bought a total U.S. stock ETF for $20,000. It is now worth $16,000 (a $4,000 unrealized loss). In the same year you sold another holding for a $2,500 long-term gain. You file as a single taxpayer with ordinary income well above the $3,000 cap.
- You sell the total-market ETF and buy an S&P 500 ETF the same day (different index, similar U.S. stock job). You stay invested.
- The $4,000 realized loss offsets the $2,500 gain. You have $1,500 of net capital loss left.
- That remainder can offset ordinary income up to the Topic 409 cap ($3,000 for most individual filers). Unused loss carries forward.
You did not lock in a permanent $4,000 gift from the Treasury. The S&P 500 ETF’s basis is about $16,000. If it later climbs to $22,000 and you sell, the gain is measured from that lower basis. Harvesting moved tax through time and offset a gain you already took.
If you had gone to cash instead of buying a replacement, you might have “saved” tax and missed a recovery week. That trade is usually worse than the 1099 cosmetics.
When harvesting is not worth it
- The loss is tiny after commissions and spreads
- You are in a 0% long-term capital-gains situation (see the 2026 0%/15%/20% cutoffs in tax brackets) and have no gains or ordinary income to offset in a useful way
- You would have to sell a fund you cannot replace cleanly (a unique single stock with no cousin)
- You are about to realize a large gain in the same fund anyway for a planned purchase—coordinate timing
- The only “replacement” you will actually buy is the same ticker next week
Harvesting every down Wednesday is a hobby. A year-end review, or a review after a sharp market drop, is enough for most regular investors.
Estimated taxes, MAGI side effects, and state taxes
Realized losses can lower taxable income, which can change estimated-tax vouchers. They can also interact with AGI-sensitive items (IRA deductibility, Roth eligibility, NIIT, ACA subsidies, student-aid formulas). A $3,000 ordinary-income offset is nice; accidentally changing a premium tax credit is a surprise. If your income sits near a cliff, model the year before you harvest a huge loss (or a huge gain).
State conformity to federal capital-loss rules is not identical everywhere. Check your state.
Recordkeeping
Keep:
- Trade confirmations
- The lot method you used (FIFO vs specific ID)
- A note of the replacement ticker and dates
- Year-end 1099-B matched to your records if the broker’s “disallowed wash sale” column looks wrong
If you transferred accounts, basis tracking is a common place 1099s go wrong. Fix basis with the broker before you need the loss. IRS Publication 550 and Publication 551 (basis of assets) are the long-form references.
Stay invested
The failure case is harvesting a loss, parking the cash, waiting for “clarity,” and missing the recovery. The replacement trade should be immediate (or the same day). Tax alpha is a garnish. Market exposure is the meal.
Can I harvest losses in my Roth IRA?
Selling at a loss inside a Roth or traditional IRA does not create a capital loss on Form 1040 the way a taxable sale does. IRA purchases can still wash against taxable sales of a substantially identical security.
Does tax-loss harvesting work with mutual funds the same as ETFs?
The tax-lot and wash-sale ideas are the same. Mutual funds often trade once per day and may distribute capital gains. ETFs are often used in taxable accounts for flexibility. Follow wash-sale windows either way.
What if I buy back the same ETF after 31 days?
Buying the same ticker after the window is a common way to return to your favorite fund. You still needed a replacement in between if you wanted to stay invested. Count days carefully; “about a month” is how wash sales happen. The statute’s window is 30 days before through 30 days after.
Can harvested losses offset my W-2 income?
Net capital losses can offset ordinary income only up to the annual IRS limit described in Topic 409 (generally $3,000, or $1,500 if married filing separately), with the rest carried forward. They are not an unlimited shield for salary.
Should I harvest in a taxable account if I am saving primarily in a 401(k)?
Harvesting only applies to taxable holdings. If almost everything is in retirement accounts, you may have nothing to harvest—and that can be a perfectly healthy plan. See Roth vs traditional for those accounts.
Sources and notes
- IRS, Tax Topic 409, Capital Gains and Losses — $3,000 / $1,500 ordinary-income offset and carryover.
- IRS, Publication 550 — investment income, wash sales.
- 26 U.S.C. §1091 — wash-sale statute.
- Replacement-fund pairings in this article are common practice among do-it-yourself investors, not an IRS-approved list. The dollar example is a hypothetical with stated assumptions.



