Tax gain harvesting can I buy different funds when resetting cost basis

Trying to wrap my head around tax gain harvesting this year. I have some index funds sitting on big gains in my taxable brokerage and my income is low enough that I might be in the 0% long-term capital gains bracket. The plan is to sell and immediately rebuy to reset my cost basis higher so future gains are smaller. My question is about what I buy back. I know wash sale rules apply to losses, not gains, so there's no 30-day problem here. But I keep reading that people swap into "different but similar" funds when doing this. Is that actually necessary for tax gain harvesting, or can I sell my total market ETF and buy the exact same one back the next day? Does buying a different fund change anything on Form 8949 or Schedule D versus buying the same one back?

32 comments

Sold and rebuyed the same exact fund last January for this exact reason. No issue at all. Wash sale rules only kick in when you're harvesting losses, not gains. When you sell at a gain, you recognize income (or $0 at the 0% rate), your new shares get a fresh cost basis equal to what you paid, and the IRS doesn't care whether you bought the same ticker back five minutes later. On Form 8949 the sale just shows up as a normal long-term gain with the original basis in column (e) and the proceeds in column (d). The repurchase doesn't appear anywhere on that form — it's just the starting point for your new basis going forward.

Derek C.

Author

Thanks, that's the confirmation I needed. So the repurchase literally doesn't touch Form 8949 at all until I eventually sell those new shares. Makes sense.

Yep, same fund is totally fine for gain harvesting. The whole "buy something similar" advice you see everywhere is specifically for loss harvesting to dodge the wash sale rules. For gains, it's irrelevant. I uploaded my brokerage's year-end summary to taxr.ai last tax season and had it walk through which lots were long-term vs. short-term and what the gain on each would be, then check whether I'd land in the 0% bracket after the harvested gain was added to my other income. Saved me from accidentally bumping myself into the next rate tier by selling too much at once. Worth doing before you execute the trades, not after.

Derek C.

Author

That's a good point about accidentally bumping into the next bracket. I'll do that calculation first. I didn't realize the harvested gain still adds to taxable income for the bracket test.

One thing worth knowing: even though the sale is at 0% for federal, some states tax capital gains as ordinary income and don't have a 0% rate. So your state return might still owe something even if federal is clean. Doesn't change the buy-back strategy at all, just something to factor in when you decide how much to harvest.

Came here to say exactly this. I harvested a decent chunk a couple years ago and owed nothing federal but had a state bill I didn't expect. Check your state rules before you assume the whole gain is free.

Derek C.

Author

Good reminder, I'm in a state with a flat income tax so I need to account for that in my math.

The mechanics on Schedule D are straightforward for this. The sale goes in Part II (long-term, assuming you held over a year) and flows to Schedule D line 15. If the net is positive and you're in the 0% bracket, the tax on that line ends up being zero. The repurchase just establishes a new basis that shows up eventually when you sell again years from now. What actually matters most for the strategy is confirming your total income including the harvested gain stays within the 0% threshold. The IRS instructions for Schedule D walk through how the qualified dividend and capital gain worksheet works if you want to trace the exact calculation.

I tried to do this a couple years ago and accidentally sold shares I'd held less than a year. Those went into Part I of Form 8949 as short-term and got taxed as ordinary income. Completely killed the benefit for those lots. Make sure you filter to long-term lots only before you place the order — most brokers let you specify which lots to sell.

Derek C.

Author

Noted — I'll double-check holding period on each lot. My broker defaults to FIFO so I'd need to manually select the right ones.

Exactly. Switching to specific identification before you sell is the move. Once the trade settles it's usually too late to change the lot selection method.

For what it's worth I ran this same scenario last spring using Taxr — uploaded my 1099-B from the prior year and the projected statement my broker gave me, and it mapped out how the lots would appear on Form 8949, which would go to Part I versus Part II, and flagged two lots I had mentally counted as long-term that actually weren't yet. Caught it before I traded. On your actual question: buying the same fund back is completely fine for gain harvesting. Different-fund swaps are purely a loss harvesting technique.

Derek C.

Author

Really useful, especially the Part I vs Part II check. I assumed I knew which lots were long-term but I should verify the exact trade dates.

Completely agree same fund is fine here. But a small practical note: if you sell and rebuy the same ETF, your new shares start a fresh holding period the day after the repurchase trade date. So if you plan to harvest gains again next year on those same shares, you'd need to wait more than a year again before they qualify as long-term. Rotating into a similar-but-different fund doesn't get around that, because any newly purchased shares start a fresh holding period too, so plan your harvesting schedule around that either way.

