Tax-Loss Harvesting Calculator
Your losers are finally useful. Turn red into a tax break.
Position Details
Tax Details
Income to Offset (optional)
If you have no capital gains to offset, up to $3,000 of losses can be deducted from ordinary income. The rest carries forward.
Repurchase Plan
Tax-Loss Harvesting: The Complete Guide
Everything you need to know about turning investment losses into tax savings, avoiding wash sales, and making the most of a bad trade.
Tax-loss harvesting is a strategy where you intentionally sell an investment that has lost value to "realize" the loss for tax purposes. The realized loss can then be used to reduce your tax bill by offsetting capital gains from other investments or by deducting a portion from your ordinary income.
How the process works step by step:
- Identify losing positions — Look through your portfolio for investments where the current market value is below what you originally paid (your cost basis). These are candidates for harvesting.
- Sell the losing position — Execute the sale to "realize" the loss. Until you sell, the loss is only on paper (unrealized) and has no tax impact.
- Claim the loss on your taxes — The realized loss offsets capital gains first. If your total losses exceed your total gains, you can deduct up to $3,000 of the excess against ordinary income ($1,500 if married filing separately). Any remaining loss carries forward indefinitely to future tax years.
- Optionally reinvest — If you still believe in the long-term thesis, you can reinvest in a similar (but not "substantially identical") security immediately, or wait 31 days and buy back the exact same stock. This keeps you invested while still capturing the tax benefit.
The key insight: Tax-loss harvesting does not eliminate taxes — it defers them. When you sell at a loss and repurchase later, your new cost basis is lower, which means a larger taxable gain in the future. However, the time value of money makes this deferral genuinely valuable: a dollar of tax saved today can be invested and compounded for years before the deferred tax comes due.
Tax-loss harvesting is most impactful for investors with significant realized capital gains elsewhere in their portfolio, or for high-income earners who can benefit from the $3,000 ordinary income deduction each year.
The wash sale rule is an IRS regulation (Section 1091) designed to prevent taxpayers from selling a security at a loss just to claim the tax deduction, and then immediately buying it back. If you trigger a wash sale, the loss is disallowed for tax purposes in the current year.
The 61-day window:
- The wash sale period covers 30 days before and 30 days after the date you sell at a loss, plus the sale date itself — a total of 61 calendar days.
- If you purchase a "substantially identical" security at any point during this 61-day window, the loss is disallowed.
- The disallowed loss is not permanently gone — it gets added to the cost basis of the replacement shares. This means you will eventually recoup the benefit when you sell those replacement shares (assuming you do not trigger another wash sale).
What counts as "substantially identical":
- Same stock or security — Selling shares of Apple and buying Apple back is clearly a wash sale.
- Options on the same security — Buying a call option on a stock you just sold at a loss also triggers the rule.
- Same ETF or mutual fund — Selling shares of a particular S&P 500 ETF and buying the same one back is a wash sale.
- Gray area: similar but different funds — Selling a Vanguard S&P 500 ETF and buying an iShares S&P 500 ETF tracks the same index. The IRS has not issued definitive guidance, but many tax professionals consider this risky.
Safe strategies to avoid a wash sale:
- Wait at least 31 calendar days before repurchasing the same security.
- Immediately reinvest in a different company in the same sector (e.g., sell one tech stock, buy another).
- Swap from a specific index fund to a total-market fund or a fund tracking a different index.
While most investors think of tax-loss harvesting as a year-end activity, the optimal approach involves monitoring opportunities throughout the entire year. Markets are volatile, and losses can appear and disappear quickly.
Key timing considerations:
- After market downturns — Broad selloffs create the most harvesting opportunities. If the market drops 10-20%, many positions in your portfolio may be underwater. This is often the best time to harvest because you have the largest unrealized losses available.
- Before year-end — To use losses against gains in the current tax year, the sale must settle by December 31. Stock trades settle in one business day (T+1), so you generally need to sell by December 29 or 30 (depending on weekends and holidays) to ensure settlement within the tax year.
- After a large realized gain — If you sold a big winner earlier in the year, actively look for losers to harvest as an offset. The more gains you have to offset, the more valuable each dollar of harvested loss becomes.
- Tax bracket management — If you are near the boundary between two tax brackets, harvesting losses can pull your taxable income down into a lower bracket, providing savings beyond just the capital gains offset.
Year-round vs. year-end harvesting: Studies have shown that investors who harvest losses throughout the year capture significantly more tax alpha than those who only check their portfolio in December. A position might be down 20% in March but recover by November, meaning the opportunity to harvest has disappeared.
One practical approach is to set alerts or review your portfolio monthly. Whenever a position drops more than 10% below your cost basis, evaluate whether it makes sense to harvest.
The amount you save depends on three factors: the size of your loss, your tax bracket (federal plus state), and whether you have capital gains to offset.
Offsetting capital gains:
If you have realized capital gains, harvested losses offset them dollar-for-dollar. The tax savings equal the loss amount multiplied by your combined tax rate. For example, if you have a $10,000 loss and a 22% federal bracket plus 5% state rate, you save $10,000 × 27% = $2,700 in taxes.
Offsetting ordinary income:
If your losses exceed your gains (or you have no gains at all), you can deduct up to $3,000 per year ($1,500 if married filing separately) from your ordinary income. At the 37% federal bracket plus a state rate of 10%, the $3,000 deduction saves you $1,410 per year. Remaining losses carry forward indefinitely, so a $50,000 loss with no gains to offset would take roughly 17 years to fully deduct at $3,000 per year.
Real-world savings examples:
- $5,000 loss, 22% bracket, $5,000 in gains — Save approximately $1,100 in federal taxes (plus state taxes).
- $20,000 loss, 37% bracket, $20,000 in gains — Save approximately $7,400 in federal taxes.
- $10,000 loss, 24% bracket, no gains — Save $720 this year ($3,000 × 24%), with $7,000 carrying forward.
The compounding benefit: The real value of tax-loss harvesting comes from reinvesting the tax savings. If you save $2,700 in taxes and invest it at 8% annual returns, that single harvest is worth approximately $5,830 after 10 years. Harvesting consistently over many years can add up to a significant boost in after-tax wealth.
No. Tax-loss harvesting only applies to taxable brokerage accounts. It does not work with tax-advantaged retirement accounts such as traditional IRAs, Roth IRAs, 401(k)s, or 403(b)s.
Why it does not work in retirement accounts:
- Traditional IRAs and 401(k)s are tax-deferred — you do not pay capital gains tax on any transactions inside the account. Gains and losses within the account have no tax impact until you withdraw money, at which point it is all taxed as ordinary income regardless of whether the underlying investments went up or down.
- Roth IRAs are tax-free (for qualified distributions) — since you will never owe tax on the gains, there is no tax benefit to realizing a loss.
- Cross-account wash sale trap: Be careful about buying a "substantially identical" security in your IRA within 30 days of selling it at a loss in your taxable account. The IRS considers this a wash sale, and because IRA shares cannot have an adjusted cost basis, the loss is permanently disallowed — you lose the deduction entirely.
Best practice: Only harvest losses in your taxable brokerage account, and make sure you are not simultaneously buying the same security in your IRA or 401(k) within the wash sale window.
Any capital losses that exceed your capital gains and the $3,000 ordinary income deduction carry forward indefinitely to future tax years. There is no expiration date on carried-forward capital losses.
How the carryforward works:
- Step 1: Net your short-term gains and losses together, and separately net your long-term gains and losses.
- Step 2: If one category has a net loss and the other has a net gain, they offset each other.
- Step 3: If there is still a net loss after netting, deduct up to $3,000 against ordinary income.
- Step 4: Any remaining net loss carries forward to the following year, retaining its character (short-term or long-term).
Example: You harvest $25,000 in losses this year and have $10,000 in capital gains. You offset all $10,000 in gains (saving taxes on those), deduct $3,000 from ordinary income, and carry forward $12,000 to next year. Next year, if you realize $15,000 in gains, you can offset $12,000 of them with the carried-forward loss and only pay tax on $3,000.
Capital loss carryforwards are reported on Schedule D of your tax return. Your tax software should track these automatically, but it is good practice to keep your own records in case you switch providers.
Often yes — and this is where tax-loss harvesting becomes most powerful. If you believe a stock will recover, you can harvest the loss for the tax benefit and then buy back in after the 31-day wash sale period. You maintain your long-term thesis while pocketing the tax savings.
The harvest-and-repurchase approach:
- Sell the losing position to realize the loss.
- Wait 31 calendar days (the wash sale window).
- Repurchase the same stock at the then-current market price.
- Your new cost basis resets to the repurchase price, which is lower than your original basis. This means a larger taxable gain when you eventually sell — but the tax deferral is still valuable.
Risks of the 31-day gap:
- Stock rises during lockout — If the stock jumps 10% while you wait, you buy back in at a higher price. The opportunity cost may exceed the tax savings. This calculator shows this scenario to help you weigh the risk.
- Stock drops during lockout — If the stock falls further, you actually benefit doubly: you get the tax savings and you repurchase at an even lower price.
Bridging the gap: To stay invested in the sector during the 31-day window, you can buy a similar (but not substantially identical) security. For example, if you sell a single tech stock, you could buy a broader tech ETF for 31 days, then swap back. This reduces the risk of missing a big move while still complying with the wash sale rule.
Most U.S. states tax capital gains as ordinary income, which means harvested losses reduce your state tax bill in addition to your federal bill. The combined savings can be substantial, especially in high-tax states.
States with no income tax (no additional savings):
- Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, and Wyoming have no state income tax. New Hampshire does not tax earned income or capital gains (it previously taxed dividends and interest, but this was phased out).
- Washington has a 7% capital gains excise tax on long-term gains over $270,000, so harvesting can provide state-level savings for high-value portfolios.
High-tax state impact:
In states like California (up to 13.3%), New York (up to 10.9%), or New Jersey (up to 10.75%), the state savings from harvesting can add 30-50% on top of the federal benefit. For example, a $10,000 loss at the 37% federal bracket and 13.3% California rate saves $5,030 combined, compared to just $3,700 federally alone.
This calculator includes state tax rates for all 50 states plus DC, so you can see the full combined impact for your specific situation. When evaluating whether a harvest is worthwhile, always consider the combined rate rather than just the federal rate.
Capital losses are classified as short-term (held 12 months or less) or long-term (held more than 12 months), and the classification affects how they offset gains.
Netting rules:
- Short-term losses first offset short-term gains. Since short-term gains are taxed at your ordinary income rate (up to 37%), each dollar of short-term loss that offsets a short-term gain saves you more in taxes than if it offset a long-term gain.
- Long-term losses first offset long-term gains. Long-term gains are taxed at preferential rates (0%, 15%, or 20%), so the savings per dollar are lower than offsetting short-term gains.
- Excess losses cross over. If you have more short-term losses than short-term gains, the excess offsets long-term gains (and vice versa).
Strategic implication: Harvesting a short-term loss to offset a short-term gain provides the most tax benefit per dollar because both sides are taxed at the highest rate. If you have the choice between harvesting a short-term or long-term loser, and both have similar loss amounts, the short-term harvest may be more valuable if you have short-term gains to offset.
This calculator uses your marginal tax bracket for the savings estimate, which applies correctly for both short-term loss offsetting short-term gains and the $3,000 ordinary income deduction. For long-term losses offsetting long-term gains, the actual savings rate would be the long-term capital gains rate (0%, 15%, or 20%), which may be lower than your ordinary income bracket.
Yes — tax-loss harvesting applies to virtually any capital asset, not just stocks. However, the rules and practical considerations differ by asset class.
Cryptocurrency:
- Crypto is treated as property by the IRS, so selling at a loss generates a capital loss that can offset gains.
- Importantly, the wash sale rule did not historically apply to crypto because it was classified as property rather than a security. This meant you could sell Bitcoin at a loss and immediately buy it back. However, legislation has been proposed to close this loophole, and rules may change. Always check the current IRS guidance.
Real estate:
- You can harvest losses on investment real estate, but not on your primary residence. Losses on your personal home are not deductible.
- REITs (real estate investment trusts) held in a taxable account can be harvested just like stocks.
Bonds:
- When interest rates rise, bond prices fall. If you hold individual bonds or bond ETFs that have declined in value, you can sell them to harvest the loss and reinvest in similar (but not identical) bond funds.
Collectibles and other assets: Losses on collectibles (art, wine, rare coins) are also deductible as capital losses if the items were held as investments. However, gains on collectibles are taxed at a higher maximum rate of 28%, which makes harvesting losses against collectibles gains particularly valuable.
Harvesting saves you tax. A DCF model tells you what to buy next.