Tax-Loss Harvesting Calculator Formula
Understand the math behind the tax-loss harvesting calculator. Each variable explained with a worked example.
Formulas Used
Total Tax Savings
tax_savings = min(capital_losses, capital_gains) * tax_rate / 100 + income_offset * income_tax_rate / 100Net Taxable Gain
net_taxable_gain = net_gainLoss Carryforward
carryforward = max(excess_loss - 3000, 0)Variables
| Variable | Description | Default |
|---|---|---|
capital_gains | Realized Capital Gains(USD) | 10000 |
capital_losses | Available Capital Losses(USD) | 7000 |
tax_rate | Capital Gains Tax Rate(%) | 15 |
income_tax_rate | Ordinary Income Tax Rate(%) | 22 |
net_gain | Derived value= max(capital_gains - capital_losses, 0) | calculated |
excess_loss | Derived value= max(capital_losses - capital_gains, 0) | calculated |
income_offset | Derived value= min(excess_loss, 3000) | calculated |
How It Works
Tax-Loss Harvesting
1. Losses offset gains dollar-for-dollar 2. Excess losses offset up to $3,000 of ordinary income 3. Remaining losses carry forward to future years
Tax Savings = Offset Gains x CG Rate + Income Offset x Income Rate
Be aware of the wash sale rule: you cannot repurchase the same or substantially identical security within 30 days.
Worked Example
$10,000 gains, $7,000 losses, 15% CG rate.
- 01$7,000 losses offset $7,000 of gains
- 02Net taxable gain = $3,000
- 03Tax savings = $7,000 x 15% = $1,050
- 04No excess losses for income offset
Frequently Asked Questions
What is the wash sale rule?
You cannot claim a loss if you buy the same or substantially identical security within 30 days before or after the sale. This prevents selling for a tax loss and immediately rebuying.
Can I harvest losses every year?
Yes. Tax-loss harvesting is most effective during market downturns. You can offset gains and deduct up to $3,000 against income annually, with unlimited carryforward.
Does tax-loss harvesting actually save money?
It defers taxes and can permanently save money if your future capital gains rate is lower. The savings are also invested and compounding in the meantime.
Ready to run the numbers?
Open Tax-Loss Harvesting Calculator