Can I realize 0% long-term capital gains and immediately rebuy the stock?

Trying to figure out if I can realize 0% long-term capital gains and immediately rebuy the stock before year-end. I've got shares I've held for over a year that are sitting on a pretty significant unrealized gain. My income this year is low enough that I'd land in the 0% long-term capital gains bracket. Plan is to sell, let the gain hit at 0%, then buy the same shares back right away to step up my cost basis. I already checked that I've held these more than a year so the long-term holding period isn't the issue. What I'm not sure about is whether the wash sale rule or some other rule kills this. The wash sale rule is about losses, right? So does it even apply here? I tried reading Publication 550 but it was a little dense on this point.

33 comments

You're right that the wash sale rule only applies to losses. Selling at a gain and immediately rebuying is not a wash sale — the disallowed-loss rule under IRC 1091 simply doesn't trigger when you sell at a gain. So yes, you can sell, realize the gain at 0%, and buy the same shares back the next second. Your new cost basis is the repurchase price, which is exactly the step-up you're looking for.

Hannah A.

Author

That's the clearest confirmation I've seen. So the wash sale rule is completely off the table here because it only blocks loss disallowance, not gains. Good.

Correct. Worth saying clearly: wash sale only matters when you have a loss. Gains are entirely outside that rule. The IRS has no "wash gain" equivalent.

The mechanics work exactly as described above. Sell the shares, the long-term gain flows to Schedule D Part II, and if your taxable income stays below the threshold for the 0% rate, you owe nothing on that gain. Then buy back immediately — your new basis is the repurchase price, holding period restarts from the new purchase date.

Hannah A.

Author

The holding period restarting is the one trade-off. If the stock dips right after I rebuy and I need to sell, I'd have a short-term loss instead of a long-term one. I can live with that.

Yes and that matters a lot if the stock is volatile. You're giving up the long-term character on the new shares until you've held them another year.

One thing to actually verify before you execute: your taxable income including the gain has to stay under the threshold, not your income before the gain. The gain itself is stacked on top of your other income when figuring which rate applies. If the gain pushes you over the 0% ceiling even by a dollar, the portion above the ceiling gets taxed at the next rate. The thresholds and stacking rules are in the Schedule D instructions and Topic 409 on irs.gov.

Hannah A.

Author

This is the part I hadn't fully thought through. I'll run the numbers with the gain included before I pull the trigger.

I did this exact harvest last year. Uploaded my 1099-B and my draft Schedule D to Taxr (taxr.ai) and had it check whether the gain was sitting in Part I or Part II and confirm the holding periods lined up. It flagged one lot I thought was long-term that was actually short-term by a few days, which would have been taxed at my ordinary rate. Saved me from a surprise. The strategy itself is clean — no wash sale issue on a gain, basis steps up, holding period resets.

Hannah A.

Author

The lot-level holding period check is exactly the kind of detail I'd miss doing this manually. Good reminder to verify each lot, not just the position overall.

Confirm the strategy works federally. State taxes are a separate question — some states don't have a 0% rate on capital gains and will tax the gain regardless of your federal bracket. Worth checking your state's rules before you decide how much to harvest.

Good point. California for example taxes capital gains as ordinary income at the state level, so a 0% federal result can still come with a meaningful state bill.

The step-up in basis is the whole point of this move. You're essentially converting an unrealized gain into a realized-and-reset position without paying federal tax (assuming you stay under the threshold). After the repurchase, Form 8949 for the sale shows the original cost basis, the proceeds, and the long-term gain in Part II. The new shares just sit there with the new basis until you eventually sell them.

Hannah A.

Author

Right, and next time I sell those reacquired shares, the gain calculation starts from the new higher basis, so I've permanently reduced the future taxable gain on those shares.

What brokerage are you using? Some of them let you pick specific lots when you sell so you're sure you're getting the right shares with the confirmed long-term holding period. If yours defaults to FIFO or some other method and you have multiple lots, double check which shares it's actually selling.

Hannah A.

Author

