How Tax Loss Harvesting Optimizer Works
The Tax Loss Harvesting Tool identifies opportunities to sell investments at a loss to offset capital gains, reducing your current-year tax bill while maintaining your desired market exposure. It analyzes your portfolio for positions trading below their cost basis and recommends harvesting candidates that maximize tax savings without triggering wash sale violations.
The tool scans each holding in your portfolio and calculates its unrealized gain or loss. For positions showing losses, it evaluates the tax benefit of realizing that loss — short-term losses are more valuable because they offset short-term gains taxed at ordinary income rates (up to 37%), compared to long-term losses that offset gains taxed at preferential rates (up to 20%). The tool prioritizes harvesting opportunities by their after-tax value.
Critically, the tool enforces wash sale rules. The IRS disallows a loss deduction if you purchase a "substantially identical" security within 30 days before or after the sale. The tool tracks this 61-day window (30 days before, the sale day, and 30 days after) and flags potential violations. It also suggests replacement securities — similar but not substantially identical funds that maintain your asset allocation while you wait out the wash sale period.
Beyond individual positions, the tool calculates your net capital gain or loss position for the year. If total losses exceed total gains, you can deduct up to $3,000 of net capital losses against ordinary income, with any excess carrying forward to future years. The tool models multi-year carryforward scenarios to show the total present value of harvesting today. Combine with the Crypto Capital Gains Tax Calculator for digital asset loss harvesting or the Portfolio Risk Analyzer to ensure harvesting does not inadvertently change your risk profile.
Key Terms Explained
- Tax Loss Harvesting
- The strategy of deliberately selling investments at a loss to generate capital losses that offset capital gains, reducing current tax liability while reinvesting in similar assets to maintain market exposure.
- Wash Sale Rule
- An IRS rule that disallows a capital loss deduction if you buy a substantially identical security within 30 days before or after selling at a loss. The disallowed loss is added to the replacement security's cost basis.
- Substantially Identical
- Securities considered the same for wash sale purposes, including the same stock, options on that stock, and mutual funds/ETFs tracking the same index (though similar but different indexes may not be identical).
- Capital Loss Carryforward
- Net capital losses exceeding the $3,000 annual deduction limit that carry forward to future tax years indefinitely until fully utilized against future gains or income.
- Tracking Difference
- The performance gap between your replacement security and the original holding during the wash sale waiting period, representing the cost of maintaining a slightly different exposure.
Who Needs This Tool
Harvesting $50,000 in short-term losses to offset a large capital gain from a concentrated stock sale, saving approximately $18,500 at the 37% federal rate.
Systematically scanning client portfolios in November and December to identify year-end harvesting opportunities before the tax year closes.
Understanding what their automated tax-loss harvesting service is doing and verifying it is not creating wash sale problems with their other brokerage accounts.
Offsetting required gains from rebalancing a portfolio with harvested losses to stay below the IRMAA threshold for Medicare premium surcharges.
Monitoring the wash sale calendar to know exactly when they can repurchase a sold position without disallowing the harvested loss.
Methodology & Formulas
Tax savings are calculated as: Loss Amount * Applicable Tax Rate (short-term losses at ordinary income rate, long-term losses at capital gains rate). Wash sale detection scans all purchases of the same CUSIP or substantially identical securities within the 61-day window centered on the sale date. Replacement security suggestions use correlation analysis to identify ETFs or funds with >0.95 correlation to the sold position but different underlying index construction. The net benefit calculation deducts estimated transaction costs and any tracking difference during the replacement period.
Pro Tips
- Harvest losses throughout the year, not just in December. Market volatility creates opportunities anytime, and early harvesting gives you more time to manage wash sale windows.
- Be careful with dividend reinvestment plans (DRIPs) — an automatic reinvestment within 30 days of a harvest sale triggers a wash sale on the amount reinvested.
- Coordinate across all accounts including spouse's accounts and IRAs. Buying a substantially identical security in your IRA within 30 days permanently disallows the loss (it does not merely defer it).
- Prioritize harvesting short-term losses over long-term losses — they offset gains taxed at up to 37% rather than 20%, making each dollar of loss worth nearly twice as much.
- Keep a spreadsheet of harvested positions and their wash sale window end dates so you know exactly when you can safely repurchase without accidentally triggering a violation.