Tax Loss Harvesting Calculator

Calculate the tax savings from strategically selling investments at a loss to offset capital gains and reduce your tax bill. Understand wash sale rules, the $3,000 deduction limit, and optimal harvesting strategies.

MT
Written by Michael Torres, CFA
Senior Financial Analyst
JW
Fact-checked by Dr. James Wilson, PhD
Options Strategy Researcher
Financial PlanningFact-Checked

Input Values

$

Total realized short-term capital gains (held less than 1 year).

$

Total realized long-term capital gains (held 1 year or longer).

$

Unrealized or realized short-term losses available for harvesting.

$

Unrealized or realized long-term losses available for harvesting.

$

Your total ordinary income for the year. Used to determine tax bracket and the benefit of the $3,000 deduction.

Your federal tax filing status.

%

Your state income tax rate on capital gains. Enter 0 for states with no income tax.

The 3.8% NIIT applies if MAGI exceeds $200,000 (single) or $250,000 (MFJ).

Results

Total Estimated Tax Savings
$0.00
Net Capital Gain After Harvesting$0.00
Short-Term Gains Offset$0.00
Long-Term Gains Offset$0.00
Ordinary Income Deduction (up to $3,000)$0.00
Capital Loss Carryforward$0.00
Effective Tax Rate on Gains
0.00%
Results update automatically as you change input values.

What Is Tax Loss Harvesting?

Tax loss harvesting is a strategy that involves selling investments that have declined in value to realize capital losses, which can then be used to offset capital gains and reduce your tax liability. After selling the losing position, you reinvest the proceeds in a similar (but not substantially identical) investment to maintain your desired asset allocation. This approach allows you to capture a tax benefit from paper losses without meaningfully changing your investment exposure. Tax loss harvesting is most beneficial in taxable brokerage accounts and has no applicability to tax-advantaged accounts like IRAs or 401(k)s.

The strategy works because the U.S. tax code allows capital losses to offset capital gains dollar for dollar. Short-term losses first offset short-term gains (taxed at ordinary income rates of 10-37%), then long-term gains (taxed at 0%, 15%, or 20%). If your total capital losses exceed your capital gains, you can deduct up to $3,000 of the excess against ordinary income each year ($1,500 if married filing separately). Any remaining losses carry forward indefinitely to future tax years. Studies from Wealthfront and Betterment suggest that systematic tax loss harvesting can add 0.5-1.5% to after-tax returns annually, depending on the investor's tax bracket and market volatility.

!
Wash Sale Rule: The Critical Constraint

The IRS wash sale rule prohibits claiming a loss on a security if you purchase a 'substantially identical' security within 30 days before or after the sale (a 61-day window). This includes purchases in your IRA, 401(k), or spouse's accounts. Violating the wash sale rule disallows the loss and adds it to the cost basis of the replacement security. Always wait 31 days or use a non-identical replacement investment.

How Capital Loss Netting Works

IRS Capital Loss Netting Order

1
Step 1: Net Short-Term Gains and Losses
First, offset all short-term capital gains with short-term capital losses. Short-term gains (assets held less than 1 year) are taxed at ordinary income rates (10-37%), making losses that offset them the most valuable. If you have $10,000 in short-term gains and $5,000 in short-term losses, your net short-term gain is $5,000.
2
Step 2: Net Long-Term Gains and Losses
Next, offset long-term capital gains with long-term capital losses. Long-term gains (assets held 1+ year) are taxed at preferential rates of 0%, 15%, or 20% depending on income. If you have $15,000 in long-term gains and $8,000 in long-term losses, your net long-term gain is $7,000.
3
Step 3: Cross-Net if One Category Has Net Loss
If either short-term or long-term results in a net loss, that loss offsets the gain in the other category. For example, if net short-term is a $3,000 loss and net long-term is a $7,000 gain, the $3,000 short-term loss reduces the long-term gain to $4,000.
4
Step 4: Deduct Against Ordinary Income ($3,000 Limit)
If total losses exceed total gains, up to $3,000 of the excess ($1,500 married filing separately) can be deducted against ordinary income such as salary, wages, and interest. At a 32% tax bracket, the $3,000 deduction saves $960 in federal taxes plus any state tax savings.
5
Step 5: Carry Forward Remaining Losses
Any capital losses exceeding gains plus the $3,000 deduction carry forward to future years indefinitely. They retain their short-term or long-term character and are used in the same netting process in future years. Report carryforward losses on Schedule D and Form 8949.

Tax Loss Harvesting Example