Derek C.

Author

That's a nuance I hadn't considered. If I'm planning to do this annually I'll need to time each round so the new shares have been held more than a year, since a comparable fund would reset the holding period just the same.

Worth mentioning: the 0% long-term capital gains rate isn't based on just your capital gains, it's based on your total taxable income. The harvested gain gets stacked on top of your ordinary income, and only the portion that keeps you within the threshold is taxed at 0%. If part of the gain pushes you over, that portion gets taxed at the next rate. The Schedule D qualified dividends and capital gain tax worksheet is where this calculation actually happens, and it's worth tracing through it rather than estimating.

This tripped me up once. I assumed the whole gain was 0% because my wages put me under the threshold, but the gain itself pushed the top of my income over and a slice got taxed at the higher rate.

Right, the stacking order matters. Ordinary income sits at the bottom, capital gains and qualified dividends sit on top. The worksheet in the Schedule D instructions shows the exact order.

For Form 8949 specifically: each lot you sell is its own row. Column (a) is the description, (b) is date acquired, (c) is date sold, (d) is proceeds, (e) is your original cost basis. If the broker reported the basis and there are no adjustments needed, you check box D for long-term covered securities. The repurchase never touches this form at all — you're right that it only shows up when you eventually sell the new shares.

Derek C.

Author

Thanks for walking through the actual columns. Good to know box D is the right one for covered long-term shares with no adjustments.

Something I confirmed with my broker last year: when you sell and rebuy the same ETF and the second purchase is also a covered security, the broker will report the new cost basis to the IRS on a future 1099-B when you eventually sell. So you don't need to track it separately yourself as long as you stay in the same account and don't do anything that would mess up the basis reporting.

I did almost this exact exercise last fall and uploaded my brokerage statement to Taxr. It broke down each lot's holding period and estimated gain, then drafted a quick summary showing how the total gain would layer onto my other income and where I'd land on the qualified dividend and capital gain tax worksheet. Helped me decide exactly how many shares to sell without going over. And to answer your question directly: same fund is fine. No tax rule requires you to buy anything different when harvesting gains.

Derek C.

Author

Useful to hear it used that way. Knowing exactly how many shares to sell without crossing the bracket line is exactly what I need to figure out.

One scenario where buying a different fund could actually matter: if you also sell a fund at a loss and, within 30 days before or after that loss sale, you buy back shares that are substantially identical to the ones you sold at a loss, you might accidentally trigger a wash sale on the loss side. Unlikely in a pure gain-harvesting strategy but worth keeping in mind if you're doing both around the same time, in any of your accounts, including an IRA or Roth IRA or your spouse's accounts.

Good edge case. If you're doing loss and gain harvesting in the same account simultaneously you really want to map out the lot-level activity before trading.

I had a question about this for my situation specifically — I hold the same fund in both a taxable and a Roth account. If I harvest gains in taxable and rebuy, and separately I happen to sell and rebuy in the Roth, does any of that create a wash sale issue? My understanding is wash sales only apply to losses so it shouldn't matter, but the IRA wash sale rules made me second-guess myself.

Wash sales in an IRA or Roth IRA only matter when you're harvesting a loss in taxable and the IRA buys substantially identical shares. Since you're harvesting a gain, not a loss, there's no wash sale issue regardless of what the Roth does.

Thanks, that clears it up. I was overthinking the IRA connection.

Practical tip from doing this a few times: place limit orders when you sell and rebuy rather than market orders, especially for ETFs with wider spreads. You can lose some of the basis step-up to slippage if prices move between your sell and your buy. Doesn't affect the tax treatment at all, just the economics of the strategy.

There's also the question of transaction costs if your broker charges commissions, though most don't anymore for ETFs. And if you're in a fund with a purchase fee or redemption fee (some mutual funds have these), that gets added to your basis or subtracted from your proceeds respectively, and shows up in the Form 8949 numbers. Just something to check in the fund's prospectus if you're using mutual funds rather than ETFs.

Derek C.

Author

I'm using ETFs so no redemption fees. But good to flag for anyone doing this with mutual funds.

Coming back to the original question one more time: Publication 550 on irs.gov has a good section on holding periods and basis that's worth reading alongside the Form 8949 instructions. The core answer is confirmed by multiple people here — same fund rebuy is completely fine for gain harvesting, different fund is a loss harvesting strategy. You're good to proceed.