Tax-Loss Harvesting Before Year End: Dodge the Wash Sale
Tax-loss harvesting can offset gains plus $3,000 of income a year. See the math, the December 31 deadline, and the wash-sale rule that voids your loss.

Table of contents
You open your brokerage app in December and see two kinds of numbers. A few funds are up nicely. One or two positions are deep in the red, and you have been hoping they would bounce back before you had to think about them.
Those red numbers have a use. Tax-loss harvesting means selling an investment that has dropped below what you paid, so the loss can cancel out gains and trim your tax bill. The trade has to happen by December 31 to count for this year. One rule, the wash sale, can wipe out the whole benefit if you buy back too soon, and it catches people who never knew they bought anything.
This guide walks through what a loss is actually worth, the exact math on a real portfolio, the 61-day window the IRS watches, and the less obvious move for lower earners: harvesting gains at a 0% rate.
How Tax-Loss Harvesting Turns a Loss Into a Tax Cut
A loss on paper does nothing for your taxes. You only get a deduction when you sell. That sale "realizes" the loss, and the IRS then lets you subtract it from your realized gains for the year.
The order matters. Losses first offset gains of the same type: short-term losses against short-term gains, long-term against long-term. Anything left over crosses to the other type. According to the IRS capital gains topic page, you hold an asset long-term if you own it more than one year, and short-term if you own it one year or less.
Short-term gains are taxed like your paycheck. Long-term gains get the lower 0%, 15% or 20% rates. That makes a loss more valuable when it cancels a short-term gain, because it is wiping out income taxed at your full rate.
The $3,000 rule and the carryforward
If your losses beat your gains, the IRS lets you deduct the lesser of your net loss or $3,000 against ordinary income ($1,500 if you are married filing separately). Any loss beyond that is not wasted. It carries forward to the next year, and the year after, until it is used up.
A carried-over loss also keeps its character. IRS Publication 550 says a long-term loss carried into a new year still reduces long-term gains first. So a big loss you bank this December can quietly shelter gains for several years.
Worked Example: What a $7,000 Loss Is Worth
Say you are single with about $85,000 of taxable income. Under the IRS inflation adjustments for this tax year, that puts you in the 22% bracket, which runs from $50,400 to $105,700 for single filers this year.
Earlier this year you sold some stock you had owned for three years and made a $4,000 long-term gain. At 15%, that gain costs you $600 in federal tax. You also own an index fund you bought for $18,000. It is now worth $11,000, a $7,000 paper loss.
Here is what happens if you sell the fund before December 31:
- Step 1: $4,000 of the loss cancels the $4,000 gain. Tax saved: $4,000 x 15% = $600.
- Step 2: The remaining $3,000 offsets ordinary income. Tax saved: $3,000 x 22% = $660.
- Step 3: Nothing is left to carry forward, since $4,000 + $3,000 uses the full $7,000.
Total federal savings: $1,260 on one trade, before any state tax benefit. If the fund had fallen $12,000 instead, you would save the same $1,260 this year and carry $5,000 into next year.
The honest caveat: harvesting lowers your cost basis if you buy a similar fund, so you may pay more tax when you sell years later. The win is the delay, plus the chance to sell later in a lower bracket or never sell at all.
The Wash-Sale Rule Has a 61-Day Window
This is where most harvests go wrong. IRS Publication 550 says you have a wash sale if, within 30 days before or after selling at a loss, you buy substantially identical stock or securities. Count the sale day and the window covers 61 days.
The rule reaches further than your taxable account. Publication 550 lists four triggers, and the last two surprise people:
- You buy substantially identical stock or securities.
- You acquire them in a fully taxable trade.
- You buy a contract or option to acquire them.
- You acquire them for your IRA or Roth IRA.
It also counts if your spouse, or a corporation you control, buys the same stock. Picture selling a fund at a loss in your brokerage account while your spouse's automatic monthly IRA contribution buys that same fund the same week. That counts as a wash sale, even though neither of you meant to rebuy.
What happens to a disallowed loss
In most cases the loss is delayed, not destroyed. The IRS adds the disallowed loss to the cost of the new shares. Publication 550 gives an example: buy shares for $1,000, sell for $750, then rebuy within 30 days for $800. You cannot deduct the $250 loss, but your new basis becomes $1,050.
The IRA case is different. Publication 550 excludes IRA purchases from that basis adjustment, which means a loss washed by an IRA purchase is generally gone for good. Retirement accounts do not track basis the way a taxable account does.
The dividend reinvestment trap
Partial wash sales are common too. If you sell 100 shares and buy back only 25 within the window, the rule applies to 25 shares and you keep the loss on the other 75. That is how automatic dividend reinvestment bites. If your fund pays a distribution inside that window, a reinvested dividend counts as a purchase.
Turn off reinvestment on any fund you plan to sell at a loss, at least a month before and after the sale.
How to Stay Invested Without Breaking the Rule
You do not have to sit in cash for a month. The usual fix is to swap into a similar fund that is not identical. Publication 550 says stock of one corporation is ordinarily not substantially identical to stock of another, so selling one company and buying a rival is generally safe.
Funds are murkier. The IRS has never published a bright line for two index funds that track the same index from different providers, so many investors swap to a fund tracking a different index instead. Selling an S&P 500 fund and buying a total market fund is a common example. If you want a refresher on how those funds differ, see our explainer on what an exchange-traded fund holds, and why your index fund may be less diversified than you think.
A practical checklist before you hit sell:
- Check every account: taxable, IRA, Roth, 401(k), and your spouse's accounts.
- Look back 30 days for any purchase of the same holding.
- Turn off dividend reinvestment on the position.
- Pick the replacement fund before you sell, not after.
- If you want the original back, wait at least 31 days after the sale to rebuy.
Timing matters on the calendar too. Publication 550 says the holding period ends on the trade date, not the settlement date. A sale placed on December 31 counts for this year, but a market holiday or a late order can push you into January. Aim for the week before Christmas.
When You Should Harvest Gains Instead
Tax-loss harvesting assumes you pay tax on gains. Plenty of people do not. The same IRS revenue procedure sets the 0% long-term capital gains rate for taxable income up to $49,450 for single filers, $66,200 for heads of household, and $98,900 for married couples filing jointly.
If you fall under that line, the smarter December move may be the opposite. You sell a winning fund held over a year, pay nothing on the gain, and buy it right back. The wash-sale rule only applies to losses, so rebuying immediately is fine. Your cost basis resets higher, which shrinks the taxable gain when you sell in a future, higher-income year.
The 0% math for a single filer
Suppose you are single and earn $55,000 in wages. Subtract the $16,100 standard deduction set for this year, and your taxable income is $38,900. That leaves $10,550 of room below the $49,450 line.
You could realize up to about $10,550 of long-term gains and owe zero federal tax on them. Go past the line and only the excess is taxed at 15%. Remember that the gains themselves count toward taxable income, so add them before you check the threshold. Our breakdown of the new tax brackets shows where your ordinary income lands.
This works best in a year with lower pay: a gap between jobs, a sabbatical, early retirement before Social Security starts. It also pairs with losses. Someone with a large carryforward can use the 0% window and save the losses for a year when gains would be taxed.
Frequently Asked Questions
What is the deadline for tax-loss harvesting this year?
The trade must execute on or before December 31. IRS Publication 550 uses the trade date, not the settlement date, so a sale on the last trading day counts. Placing orders a week early avoids holiday closures and missed fills.
Can I buy back the same stock after tax-loss harvesting?
Yes, but wait at least 31 days after the sale. Buying it back sooner, in any of your accounts or your spouse's, triggers the wash-sale rule and disallows the loss. You can buy a different, non-identical investment right away.
Does the wash-sale rule apply to my IRA?
Yes. IRS Publication 550 lists buying substantially identical stock for your IRA or Roth IRA as a wash sale trigger. Worse, the disallowed loss is not added to your IRA basis, so it is generally lost permanently.
How much capital loss can I deduct in a year?
Losses first cancel all of your capital gains with no cap. After that, you can deduct up to $3,000 of net loss against ordinary income, or $1,500 if married filing separately. The rest carries forward to future years until it is used up.
Is tax-loss harvesting worth it for small losses?
Often, yes, if you have gains to offset or ordinary income in the 22% bracket or higher. A $1,000 loss saves $220 at 22%. If you are already in the 0% capital gains bracket, harvesting gains usually beats harvesting small losses.
Your Year-End Move: Check, Swap, Wait
The steps fit on one screen. Pull your realized gains for the year, then look for positions trading below what you paid. Sell the losers in a taxable account, swap into a similar but not identical fund, and keep every account clear of repurchases for 31 days.
If your income is low this year, flip the plan and lock in gains at 0% instead. Either way, the calendar is the hard limit. Anything you sell on January 2 belongs to next year's return.
Run your numbers this week. Then talk to a tax professional before you trade if you have stock options, large carryforwards, or accounts at several brokers, since those are where wash sales hide.
Disclaimer: This article is for informational purposes only and does not constitute financial advice. Always consult with a qualified financial advisor before making investment decisions. Past performance is not indicative of future results.
Written by
Marcus Vance
Business & Money
Writes on business and personal finance for Quick Trend Insights, translating markets, rates, and company strategy into what it costs or saves a household.
Related Articles
View all
I Bond Rate Hits 1.40% Fixed: Buy in December and January
I bond rate hits a 1.40% fixed rate through April. Buy $10,000 before December 31 and again in January to lock it twice, and see when swapping old bonds pays.

Gift Tax Exclusion Rises to $20,000: Give in December Too
The gift tax exclusion rises to $20,000 in January, but unused room expires December 31. See how giving in both months can double what you pass on tax-free.

401(k) Limit Rises to $25,500: Reset Your Percentage
See how the new 401(k) limit of $25,500 changes your paycheck math, why your percentage will not adjust itself, and how maxing out early can cost your match.