Tax Savings from Harvesting Losses
Given
Short-Term Gains
$10,000
Long-Term Gains
$15,000
Short-Term Losses (Harvestable)
$5,000
Long-Term Losses (Harvestable)
$8,000
Ordinary Income
$150,000
Filing Status
Married Filing Jointly
Federal Tax Bracket
24%
Long-Term Capital Gains Rate
15%
State Tax Rate
5%
Calculation Steps
  1. 1Step 1: Net short-term: $10,000 gains - $5,000 losses = $5,000 net short-term gain
  2. 2Step 2: Net long-term: $15,000 gains - $8,000 losses = $7,000 net long-term gain
  3. 3Step 3: Total net gain: $5,000 (short-term) + $7,000 (long-term) = $12,000
  4. 4Without harvesting: $10,000 x 24% + $15,000 x 15% = $2,400 + $2,250 = $4,650 federal tax
  5. 5With harvesting: $5,000 x 24% + $7,000 x 15% = $1,200 + $1,050 = $2,250 federal tax
  6. 6Federal tax savings: $4,650 - $2,250 = $2,400
  7. 7State tax savings: $13,000 (losses) x 5% = $650
  8. 8NIIT savings: $13,000 x 3.8% = $494
  9. 9Total tax savings: $2,400 + $650 + $494 = $3,544
Result
By harvesting $5,000 in short-term losses and $8,000 in long-term losses, you reduce your net capital gains from $25,000 to $12,000 and save approximately $3,544 in federal, state, and NIIT taxes. You can reinvest the proceeds in similar (but not substantially identical) funds to maintain your portfolio allocation.

2026 Capital Gains Tax Rates

2026 Federal Capital Gains Tax Rates
Filing Status0% Rate15% Rate20% RateNIIT Threshold (3.8%)
SingleUp to $48,350$48,351 - $533,400Over $533,400$200,000 MAGI
Married Filing JointlyUp to $96,700$96,701 - $600,050Over $600,050$250,000 MAGI
Head of HouseholdUp to $64,750$64,751 - $566,700Over $566,700$200,000 MAGI
Married Filing SeparatelyUp to $48,350$48,351 - $300,025Over $300,025$125,000 MAGI

The Wash Sale Rule Explained

The wash sale rule (IRS Section 1091) prevents investors from claiming a tax loss while immediately repurchasing the same or a substantially identical security. The rule applies if you buy the same security (or an option to buy it) within 30 days before or after the loss sale, creating a 61-day window. The IRS has not precisely defined 'substantially identical,' but generally two different stocks are not substantially identical, while shares of the same company or the same mutual fund/ETF clearly are. Index funds from different providers that track the same index (e.g., Vanguard S&P 500 vs. Schwab S&P 500) occupy a gray area; most tax professionals recommend switching to a different index (e.g., S&P 500 to total stock market) to be safe.

Importantly, the wash sale rule applies across all your accounts, including IRAs, 401(k)s, and your spouse's accounts. If you sell a stock at a loss in your taxable account and buy it within 30 days in your IRA, the loss is permanently disallowed (it cannot be added to the IRA's cost basis). Dividend reinvestment (DRIP) can also trigger wash sales if the reinvested dividend purchases the same security during the 61-day window. Consider temporarily disabling DRIP for any security you plan to harvest losses on.

Tax Loss Harvesting Best Practices

  • Prioritize harvesting short-term losses: They offset short-term gains taxed at ordinary income rates (10-37%), providing the highest tax savings per dollar of loss.
  • Replace, do not abandon: After selling a losing position, immediately reinvest in a similar but not substantially identical investment to maintain your target asset allocation.
  • Common swap pairs: Vanguard Total Stock Market to Schwab Total Stock Market, S&P 500 to Russell 1000, MSCI EAFE to FTSE Developed, Barclays Aggregate Bond to Bloomberg US Bond.
  • Harvest throughout the year: Do not wait until December. Market volatility creates harvesting opportunities year-round, and early-year harvesting maximizes the time value of tax savings.
  • Be aware of the reduced cost basis: Tax loss harvesting does not eliminate taxes; it defers them. Your replacement investment has a lower cost basis, so you will pay more tax when you eventually sell it.
  • Keep detailed records: Track all harvested losses, replacement purchases, wash sale violations, and carryforward balances. Your brokerage provides Form 1099-B, but maintaining your own records prevents errors.
  • Consider the opportunity cost: If selling triggers a meaningful departure from your target allocation for 31+ days, the investment risk may outweigh the tax savings.

When Tax Loss Harvesting Is Most Valuable

