They’ll Sell $90,000 of Stock in December and Buy It Back the Same Afternoon. Everyone Says That’s a Wash Sale. That Rule Only Applies to Losses, and Their $60,000 Gain Will Be Taxed at 0%

Published November 28, 2026, 1:08pm ET · 4 min read

Life After Work desk. Editor: David Beren.

This post may contain links from our sponsors and affiliates, and Flywheel Publishing may receive compensation for actions taken through them.

A man wearing glasses and a blue and white plaid shirt sits at a wooden table, holding and reviewing white papers. A woman in a white hooded sweatshirt stands to his right, leaning over and pointing at a document on the table. A black laptop is closed to their left, and a dark binder with more papers is also on the table. The background is a dimly lit interior of what appears to be a kitchen or dining area.
A couple carefully reviews financial documents, potentially weighing options for funding education costs while navigating complex retirement account rules. Understanding these differences can help avoid unnecessary penalties. © John Keith / Shutterstock.com

Tax-gain harvesting lets investors in a low-income year sell appreciated stock, pay 0% on the long-term gain, and buy the shares right back. With this definition in mind, consider a retired couple living on Social Security plus a small IRA withdrawal.

In December, they plan to sell $90,000 of a stock that has gone up for decades, which locks in a $60,000 long-term gain, and then buy the same shares back that afternoon. A friend warns them about the wash sale rule, but the friend has it backward.

Why the Wash Sale Rule Only Applies to Losses

The wash sale rule stops a single thing. You can’t deduct a loss if you buy substantially identical stock within 30 days[1] before or after the sale. A sale at a gain falls completely outside it. You report the gain, and the shares you buy back get a brand-new cost basis equal to what you paid that afternoon.

When you eventually sell those shares, the IRS measures your profit from that higher starting point. Decades of growth get booked at 0%, and your next tax bill shrinks.

Where the Rule Sits in the Tax Code

You’ll find the rule in 26 U.S.C. § 1091(a)[1], which opens with “In the case of any loss claimed to have been sustained”[1]. The IRS says the same thing in Publication 550 (2025): “A wash sale occurs when you sell or trade stock or securities at a loss”. Both sources build the whole rule around losses. The 0% rate comes from 26 U.S.C. § 1(j)(5). Rev. Proc. 2025-32 adjusts it for inflation and sets the 2026 maximum zero rate amount at $98,900 for married couples filing jointly.

Who Qualifies for the 0% Rate?

You need to hold shares for more than a year in a regular taxable brokerage account. Your total 2026 taxable income, including gains, must stay at or below $98,900 on a joint return. That usually means early retirees, people in a gap year between jobs, and retirees who haven’t started big IRA withdrawals. High earners don’t qualify, and neither do short-term shares or stock held inside an IRA or 401(k).

Take the couple from the headline as a labeled example. For the whole gain to stay at 0%, their other taxable income has to be about $38,900 or less. Taxable income is what’s left after deductions. In 2026, the joint standard deduction is $32,200. Each spouse who is 65 or older or blind brings $1,650.

The One Big Beautiful Bill also created a $6,000 senior deduction for each qualified individual. It applies to tax years beginning after December 31, 2024, and runs through 2028.

How to Harvest Your Gain Before December 31

  1. Estimate your 2026 taxable income without the sale. Count pensions, IRA withdrawals, interest, and the taxable part of Social Security, then subtract your deductions. Ordinary income fills the brackets first, and the gain stacks on top.
  2. Figure your room. The space between that estimate and $98,900 is the starting point. Recalculate taxable Social Security and income-sensitive deductions after adding the gain to determine how much qualifies for 0%.
  3. Tell your broker exactly which long-term lots to sell. Pick the ones with the biggest gains.
  4. Sell and buy back before the year ends. Same-day repurchase is fine.
  5. Check your brokerage’s cost-basis records to confirm the newly purchased shares reflect the higher basis.

Hidden Costs That Can Shrink Your Tax-Free Gain

State income tax is the first cost, since the federal 0% rate stops at the state line, and most states with an income tax count the gain as income.

Social Security benefits can also become taxable. Under 26 U.S.C. § 86[2], the gain counts toward the income test. For joint filers, benefits start becoming taxable above $32,000, and up to 85%[2] can be taxed above $44,000. Taxable benefits count as ordinary income, so they eat into your 0% room. A gain sized right to the dollar can spill partly into the 15% bracket.

Medicare has a built-in delay, as premium surcharges use your income from 2 years prior under 20 CFR 418.1135(a), so a 2026 harvest can raise insurance premiums two years later. In 2026, the joint Part B surcharge starts above $218,000 of modified adjusted gross income. Unlike the capital gains bracket, Medicare’s calculation uses income from before standard and itemized deductions.

The holding period also starts over. The bought-back shares begin a new one-year clock. Under 26 U.S.C. § 1223(3)[3], the old holding period carries over only in a wash sale, and a sale at a gain isn’t one. Sell the new lot within a year and any profit is short-term.

Finally, there’s a 3.8% net investment income tax, but it only applies above $250,000 of joint income. That’s well above anyone in the 0% bracket.

For families whose income dropped this year, the room under $98,900 before December runs out, setting how much gain can be taken at 0%. A gain taxed at 15% later could cost nothing now.

Contact [email protected] for any questions or corrections.

David Beren

David Beren has been a Flywheel Publishing contributor since 2022. Writing for 24/7 Wall St. since 2023, David loves to write about topics of all shapes and sizes. As a technology expert, David focuses heavily on consumer electronics brands, automobiles, and general technology. He has previously written for LifeWire, formerly About.com. As a part-time freelance writer, David’s “day job” has been working on and leading social media for multiple Fortune 100 brands. David loves the flexibility of this field and its ability to reach customers exactly where they like to spend their time. Additionally, David previously published his own blog, TmoNews.com, which reached 3 million readers in its first year. In addition to freelance and social media work, David loves to spend time with his family and children and relive the glory days of video game consoles by playing any retro game console he can get his hands on.

All articles →

Sources

  1. 26 U.S.C. § 1091 — Loss from wash sales of stock or securitiesOffice of the Law Revision Counsel, U.S. House of Representatives
  2. 26 U.S.C. § 86 — Social security and tier 1 railroad retirement benefitsOffice of the Law Revision Counsel, U.S. House of Representatives
  3. 26 U.S.C. § 1223 — Holding period of propertyOffice of the Law Revision Counsel, U.S. House of Representatives