Sell Your Winners, Pay 0% Tax, and Buy Them Right Back the Same Day. It’s the Reset the Wash-Sale Rule Can’t Touch

A quirk in the tax code lets certain investors sell a winning stock, pocket the gain tax-free, and buy it straight back without waiting a single day. Most people who qualify have no idea this window exists.

Published July 30, 2026, 9:48pm ET · 3 min read

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

Overhead shot of a person with short brown hair and teal-rimmed glasses, wearing a teal top and a silver-banded watch, seated at a white desk. They are holding a Form 1040 US Individual Income Tax Return for 2016 and using a black calculator with '36.5' displayed. A silver laptop showing a tax form, a silver pen, and a green potted plant are also on the desk. The scene is bright and highlights financial document review.
Careful review of financial documents and calculations are essential steps in building a stable income portfolio, similar to the strategy employed by the 79-year-old widow in the article. © scyther5 / Getty Images

If you own individual stocks or ETFs in a regular taxable brokerage account, you may be sitting on a tax trick most investors never touch: you can sell a winning position, pay 0% federal tax on the long-term gain, and buy the exact same share back a minute later. The wash-sale rule cannot stop you. This is called tax-gain harvesting, and it is the mirror image of the loss-harvesting move everyone talks about.

The Move Hiding in Plain Sight

Here is the reveal. The IRS taxes long-term capital gains at three federal rates: 0%, 15%, and 20%. If your taxable income lands inside the 0% band, every dollar of qualified long-term gain you realize is federally tax-free. And because the wash-sale rule under IRC Section 1091 only disallows losses when you buy back the same security inside 30 days, you can turn around and repurchase your winner immediately. Your cost basis resets to the higher price. You just erased future taxable gain without giving up your position.

The Statute That Makes It Legal

Two pieces of the tax code do the heavy lifting. IRC Section 1(h) sets the preferential long-term capital gains rates, including the 0% bracket. IRC Section 1091 is the wash-sale rule, and its text is explicit: it disallows a “loss” on the sale of stock or securities when substantially identical shares are acquired within 30 days before or after. Gains are not mentioned because they do not need to be. The IRS is happy to collect tax on a gain you voluntarily trigger. There is no waiting period, no cooling-off window, no repurchase penalty.

Who Actually Qualifies in 2026

Eligibility is about taxable income, not gross income. For 2026, the 0% long-term capital gains bracket applies when your taxable income (after the standard deduction or itemized deductions) is at or below roughly the IRS-published 2026 thresholds for single, head-of-household, and married-filing-jointly filers. Layer on the 2026 standard deduction of about the 2026 standard deduction for single and joint filers, and a married couple can have gross income well into six figures before the 0% window closes.

Sweet spots include retirees drawing modest income before Social Security or RMDs kick in, semi-retired couples, sabbatical takers, graduate students with brokerage accounts, business owners in a low-income year, and anyone between jobs. If you are a W-2 earner making $150,000, this trick is not for you. Your gains will fall into the 15% or 20% bracket.

How to Run the Play

  1. Estimate your 2026 taxable income. Include wages, interest, dividends, IRA withdrawals, and any short-term gains. Subtract your standard or itemized deduction.
  2. Find the gap between that number and the top of the 0% bracket. That gap is exactly how much long-term gain you can realize tax-free at the federal level.
  3. Identify positions held longer than one year with embedded gains. Short-term gains do not qualify. They are taxed as ordinary income.
  4. Sell only enough shares to fill the gap. Anything above it spills into the 15% bracket.
  5. Rebuy the same shares immediately. Your new cost basis equals today’s price. You have permanently reset the taxable gain clock without leaving the market.

The Catch Nobody Warns You About

The realized gain still counts as income for almost every other calculation. It raises your Adjusted Gross Income, which can:

  • Trigger or increase taxation of Social Security benefits.
  • Shrink or eliminate your ACA premium tax credit.
  • Push future Medicare Part B and D premiums up through IRMAA.
  • Phase out education credits, the saver’s credit, and student loan interest deductions.
  • Create a state tax bill. Most states tax capital gains as ordinary income and do not honor the federal 0% rate.

One more trap: the bracket is a cliff at the margin, not on the whole gain. If you overshoot by $5,000, only that $5,000 gets taxed at 15%. But if you overshoot by a lot, the gain itself can push you across the line, so run the math (or your tax software) before you click sell. With the 10-year Treasury yielding 4.65% and cash finally paying you something, some investors are already rebalancing. If you qualify, reset your basis first. It is the cheapest tax move you own.

Contact [email protected] for any questions or corrections.

Michael Williams

I am a long time investor and student of business, and believe finding good companies that can become great investments is the best game on earth. After 20 years of writing and researching the public markets it is clear that individuals have never had more tools and information to take control of their financial lives. From ETFs and $0 commissions to cryptos and prediction markets there has never been a greater democratization of access to investing. 

I write to help people understand the investments available to them so they can make the best choice for their portfolio, whether they're starting out or looking for income in retirement. 

All articles →