Tax Loss Harvesting Optimizer Calculator
Compute Tax Loss Harvesting Optimizer amounts with inclusive and exclusive breakdowns. Supports multiple rates and filing scenarios.
Formula
Net Gain = Capital Gains - Min(Capital Losses, Capital Gains); Tax Savings = (Offset Gains ร Combined Rate) + (Min(Excess Losses, $3,000) ร Ordinary Rate)
The formula calculates tax savings in two parts: first, the capital gains that are offset dollar-for-dollar by harvested losses (taxed at your combined federal and state capital gains rate), and second, any excess losses up to $3,000 that can offset ordinary income (taxed at your marginal income tax rate). Remaining losses carry forward to future years. The combined rate includes federal LTCG rate (0%, 15%, or 20%), potential Net Investment Income Tax (3.8%), and state capital gains taxes. This formula works because the tax code treats capital losses as direct offsets to capital gains, with the $3,000 ordinary income provision providing additional value for excess losses.
Worked Examples
Example 1: Basic Loss Harvesting
Problem:Sarah has $30,000 in long-term capital gains and $12,000 in unrealized losses. She's in the 24% federal bracket with 15% LTCG rate and 5% state tax.
Solution:Capital gains: $30,000 Unrealized losses: $12,000 Net gains: $30,000 - $12,000 = $18,000 Tax without harvesting: $30,000 ร (15% + 5%) = $6,000 Tax with harvesting: $18,000 ร 20% = $3,600 Tax savings: $6,000 - $3,600 = $2,400 Harvesting efficiency: $2,400 / $12,000 = 20%
Result:$2,400 tax savings from harvesting $12,000 in losses
Example 2: Excess Losses with Carryover
Problem:Mike has $10,000 in gains but $25,000 in losses. He's in the 32% bracket.
Solution:Capital gains: $10,000 Capital losses: $25,000 Step 1 - Offset gains: $10,000 gains fully offset โ $0 capital gains tax Step 2 - Remaining losses: $25,000 - $10,000 = $15,000 excess Step 3 - Ordinary income deduction: Year 1: $3,000 deduction ร 32% = $960 savings Step 4 - Carryover: $15,000 - $3,000 = $12,000 carries to next year Total Year 1 benefit: Gains tax avoided: $10,000 ร 20% = $2,000 Ordinary deduction: $960 Total: $2,960
Result:$2,960 Year 1 savings + $12,000 loss carryforward
Example 3: Strategic Partial Harvesting
Problem:Emma has $50,000 gains, $60,000 unrealized losses, and expects similar gains next year. Should she harvest all losses?
Solution:Option A - Harvest all $60,000: Year 1: Offset $50,000 gains + $3,000 ordinary = $53,000 used Carryover: $7,000 Option B - Harvest $53,000 strategically: Year 1: Offset $50,000 gains + $3,000 ordinary Retain $7,000 unrealized for Year 2 Analysis: Option B preserves flexibility Remaining $7,000 unrealized may grow/shrink Avoids locking in carryover timing If 20% combined rate: Year 1 savings either way: $50,000 ร 20% + $3,000 ร 32% = $10,960 Recommendation: Option B - harvest only what's needed
Result:$10,960 Year 1 savings, retain flexibility by harvesting only $53,000
Frequently Asked Questions
What is tax-loss harvesting?
Tax-loss harvesting is a strategy of selling investments at a loss to offset capital gains taxes. The losses can offset gains dollar-for-dollar, plus up to $3,000 in ordinary income annually, with excess losses carrying forward to future years.
What is the wash sale rule?
The wash sale rule prevents claiming a loss if you buy a substantially identical security within 30 days before or after the sale. This 61-day window means you must wait or buy a different (but similar) investment to maintain market exposure.
Can I harvest losses in retirement accounts?
No, losses in tax-advantaged accounts like IRAs and 401(k)s cannot be used for tax-loss harvesting because these accounts are already tax-deferred or tax-free. Harvesting only works in taxable brokerage accounts.
How much can I deduct against ordinary income?
You can deduct up to $3,000 per year ($1,500 if married filing separately) of net capital losses against ordinary income. Any excess losses carry forward indefinitely to future tax years.
Should I harvest short-term or long-term losses first?
Generally, short-term losses are more valuable because they offset short-term gains taxed at higher ordinary income rates. However, the IRS requires netting short-term against short-term and long-term against long-term first.
When is the best time to harvest losses?
Year-end is traditional, but harvesting throughout the year captures more opportunities. Market downturns, portfolio rebalancing, and any time losses exceed a meaningful threshold are good times to harvest.
Does tax-loss harvesting always make sense?
Not always. Transaction costs, wash sale complications, and the benefit of deferral vs. elimination should be considered. If you're in a low tax bracket now but expect higher rates later, harvesting may be less beneficial.
How does state tax affect harvesting decisions?
State taxes can significantly increase harvesting value. High-tax states like California (13.3%) or New York (10.9%) make harvesting more valuable, while states without income tax see reduced but still meaningful benefits.
Background & Theory
History
References
- IRS Publication 550: Investment Income and Expenses
- IRS Wash Sale Rules - IRC Section 1091
- Vanguard: Tax-Loss Harvesting Research
- Journal of Financial Planning: Optimal Tax-Loss Harvesting
- Betterment Tax-Loss Harvesting White Paper
- Kitces: Tax-Loss Harvesting Best Practices
- SEC Investor Bulletin: Capital Gains and Losses
- Tax Foundation: Capital Gains Tax Rates