I'm on a platform that does allow lot selection. I'll go in and specifically pick the lot I want before confirming the trade.

Yes, lot selection is critical here. If you accidentally sell a short-term lot you get ordinary rates, not 0%, and the whole plan falls apart.

Had a similar situation and wasn't sure whether the settlement date or the trade date controlled the holding period. Gave Taxr my trade confirmation and had it walk through the holding period calculation line by line for each lot. The answer: Publication 550 says the holding period for securities traded on an established market begins the day after the trade date and ends on the trade date you sell — settlement date is irrelevant. So the date you click sell is what counts.

Hannah A.

Author

Settlement date confusion was actually on my list of things to look up. Good to know trade date is what matters, not when the cash actually lands.

Worth noting: if you plan to do this across multiple accounts — say a taxable account and a spouse's account — be careful. The wash sale rules, while not triggered here on a gain, would become relevant if you ever tried to harvest a loss in one account while your spouse rebuys in another. That interaction is worth understanding before you set up any broader tax-loss harvesting plan alongside this.

Completely legitimate move. Tax-gain harvesting in the 0% bracket is a well-known planning strategy. The IRS has no waiting period rule for rebuying after a gain sale, unlike the 30-day window that creates a wash sale on a loss.

Exactly. The asymmetry is real — a 30-day window matters for losses, nothing like it exists for gains.

The AMT is worth a quick check if your income is in a certain range. For most straightforward equity positions this strategy doesn't implicate Form 6251, but if you also have ISO exercises in the same year, the AMT calculation is a separate track and long-term capital gains interact with it differently. Probably not your situation but worth ruling out.

Hannah A.

Author

No ISO exercises this year, all plain shares in a taxable account, so I think I'm clear of AMT issues here.

To confirm the specific income threshold that applies to you, the Form 1040 instructions have a qualified dividends and capital gain tax worksheet that steps through the stacking calculation (the Schedule D instructions point you to it, or to their own Schedule D Tax Worksheet if you have amounts on line 18 or 19). That's the official place to run your numbers. The rates and bracket amounts are listed right there. Don't rely on a remembered figure — the thresholds adjust annually.

When I did this two years ago I asked Taxr to read my prior-year Schedule D and confirm which lots I had already sold so I didn't accidentally double-count basis. It put the lot history in a table, matched trade dates to 1099-B entries, and I could see at a glance which positions were still open and what basis I'd carry into the next harvest. Really helped me not make a basis error when I restarted positions.

Hannah A.

Author

Keeping track of basis across lots and years is genuinely tedious. Having that laid out in a table before executing would save a lot of spreadsheet work.

If you end up with any short-term lots accidentally caught up in the sale, those go in Part I of Form 8949 (box A if basis was reported to the IRS on the 1099-B) while the long-term lots go in Part II (box D). They're taxed at completely different rates so the split matters for how your Schedule D washes out.

Yes — Part I short-term gains flow to Schedule D line 1a if they skip Form 8949 under Exception 1, or line 1b, 2 or 3 depending on the Form 8949 box checked, then to line 7. Part II long-term gains flow to line 8a, or line 8b, 9 or 10, then line 15. The rates applied are different at every step.

Executed this strategy myself in a low-income year and it worked cleanly. Sold, booked the gain on Schedule D, confirmed 0% rate applied from the tax worksheet, bought back same day. The 1099-B the next January showed the sale proceeds and original basis. New shares showed up with the new basis on my brokerage's cost basis records.

Hannah A.

Author

Reassuring to hear from someone who actually ran it through a full filing cycle. The 1099-B the following year is the moment of truth.

Final practical note: execute the sale and repurchase on separate transactions and confirm both are recorded correctly in your brokerage before year-end. If you're doing this close to December 31, make sure the sale trade date falls in the current tax year — the trade date, not settlement, is what the IRS uses, but your brokerage's year-end statements will reflect it and you want the 1099-B to match the year you intend.

Hannah A.

Author

Year-end timing is exactly when I'm planning to do this so I'll make sure both legs execute and confirm on-screen before the market closes on the last trading day.