Tax Loss Harvesting Calculator
Calculate how much tax you save by harvesting capital losses. See the exact offset against your gains, unused carry-forward, and savings by bracket.
Tax Details
Losses from selling underperforming positions
Ordinary income tax rate for short-term gains
Long-term rate (0%, 15%, or 20% for most)
Tax Saved
—
through loss harvesting
—
Tax Before Harvesting
—
Tax After Harvesting
—
Unused Losses (carry fwd)
Tax Savings from Loss Harvesting
Savings by Tax Bracket
Calculation Details
Embed This Calculator
Copy the code and paste it into any webpage to embed this calculator.
WordPress users: add a Custom HTML block (not the Embed block) and paste the code there.
Free to use. A small "Powered by Blucalculator" credit is appreciated but not required.
How to use this calculator
Enter your capital gains for the year (short-term and long-term separately), your potential losses from current positions, your income tax bracket, and your state tax rate. The calculator shows your estimated tax savings from harvesting those losses and your net after-tax benefit.
Tax-loss harvesting only makes sense when the tax savings exceed the costs: trading commissions, bid-ask spread, and any potential performance drag from temporarily holding substitute securities.
You have $12,000 in short-term capital gains this year and a stock position sitting at a $8,000 unrealized loss. You’re in the 24% federal bracket:
Without harvesting: Tax = $12,000 × 24% = $2,880 After harvesting $8,000 loss: Net gain = $12,000 − $8,000 = $4,000 Tax with harvest: $4,000 × 24% = $960 Tax savings: $2,880 − $960 = $1,920
What is tax-loss harvesting?
Tax-loss harvesting is the practice of selling investments that have declined in value to generate capital losses, which offset capital gains — or up to $3,000 of ordinary income per year.
You’re not permanently giving up the investment. The idea is to sell a losing position, capture the tax loss on paper, and reinvest the proceeds in a similar (but not identical) investment immediately. You maintain market exposure while booking a tax deduction.
It doesn’t eliminate taxes permanently. It defers them. The replacement investment has a lower cost basis than the original, so you’ll eventually pay taxes on a larger gain when you sell. Think of it as an interest-free loan from the IRS — you get the tax savings now and repay them later, hopefully decades from now.
The math behind tax-loss harvesting
Short-term losses offset short-term gains first. Long-term losses offset long-term gains first. Excess losses in either category then offset gains in the other category. If total losses still exceed total gains, you can deduct up to $3,000 against ordinary income. Any remaining loss carries forward to future tax years indefinitely.
The value of harvesting a short-term loss is typically higher than harvesting a long-term loss, because short-term gains are taxed at ordinary income rates (up to 37%) versus long-term rates (0%, 15%, or 20%).
If you’re in the 24% bracket and harvest a short-term loss, you save 24 cents per dollar of loss. If you’re in the 20% long-term capital gains bracket and harvest a long-term loss, you save 20 cents per dollar. The difference matters when deciding which positions to prioritize.
The wash-sale rule: the 61-day trap
The IRS does not let you sell a security at a loss and buy the exact same security right back. The wash-sale rule disallows the loss if you buy the same or “substantially identical” security within 30 days before or after the sale.
The window is 61 days total: 30 days before the sale, the day itself, and 30 days after.
If you trigger a wash sale, the disallowed loss isn’t gone — it gets added to the basis of the replacement shares. But you’ve deferred the loss until you eventually sell those shares, and if that’s in the same tax year, you may have lost the timing benefit entirely.
What “substantially identical” means:
The IRS has been vague here, but the practical rules are:
- Selling a stock and buying the exact same stock: wash sale
- Selling a fund and buying the same fund: wash sale
- Selling an S&P 500 ETF from Vanguard and buying an S&P 500 ETF from iShares: most tax professionals consider this not a wash sale, but the IRS hasn’t definitively ruled on it
- Selling a broad market ETF and buying a different-index ETF (e.g., sell S&P 500 ETF, buy total market ETF): generally not a wash sale
The wash-sale rule does not currently apply to cryptocurrency. Bitcoin and Ethereum are not “securities” under current IRS guidance, so you can sell at a loss and buy back the next day without triggering the rule. Congress has proposed closing this loophole but as of 2025 it remains open.
When tax-loss harvesting is most valuable
Large gain years. When you’ve had a year with significant capital gains — selling a business, large stock options vesting, or just a great run — harvesting losses to offset those gains saves money at the highest marginal rate.
High income years. Short-term losses saved against ordinary income in a 37% bracket are worth almost twice as much as the same loss used in a 22% bracket.
Early in the year. If you harvest losses early, you have a full year to compound the tax savings. If you wait until December, you get the savings only a few weeks earlier than if you’d waited for the next year.
When markets have dropped. A 20% market correction creates widespread losses across most equity portfolios. That’s the best time to harvest, because you can often find equivalent replacement funds easily and maintain your asset allocation.
When you have carry-forward losses already. Large unrealized losses today compound over time as the basis in your replacement positions grows. If you’ve harvested significant losses in prior years with no matching gains, they’re sitting on your return ready to offset the next large gain event.
The deferral benefit: a real number
Here’s a concrete example of why deferral matters even if you pay the same total tax eventually.
You harvest a $10,000 loss today and save $2,000 in taxes (at 20%). You invest that $2,000 in a taxable account. After 10 years at 7% annual return, that $2,000 has grown to $3,934. When you eventually sell, you owe capital gains on the growth — say $394 in taxes (at 20% on $1,934 gain). Net benefit: $3,934 − $394 = $3,540 more in your pocket.
You paid the same total tax on the underlying investment, but you had $2,000 to invest for 10 years. That’s the value of deferral.
The longer the deferral and the higher the expected investment return, the greater the benefit. At a 10% expected return over 20 years, that $2,000 grows to over $13,000 before tax.
Automated tax-loss harvesting: robo-advisors
Betterment, Wealthfront, and similar robo-advisors built tax-loss harvesting into their core service. They monitor your portfolio daily and harvest losses whenever they exceed a threshold, then immediately buy replacement securities to maintain exposure.
Betterment published research showing their tax-loss harvesting added 0.77% annualized after-tax return over 10 years for a typical taxable account. Wealthfront has published similar figures.
The automation advantage is timing. Human investors tend to harvest losses emotionally — either too early (cutting a loss before it’s strategic) or too late (holding to “get back to even”). Automation removes that friction.
The limitation is that robo-advisors use their own approved fund lists. If you have existing holdings outside their platform, they can’t coordinate across accounts. Manual harvesting with a spreadsheet or tax-aware software gives you full control.
Tax-loss harvesting across account types
Harvesting only works in taxable accounts. IRAs and 401(k)s don’t generate capital gains events — you don’t pay capital gains tax when you sell inside a tax-advantaged account, so there’s nothing to offset.
If you hold the same investment in both a taxable account and an IRA, selling the taxable account position to harvest a loss and then inadvertently buying more shares in your IRA within the wash-sale window could trigger the wash-sale rule. The IRS has ruled that wash-sale rules apply across accounts you own, including IRAs.
So if you sell Apple stock at a loss in your taxable account, don’t buy Apple in your IRA within 30 days — you’ll lose the deduction.
Limits and pitfalls
The $3,000 ordinary income deduction cap. If you have no capital gains to offset, you can only deduct $3,000 of net capital losses per year against ordinary income. With $100,000 in losses and no gains, you get a $3,000 deduction per year — it’ll take 33 years to fully use that loss. The carry-forward value is real, but delayed.
Transaction costs erode savings. If your broker charges $5 per trade and you’re harvesting a $200 loss, the transaction cost represents 2.5% of the benefit before the wash-sale window risk even starts. Focus on material positions where the tax savings dwarf the costs.
Performance drag from imperfect substitutes. If you sell your S&P 500 ETF and buy a mid-cap ETF as a substitute, your portfolio performance diverges from your intended strategy for 30+ days. In a rapidly rising market, the substitute might underperform, eating into the tax savings.
State tax considerations. Some states don’t conform to the federal $3,000 deduction or don’t recognize capital loss carryforwards the same way. California, for example, only allows $3,000 in net capital loss deductions even against California-taxed capital gains. Check your state rules.
Estimated tax payments. If you have large capital gains you’re planning to offset with harvested losses, coordinate the timing carefully. You may need to make estimated payments on the gains while waiting to harvest the losses.
When not to harvest losses
If you’re in the 0% long-term capital gains bracket, harvesting long-term losses gives you no tax benefit — you’d be saving 0% on long-term gains. Better to harvest short-term losses, which offset ordinary income at your marginal rate.
If you plan to donate appreciated stock to charity, harvesting a loss first and then donating cash is worse than donating the appreciated stock directly. You’d miss the double benefit of the charitable deduction plus avoiding capital gains.
If you’re leaving the country or moving to a no-income-tax state soon, waiting until you’re domiciled in the new state to realize gains (or losses) can change the calculus significantly.
If the investment has fallen below your original purchase price but you still believe strongly in it, the 30-day window where you can’t hold the same security creates real risk. In a fast-moving sector, you might miss a sharp recovery while waiting to repurchase.
Tax-loss harvesting as a long-term strategy
The most powerful version of tax-loss harvesting is systematic, year after year, for decades. Not cherry-picking a bad year — building a habit.
Consider this: every year the stock market has a correction of some magnitude. Even in bull markets, individual stocks and sectors rotate. There are almost always positions across a diversified portfolio that are down from their recent purchase price, ready to harvest.
An investor who harvests $5,000 per year in losses for 30 years, saving $1,000 per year in taxes at a 20% rate, and reinvests those savings at 7%: that’s over $94,000 in additional wealth from tax management alone, without taking any more investment risk.
The strategy doesn’t require market timing, stock picking, or special insight. It requires attention, a calendar reminder at year-end, and the discipline to sell and rebuy without agonizing over perfect bottoms.
Frequently Asked Questions
What is tax loss harvesting?
Tax loss harvesting is selling investments that have declined in value to realize a capital loss, which can then be used to offset capital gains and reduce your tax bill. The money can be reinvested in a similar (but not identical) security to maintain your portfolio's market exposure.
How much can I offset with capital losses?
Capital losses first offset capital gains of the same type (short-term against short-term, long-term against long-term), then against gains of the other type. After all gains are offset, up to $3,000 of net capital losses per year can be deducted against ordinary income.
What is the wash sale rule?
The IRS wash sale rule disallows a capital loss if you buy the same or substantially identical security within 30 days before or after the sale. Selling a stock at a loss and buying it back 2 weeks later triggers the wash sale rule. The disallowed loss is added to the cost basis of the repurchased shares.
Can I carry forward capital losses to future years?
Yes. Net capital losses beyond the $3,000 annual limit carry forward indefinitely. If you have $15,000 in net losses this year, you claim $3,000 now and carry $12,000 forward. Each future year, you apply the carried-forward losses against gains or take the $3,000 ordinary income deduction until the balance is exhausted.
Is tax loss harvesting worth it for small portfolios?
The benefit depends on your tax rate, the size of gains to offset, and transaction costs. At a 22% rate, every $1,000 in harvested losses saves $220 in federal tax. For portfolios under $50,000, the savings can still be meaningful — especially harvesting short-term losses that offset short-term gains taxed at ordinary income rates.
What types of assets qualify for tax loss harvesting?
Stocks, bonds, ETFs, mutual funds, REITs, and most other capital assets qualify. Retirement accounts (401k, IRA) are not eligible since gains and losses inside those accounts have no current-year tax consequence.
Should I harvest long-term or short-term losses first?
Short-term losses first. Short-term losses offset short-term gains taxed at your full ordinary income rate (up to 37%). Long-term gains are already taxed at the lower 0%/15%/20% rate. Applying short-term losses to short-term gains gives you the biggest per-dollar tax reduction.
How does tax loss harvesting affect my cost basis?
When you sell at a loss and reinvest in a similar security, your cost basis in the new position is your purchase price. This lower basis means a larger taxable gain when you eventually sell the replacement. The tax isn't eliminated — it's deferred. But deferral has real value because you keep the money invested and earning returns in the meantime.
Is tax loss harvesting free money?
Not exactly. Harvesting defers taxes rather than eliminating them permanently in most cases. You're moving a tax liability from today to the future. The real benefit comes from the time value of money: a tax bill deferred by 10 years is worth meaningfully less in today's dollars, especially when you reinvest the savings.
When is the deadline for tax loss harvesting?
December 31 of the tax year. US stock trades settle in one business day (T+1), so you generally need to execute the trade by December 30 to ensure settlement by year-end. Check your broker's settlement times before the last trading days of the year.
Related Calculators
Capital Gains Calculator
Calculate capital gains, tax owed, and net profit from any investment sale.
Stock Profit Calculator
Calculate your net profit or loss from a stock trade — including brokerage fees, taxes, and dividends.
ROI Calculator
Calculate Return on Investment (ROI), net profit, annualized ROI, and investment performance.
Annualized Return Calculator
Calculate annualized return (CAGR), total return %, and growth multiplier for any investment. Includes live growth chart comparing compound vs simple return.
Rate of Return Calculator
Calculate rate of return, total profit/loss, and annualized return on any investment.
Stock Average Calculator
Calculate your average stock purchase price, total cost basis, and break-even price across multiple buy orders.