Does selling and rebuying stock to raise cost basis trigger wash sales?

Trying to figure out if what I'm doing causes a wash sale problem. I have shares of a tech ETF I bought years ago at a low price. No loss — the position is sitting at a gain. My plan was to sell the shares, pay tax on the gain, then immediately rebuy to step up my cost basis so future gains are smaller. My broker's platform flagged the repurchase with a wash sale warning and now I'm second-guessing everything. I read that wash sales only apply to losses, but the warning spooked me. Is this actually a wash sale if I'm selling at a gain? And does the rebuy change anything about my holding period on the new shares?

26 comments

Wash sale rules only apply when you sell at a loss. Publication 550 is clear on this — the rule kicks in when you sell or trade stock at a loss and buy substantially identical stock within the 30-day window before or after. If your sale produces a gain, there is no wash sale. Your broker's warning is probably just a blanket flag on any same-security repurchase regardless of gain or loss.

Alex M.

Author

That's a relief. The warning made it sound like I was doing something wrong. So the gain gets reported normally and the rebuy just starts a new holding period?

Your broker is probably triggering that alert any time it sees a sell-then-rebuy in a short window on the same ticker. It's a CYA warning, not a determination that a wash sale occurred. You'll see it even on profitable sales because the system doesn't always filter by gain vs. loss first.

Form 8949 is where this plays out. You report the sale in Part I or Part II depending on how long you held the shares. Since you're selling at a gain and there's no wash sale, there's no code to enter in column (f) and no adjustment in column (g). Clean transaction. The rebuy starts a fresh lot with a new acquisition date and the price you paid as your basis.

Alex M.

Author

So on the new lot, the holding period starts the day after the repurchase trade date? Not the original purchase date?

Correct. The holding period carryover rule in Publication 550 only applies when a wash sale disallows a loss — the new shares inherit the old holding period in that case. Since you have a gain here, no wash sale, no carryover. Fresh start on the new lot.

I ran into almost this same question last year — gain on a sale, immediate rebuy, broker flagged it. I uploaded my 1099-B and the broker's wash sale notice to taxr.ai and had it walk through each line of Form 8949 for my situation. It confirmed the gain transaction had no code W and no column (g) adjustment, and it showed me exactly how the new lot's basis and holding period should read. Worth doing before you file if you want to be sure the form matches what actually happened.

To be precise about holding period: Publication 550 says you start counting the day after the trade date you bought and your holding period ends on the trade date you sell. Settlement date doesn't matter. So if you rebuy on the same day you sell, your new holding period clock starts the following day.

Alex M.

Author

Good to know. So if I want long-term treatment on the new lot I need to hold more than a year from that new trade date.

Worth noting that the wash sale rule can also be triggered by your spouse buying the same stock, or a corporation you control buying it. If none of that applies and you're selling at a gain, you're genuinely in the clear on the wash sale question.

Schedule D pulls in the totals from Form 8949. Your gain from the sale goes to line 1a if it's short-term with basis reported to the IRS and there are no adjustments needed — that's the Exception 1 shortcut. Otherwise it flows through Form 8949 first. Either way the number ends up on Schedule D and then on Form 1040.

Exception 1 only applies when basis is reported to the IRS and there are no adjustments. If the broker did report basis and there's truly nothing to adjust, then yes, it can go straight to Schedule D line 1a for short-term or line 8a for long-term.

One scenario where people get confused: if you had sold at a LOSS and immediately rebuked, the disallowed loss gets added to the cost basis of the repurchased shares, and the new shares also inherit the holding period of the shares you sold. That's how the wash sale rule actually bites. But that's not your situation.

Minor correction: the word is "rebought" and also the holding period carryover only applies when the wash sale rules apply. You described it right otherwise — the disallowed loss adds to the new basis and the old holding period carries over.

Your situation is actually the textbook reason people do a "step-up" or basis-raising trade on a winning position. You crystallize the gain now, pay tax on it, and your future gains are measured from the higher new basis. Completely legitimate. The IRS doesn't prohibit selling winners and rebuying.

Form 3921 and ISO rules are a different world — just flagging in case anyone reading this is thinking about doing the same thing with employee stock options rather than a regular ETF. For ISOs you don't get to just sell and rebuy to reset basis without AMT consequences at exercise. I had Taxr read through my Form 3921 and the related Form 6251 adjustment last year and it laid out the difference in AMT basis versus regular basis for each lot, which would have taken me hours to untangle on my own.

Alex M.

Author

Definitely not options in my case — just a plain ETF. But good flag for anyone else reading.

The wash sale window is 30 days before and 30 days after the sale date. So if you sold at a loss on any date, buying back within that 61-day window triggers it. Again — not your situation since you're selling at a gain. But people sometimes think the rule is only about what happens after the sale.

1099-B box 1g is specifically for wash sale loss disallowed. If your broker correctly processes the transaction as a gain sale with a rebuy, box 1g should be blank. If it somehow shows a number there, that would be worth questioning with the broker before you file.

Alex M.

Author

I'll check the 1099-B when it arrives in January. Good to know what box to look at.

For the original question about the IRA angle: the wash sale rule can also trigger if you sell stock at a loss in a taxable account and your IRA or Roth IRA buys substantially identical stock within the 30-day window. And critically, when that happens the disallowed loss does NOT get added to the IRA's basis — it's just gone. That's a costly mistake people make. I uploaded a scenario like this to Taxr last filing season and it flagged that exact issue on the worksheet it built, which I would have missed.

This is an important point. The IRA wash sale trap is real and the loss is permanently lost because IRA basis works differently. Not relevant to OP's gain situation but worth reading Publication 550 on this if anyone is doing tax-loss harvesting near year end.

To bring the thread back to basics: selling at a gain and rebuying does not trigger a wash sale. Full stop. The tax cost is the capital gains tax on the gain you recognize at sale, which is the trade-off for the higher basis going forward. Whether that trade-off makes sense depends on your current tax rate and expected future rates.

Publication 550 at irs.gov covers the wash sale rules in chapter 4 in full detail if you want to read the source directly. Topic 409 at irs.gov also covers capital gains and losses including holding period rules. Both are worth a quick read before you execute the trade so you understand exactly what gets reported.

Your broker's warning system isn't designed to give tax advice — it's a risk flag. Brokers are required to track wash sales for 1099-B reporting purposes, so their systems flag same-security repurchases broadly. The determination of whether a wash sale actually occurred is yours and your preparer's to make based on whether there was a loss.

Alex M.

Author

That explains it. The flag is for their tracking system, not a ruling on my specific trade. Makes sense now. I'll proceed with the plan and double-check the 1099-B when it comes.