Tax loss harvesting provides the greatest benefit to high-income investors in the 32-37% federal tax bracket (plus state taxes and NIIT), investors with significant short-term capital gains that would otherwise be taxed at ordinary income rates, and investors who can defer the embedded gain for many years or pass the assets to heirs (who receive a stepped-up cost basis at death, permanently eliminating the deferred tax). The strategy is less valuable for investors in the 0% capital gains bracket, those with minimal portfolio turnover, or investors in tax-free accounts. Automated tax loss harvesting services from robo-advisors like Betterment, Wealthfront, and Vanguard Digital Advisor have made this strategy accessible to a broader range of investors.

For UK-based investors, capital gains tax rules differ significantly from the US. Try our sister site <a href="https://ukcalculator.com">UK Calculator</a> for HMRC-compliant tools including capital gains tax calculators, ISA allowance optimizers, and tax-efficient investing guides tailored to the UK system.

i
Recommended Reading

For a deep understanding of tax-efficient investing, we recommend <a href="https://www.amazon.com/Intelligent-Investor-Definitive-Investing-Essentials/dp/0060555661?tag=websites026-20">The Intelligent Investor</a> by Benjamin Graham for portfolio management principles, and <a href="https://www.amazon.com/Random-Walk-Down-Wall-Street/dp/1324002182?tag=websites026-20">A Random Walk Down Wall Street</a> by Burton Malkiel for practical strategies on index fund investing and tax efficiency.

Tax Loss Harvesting and Portfolio Rebalancing

Tax loss harvesting can be combined with regular portfolio rebalancing to achieve both tax savings and optimal asset allocation. When your portfolio drifts from its target allocation, selling overweight positions that have losses kills two birds with one stone: you capture the tax loss and move your allocation back to target. When rebalancing, sell losing positions in overweight asset classes first, use the harvested losses to offset any gains from selling winning positions in other overweight classes, and reinvest proceeds in underweight asset classes. This integrated approach can reduce or eliminate the tax cost of rebalancing that would otherwise discourage portfolio maintenance.

Frequently Asked Questions

Tax savings depend on your tax bracket, the amount of losses harvested, and the type of gains offset. In the best case, short-term losses offset short-term gains taxed at 37% federal + 3.8% NIIT + state taxes, saving up to $0.45+ per dollar of loss for top-bracket taxpayers. At minimum, unused losses offset $3,000 of ordinary income annually. Research from Wealthfront found that systematic tax loss harvesting adds 0.5-1.5% per year to after-tax returns for a typical high-income investor.

Sources & References

  • U.S. Securities and Exchange Commission (SEC) - Investor Education
  • Options Clearing Corporation (OCC) - Options Education
  • Chicago Board Options Exchange (CBOE) - Options Strategies
  • Hull, J.C. "Options, Futures, and Other Derivatives" (11th Edition, 2021)

Embed This Calculator on Your Website

Free to use with attribution

Copy the code below to add this calculator to your website, blog, or article. A link back to CoveredCallCalculator.net is included automatically.

<iframe src="https://coveredcallcalculator.net/embed/tax-loss-harvesting-calculator" width="100%" height="500" frameborder="0" title="Tax Loss Harvesting Calculator" style="border:1px solid #e2e8f0;border-radius:12px;max-width:600px;"></iframe>
<p style="font-size:12px;color:#64748b;margin-top:8px;">Calculator by <a href="https://coveredcallcalculator.net" target="_blank" rel="noopener">CoveredCallCalculator.net</a></p>

Related Calculators

Financial Planning

Capital Gains Tax Calculator

Calculate federal and state capital gains tax on stock sales, real estate, and other investments. Compare short-term vs. long-term capital gains rates.

Profit & Loss

Capital Gains Calculator

Calculate capital gains tax on stocks, real estate, and investments. Free calculator with short-term and long-term capital gains rates for US federal and state.

Profit & Loss

Long-Term Capital Gains Calculator

Calculate long-term capital gains tax on investments held over one year. Free calculator with 2026 federal rates (0%, 15%, 20%), NIIT, and state tax analysis.

Profit & Loss

Short-Term Capital Gains Calculator

Calculate short-term capital gains tax on investments held under one year. Free calculator with 2026 federal brackets, state taxes, and NIIT analysis.

Financial Planning

Tax Bracket Calculator

Find your federal income tax bracket and estimate your tax liability. See how the progressive tax system works and calculate your marginal and effective tax rates.

Financial Planning

Income Tax Calculator

Estimate your federal and state income taxes for 2026. Calculate your tax liability, effective rate, and take-home pay based on your income and deductions.

Financial Planning

Investment Calculator

Free investment calculator to project the growth of your investments over time. Factor in contributions, dividends, fees, and taxes for accurate projections.

Financial Planning

Required Minimum Distribution (RMD) Calculator 2026

Free RMD calculator for 2026 using updated IRS Uniform Lifetime Table. Calculate your required minimum distribution from 401(k), IRA, and other retirement accounts after age 73.