At 63, He Sells a Stock Fund in His Brokerage Account at a $40,000 Loss to Cut His Taxes Before Dec. 31, Then Buys It Back in His IRA a Week Later. The IRS Erases the $40,000 Loss for Good
This post may contain links from our sponsors and affiliates, and Flywheel Publishing may receive compensation for actions taken through them.
Picture a single 63-year-old retiree who sold a winning stock position in his taxable brokerage account earlier this year and locked in a $40,000 long-term gain. In mid-December he sells a broad stock index fund sitting at a matching loss to cancel that gain, and a week later he buys the same fund in his rollover IRA, which holds the equities he moved out of his 401(k), so he never leaves the market. That one purchase turns a planned tax saving into a permanent loss.
Why an IRA Repurchase Wipes Out the Loss Forever
The wash-sale rule in 26 U.S.C. § 1091(a)[1] blocks a loss deduction when you acquire substantially identical securities in a certain window. That window starts 30 days before the date of such sale[1] and ends 30 days after it. The new year resets nothing. A December sale followed by a January buyback can still be a wash sale. The rule also reaches every account you and your spouse control, including IRAs.
An ordinary wash sale only delays the deduction. IRS Publication 550 adds the disallowed loss to the cost of the replacement shares, which “postpones the loss deduction until the disposition of the new stock or securities.”
An IRA purchase gets no such rescue. Publication 550 lists buying substantially identical stock for your individual retirement arrangement (IRA) or Roth IRA as its own trigger, then removes that case from the basis adjustment. Revenue Ruling 2008-5 confirms the loss is disallowed and the owner’s basis in the individual retirement account or Roth IRA is not increased[2]. Fidelity puts it plainly: “The disallowed loss is effectively forfeited, not deferred.” Selling the IRA shares later recovers nothing, because withdrawals from an IRA are taxed as ordinary income no matter what the shares cost.
The ruling names IRAs and Roth IRAs specifically. Purchases inside a 401(k) fall outside its text, which leaves them a gray area, so treat a 401(k) buy of the same fund with the same care.
This is one of those subtle IRS rules that costs real money without ever showing up as a penalty line. We cataloged it alongside eight others in a free retiree tax trap guide worth scanning before year-end.
A $6,000 Tax Bill He Thought He Had Erased
With the loss gone, the full gain stays on his return. A single filer pays 15% on long-term gains once taxable income passes $49,450, so he owes about $6,000 in federal tax he meant to cancel.
Even without gains to offset, the forfeited loss costs money. Under 26 U.S.C. § 1211(b)[3], net capital losses can offset up to $3,000[3] of ordinary income each year, and the rest carries forward. A loss this size could have offset his ordinary income for years.
Medicare Bill That Shows Up When He Turns 65
At 63, the tax hit arrives by a side door. Medicare’s income-related monthly adjustment amount (IRMAA) uses modified adjusted gross income (MAGI) from the tax year two years prior. That makes his 2026 return the one that sets his 2028 premiums, the year he turns 65 and enrolls.
Say his MAGI is $95,000 before the gain. A clean harvest keeps him under the single-filer IRMAA threshold of $109,000. With the gain left standing, his MAGI rises to $135,000, which puts him in the first surcharge tier.
Under the current schedule, that tier adds $81.20 a month to Part B and $14.50 to Part D, or roughly $1,148 for the year. The 2028 thresholds will be adjusted for inflation, so read this figure as an example that lands on top of the federal tax bill.
Three Checks Before You Harvest a Loss This December
- Check every account across the full window. Before you sell, look through your IRA, Roth IRA, 401(k), and your spouse’s accounts for purchases of the same fund in the prior 30 days. For the 30 days after the sale, turn off dividend reinvestment and automatic purchases of that fund. One reinvested dividend in an IRA can disallow the loss on that many shares.
- Keep the replacement in a different fund or in the taxable account. To stay invested, buy a fund that tracks a different index right away. If you want the original fund back, buy it in the brokerage account after the window closes. Inside an IRA, a matching purchase is safe starting on day 31.
- Check your 2026 MAGI against $109,000 ($218,000 for joint filers) before December 31. Anyone within a few thousand dollars of a tier can protect both this year’s tax bill and their 2028 premiums with a clean harvest. If a Roth conversion or large IRA withdrawal is also planned for this year, the right planner can earn their fee on that coordination alone.
Contact [email protected] for any questions or corrections.








