How Tax-Loss Harvesting Works Step-by-Step
How Tax-Loss Harvesting Works Step-by-Step
Tax-loss harvesting follows a disciplined sequence: identify positions with unrealized losses, sell them at the loss, immediately purchase replacement securities to maintain portfolio exposure, document the transaction, and report losses on your tax return. Understanding the mechanics prevents costly mistakes and ensures you capture the full tax benefit while staying compliant with IRS wash-sale rules.
Quick definition: Tax-loss harvesting works by selling a depreciated security to realize a capital loss, immediately replacing it with a similar (but not identical) security, and then using that loss to offset capital gains or ordinary income on your tax return.
Key takeaways
- Unrealized losses become tax-deductible only after you sell; the sale "realizes" the loss
- Harvested losses offset capital gains first (unlimited), then ordinary income (up to $3,000 per year)
- Excess losses carry forward indefinitely to future tax years
- The wash-sale rule prohibits repurchasing the same security within 30 days before or after the sale
- Proper documentation via brokerage reports and Schedule D is essential for IRS compliance
Step 1: Identify positions with losses
Begin in late autumn or early winter by reviewing your taxable brokerage account. Most brokerages provide a "losses" or "underwater positions" report showing securities trading below cost basis. You need:
- Original cost basis (total purchase price, including commissions if tracked separately)
- Current market price
- Unrealized loss (market price minus cost basis)
- Purchase date (to confirm holding period for long-term treatment, though harvesting loss treatment doesn't depend on holding period the way gains do)
Example: You bought 50 shares of a midcap fund at $120 per share ($6,000 total). It now trades at $100 per share ($5,000 current value), giving an unrealized loss of $1,000.
Brokerages like Fidelity, Schwab, Vanguard, and others automatically calculate cost basis and unrealized gains/losses if you've enabled cost-basis tracking (required by the IRS since 2011). If you've transferred positions from other brokers, import the cost basis data into your new broker to ensure accuracy.
Step 2: Assess your current-year capital gains and loss position
Before harvesting, tally your realized capital gains and losses to date:
- Realized short-term gains (holding period ≤ 1 year)
- Realized long-term gains (holding period > 1 year)
- Realized short-term losses
- Realized long-term losses
- Net amount (gains minus losses)
The IRS requires you to match losses against gains in this order: short-term losses offset short-term gains first; long-term losses offset long-term gains first; remaining losses offset gains of the opposite type; and finally, excess losses deduct against ordinary income (up to $3,000 per year).
Scenario: You've sold index funds this year and locked in $8,000 of long-term gains. You have no other losses. Harvesting a $5,000 loss in December reduces your capital gains to $3,000. The $3,000 loss sits in carryforward.
If you've already realized losses, harvesting more losses may push you into carryforward territory sooner, reducing this year's tax savings but building a loss reserve for future years when you realize gains.
Step 3: Select losses to harvest and identify replacements
Choose positions with losses that align with your portfolio rebalancing needs. This is crucial: harvesting should coincide with restoring your long-term allocation.
Rule of thumb: If a position has lost value and now represents a smaller percentage of your portfolio than your target allocation, harvest it and buy a replacement in the same asset class. If it represents a larger percentage (perhaps due to gains elsewhere), harvest only if you intended to reduce its weighting.
Select a replacement security that is similar but not identical to the sold security. This avoids the wash-sale rule while maintaining your intended exposure. Examples:
| Sold (Loss) | Replacement (No Sale Loss) |
|---|---|
| Vanguard Total Market (VTI) | Schwab U.S. Broad Market (SWTSX) |
| iShares MSCI EAFE (EFA) | Vanguard FTSE Developed Markets (VEA) |
| Sector-specific fund (tech XLK) | Different tech ETF (IYW or similar) |
| Individual high-dividend stock | Dividend aristocrats ETF with overlap |
| Bond fund (BND) | Different intermediate-bond fund (AGG) |
The IRS cares about economic substance: if the replacement is substantially identical—same index, same holdings, same performance—the wash sale applies regardless of the ticker. When in doubt, consult your tax advisor or review the IRS's guidance on "substantially identical" securities.
Step 4: Execute the sale and purchase
Execute the sale of the loss position in your taxable brokerage account. Record:
- Date of sale
- Security sold (ticker, name)
- Quantity and price per share
- Total proceeds
- Commission or fees
Immediately (same day or next business day) purchase the replacement security. Record its details:
- Date of purchase
- Security purchased (ticker, name)
- Quantity and price per share
- Total cost (including commissions)
Critical timing: The wash-sale window is 30 days before the sale and 30 days after the sale. If you bought the replacement on December 1, you cannot sell the original position (at a loss) between November 1 and December 31. The rule also applies to your spouse in a community property state; coordinate if filing jointly.
Step 5: Track and monitor the holding period
Once you've harvested a loss and purchased a replacement, the replacement security has a new cost basis (the price you paid for it). If you later sell the replacement at a gain, that gain is separate from the harvested loss and taxable on its own.
Additionally, your original position's cost basis is "reset" by the sale. If you later repurchase the exact same security (after 30 days), the new purchase starts a fresh tax history and cost basis.
Example of long-term tracking:
- December 2024: Buy 100 shares of Vanguard Total Market at $120/share ($12,000).
- November 2025: Stock at $100; harvest $2,000 loss, buy Schwab Broad Market at $100/share ($10,000 in proceeds, net).
- April 2026: Sell Schwab position at $110/share ($11,000 proceeds). Realize $1,000 gain on the Schwab position. Also, in May 2026, repurchase the Vanguard fund at $115/share (now safe—beyond the 30-day window). New $11,500 cost basis on the Vanguard repurchase.
Your 2025 tax return reports the $2,000 harvested loss. Your 2026 tax return reports the $1,000 gain on the Schwab sale (offset by the $2,000 loss carryforward if no other gains).
Step 6: Report on Schedule D and your tax return
When you file your tax return, all realized gains and losses appear on Schedule D (Capital Gains and Losses) of Form 1040. The IRS merges your short-term and long-term transactions, calculates net long-term gains/losses and net short-term gains/losses separately, then combines them.
Your brokerage will send you a Form 1099-B (Proceeds from Broker and Barter Exchange Transactions) by January 31 of the following year. This reports all sales during the tax year. If you've elected cost-basis tracking, the 1099-B includes cost basis and whether the gain/loss is long-term or short-term.
On Schedule D:
- List each sale in the appropriate section (short-term or long-term).
- Report cost basis and proceeds.
- IRS calculates gain or loss for each transaction.
- Schedule D totals all short-term and long-term transactions.
- Net losses up to $3,000 deduct against ordinary income on Form 1040, line 7.
- Excess losses carry to Schedule D of the next tax year.
If you harvested $5,000 of losses but realized only $2,000 of gains, your Schedule D shows a $3,000 net loss, which deducts against ordinary income. The $0 excess carries forward (you used it all). If you'd harvested $7,000 and realized $2,000 of gains, your Schedule D shows a $5,000 net loss; $3,000 deducts against this year's ordinary income, and $2,000 carries forward to next year.
Real-world examples
Example 1: The offset harvest. In 2024, you sell a mutual fund for a $4,000 long-term gain (it appreciated since you bought it). You also own a small-cap ETF that's lost $2,500. You harvest the $2,500 loss in December 2024 by selling it and buying a different small-cap fund. On your 2024 Schedule D, you report the $4,000 gain and $2,500 loss, netting to $1,500 taxable capital gain. At your 15% long-term rate, that's ~$225 owed, versus $600 if you'd had no loss to harvest. The $2,500 loss saves you ~$375 in federal tax ($2,500 × 15%).
Example 2: The ordinary-income deduction. In 2024, you realize $1,500 of capital gains (net of short-term losses). You also have an international fund that's lost $4,000. You harvest the $4,000 loss. On Schedule D, your net is a $2,500 loss. You deduct $2,500 against ordinary income (wages, dividends, interest). If you're in the 24% federal bracket, that deduction saves ~$600 in tax. The remaining $2,500 loss carries to 2025, where it offsets gains or further deducts against ordinary income.
Example 3: The multi-year carryforward. In 2023, you harvest $7,000 of losses. Your gains that year were $2,000, so you report a $5,000 net loss. You deduct $3,000 against 2023 ordinary income and carry $2,000 to 2024. In 2024, you have no gains but harvest $1,500 more, so you have $3,500 of losses to deduct against ordinary income ($3,000 this year, $500 to 2025). By maintaining a loss reserve across years, you can smooth your tax liability and capture harvested losses when they're most valuable.
Example 4: Avoiding the wash sale. In November 2024, you sell your Vanguard Total Stock Market Index Fund (VTI) at a $3,000 loss and immediately buy Schwab U.S. Broad Market (SWTSX). The holdings are nearly identical but tickers differ, so it's not a wash sale. In January 2025, the market rebounds and you want to lock in gains in SWTSX—you sell at a $1,000 gain. You now realize $1,000 gain (on SWTSX) and use your $3,000 harvested loss (from VTI) to offset it plus deduct $2,000 against ordinary income. Perfect execution.
By contrast, if you'd sold VTI at a loss on November 15, 2024, and bought it back on November 20, 2024, the December 15 wash-sale window (30 days before sale) and January 15, 2025 window (30 days after sale) would disallow the loss. Your $3,000 loss would be permanently deferred, added to the new VTI cost basis, and not deductible until you eventually sold that position at a different time.
Common mistakes
1. Forgetting the wash-sale window spans both directions. The rule is 30 days before the sale and 30 days after. If you sold on December 15, you cannot buy the same security between November 15 and January 14. Many investors harvest in early December, unaware that year-end bonus purchases might trigger a wash sale. Plan early.
2. Harvesting without naming a replacement. Some investors sell at a loss but leave cash uninvested, thinking they'll decide later. This defeats the purpose: your portfolio is unbalanced, and if you eventually buy back a similar security, you may trigger a wash sale. Always have a replacement identified before you sell.
3. Conflating losses across accounts. Losses harvested in a taxable account can offset gains only in that same taxable account or carry forward in that account. You cannot transfer a loss from one taxable account to another or use it in a retirement account. Keep records by account.
4. Harvesting when alternative minimum tax (AMT) applies. If you're subject to AMT (high income, many deductions), capital losses may not reduce your tax bill dollar-for-dollar. Consult a tax professional if your income exceeds $200,000 and you're considering large harvests.
5. Ignoring the replacement security's future tax treatment. When you harvest a loss and buy a replacement, that replacement's cost basis is reset. If it appreciates and you sell it, you'll owe tax on that gain. Plan for future transactions; don't just focus on this year's tax savings.
FAQ
Do I have to harvest losses, or is it optional? Entirely optional. You harvest losses only if they benefit your tax situation. If you have no capital gains, harvesting a loss that deducts only $3,000 against ordinary income saves roughly $720–$960 in federal tax (at 24–32% brackets), which may or may not justify the transaction costs and monitoring burden. Evaluate case-by-case.
Can I harvest losses in multiple accounts? Yes. If you hold positions in separate taxable accounts, you can harvest losses in each. Each account keeps its own gain/loss tally, but they all flow to your single Schedule D on your tax return. Report all transactions together.
What if I harvest a loss and the security rises immediately after? The harvested loss is permanent and already locked in. You deduct it on your tax return regardless of whether your replacement security appreciates or declines. You've separated the loss realization from the economic exposure—a feature, not a bug.
Can I harvest losses on shares I inherited? Yes. Inherited shares receive a "step-up" in cost basis (reset to market value at the date of death). If you inherit shares worth $50,000 and they decline to $40,000, you can harvest the $10,000 loss. However, the step-up generally applies to the full inheritance, so large losses on inherited shares are rare.
Do brokerage fees reduce my harvesting benefit? Yes, slightly. If you harvest a $2,000 loss and pay $10 in trading commissions or fund expenses, your net tax benefit is reduced. In most modern brokerages, commissions on stock and ETF trades are free, so fees are minimal. However, evaluate the overall benefit before harvesting very small losses.
What happens to my cost basis on the replacement security? The replacement security's cost basis is simply the price you paid for it on purchase day. It's independent of the harvested loss. If you bought the replacement for $10,000 and later sell for $12,000, you owe tax on a $2,000 gain, offset by the harvested loss if available.
Related concepts
- What Is Tax-Loss Harvesting?
- The Wash-Sale Rule Explained
- Understanding Capital Gains Taxation
- Tax-Efficient Fund Placement
- Estate and Inherited Asset Taxation
Summary
Tax-loss harvesting works through a six-step process: identify underwater positions, assess your year-to-date gains and losses, select losses to harvest and replacement securities, execute the sale and replacement purchase immediately, track the 30-day wash-sale window, and report all transactions on Schedule D when you file your tax return. Losses offset capital gains first (unlimited), then ordinary income (up to $3,000 per year), with excess losses carrying forward indefinitely. Proper documentation, replacement security selection, and attention to the wash-sale rule ensure you capture the full tax benefit while staying compliant.