A 67-year-old retiree receives $30,000 a year from Social Security and withdraws another $5,000 from a traditional individual retirement account (IRA). She also owns stock bought years ago for $15,000 that is now worth $55,000. She sells it, realizes a $40,000 long-term gain, and immediately buys the shares back at the higher price. The move resets her cost basis and places the gain inside the 0% federal capital-gains bracket. Because she sold at a profit, the wash-sale restriction that applies to losses does not interfere.
The gain itself remains taxed at 0%. Then her software places $25,500 of Social Security on the taxable side of the return. The stock sale was free. The income it awakened was not.
A 0% Gain Is Still Income
The 0% capital-gains rate does not remove a gain from the tax return. It simply applies a 0% rate after the gain has joined the rest of the year’s income. Social Security benefits follow their own calculation. For a single filer, the IRS begins taxing part of the benefit once combined income exceeds $25,000. Above $34,000, as much as 85% can become taxable. Joint filers face corresponding lines of $32,000 and $44,000.
Combined income starts with income other than Social Security, adds tax-exempt interest, and then adds half of the annual benefit. Long-term capital gains count even when their own federal rate is zero. That is the trap. Tax-gain harvesting looks only at the capital-gains bracket. Social Security taxation watches the same gain from another window.
How Her $40,000 Gain Pulls the Trigger
Her calculation begins with the $40,000 stock gain and $5,000 individual retirement account withdrawal. Half of her $30,000 Social Security benefit adds another $15,000. Her combined income reaches $60,000.
At that level, the federal formula pulls the maximum 85% of her benefit into taxable income. That means $25,500 of the $30,000 she received from Social Security now appears on the return. Taxable does not mean the government takes 85% of her check. It means $25,500 is treated as ordinary income and taxed at her applicable rate. The distinction matters, but so does the bill.
Why the Stock Gain Can Remain at 0%
The math sounds contradictory until deductions enter. For 2026, the 0% long-term capital-gains rate extends through $49,450 of taxable income for a single filer. This retiree can claim the $16,100 standard deduction, an additional $2,050 because she is over 65, and the temporary $6,000 senior deduction because her income remains below its phaseout line. After those deductions, her taxable income lands around $46,350. The entire $40,000 gain still fits inside the 0% capital-gains range.
The remaining $6,350 is ordinary taxable income created largely by the Social Security inclusion. At a 10% rate, the federal bill is approximately $635. Without the gain, none of her benefit would have been taxable in this example. The 0% bracket did exactly what it promised. It charged nothing on the stock gain. It made no promise about the income the gain pulled in behind it.
Medicare Is a Different Line
This particular sale does not raise her Medicare premiums. Her modified adjusted gross income (MAGI) remains well below the 2026 first surcharge line of $109,000 for a single filer. A larger gain, Roth conversion, or retirement-account withdrawal could cross that line and create a Medicare surcharge two years later. It did not happen here, and the two consequences should not be treated as automatic companions.
Her bill comes from taxable Social Security, not Medicare.
What to Calculate Before Selling
Three numbers matter more than the size of the 0% capital-gains bracket:
- Measure the gain, not the sale proceeds. Subtract the stock’s cost basis and selling expenses from the expected proceeds before deciding how much income the transaction creates.
- Calculate combined income before completing the sale. Add other income, tax-exempt interest, and half of the annual Social Security benefit. Then estimate how much of the benefit the proposed gain would make taxable.
- Compare several harvest sizes. Realizing $15,000 this year and another amount next year may produce a better result than filling the entire 0% bracket at once. Qualified Roth withdrawals or the return of investment principal can provide spending money without entering combined income.
Tax-gain harvesting remains a useful strategy. For someone already collecting Social Security, however, the available room is not simply the distance to the top of the 0% bracket. The gain was tax-free. It was not invisible. She raised the basis on her stock and pulled 85% of her Social Security into taxable territory along the way.
Contact [email protected] for any questions or corrections.