Should I harvest long-term gains every year to reset cost basis?

Been thinking about this strategy for a while. I have a taxable brokerage account with positions I bought 3-5 years ago that are sitting on significant unrealized long-term gains. Someone told me I should harvest long-term gains every year — sell and immediately rebuy — to reset my cost basis higher, so future gains are smaller. The logic makes sense to me but I want to understand what I'm actually triggering by doing this. I know the wash sale rules apply to losses but does the IRS care if I sell at a gain and rebuy the same stock? And is this worth doing if I'm in a bracket where long-term capital gains rates are low or zero? Already looked at Schedule D and Form 8949 but I'm not sure how to think about whether the math actually works in my favor.

35 comments

Gain harvesting is a real strategy and there's no wash sale issue — wash sale rules only apply when you sell at a loss. Selling at a gain and immediately rebuying is completely fine under the IRS rules. What you're doing is recognizing a long-term capital gain now, paying tax on it at whatever long-term rate applies to your income, and stepping up your basis to the repurchase price. Future gains will then be measured from the new, higher basis.

Naomi H.

Author

Thanks, that clarifies the wash sale piece. So the question is really just whether the tax I pay now is worth the smaller tax later — which depends on my current and future rates.

The strategy only makes mathematical sense if you expect your long-term capital gains rate to be higher in the future than it is today, OR if you need the lower future gain for some other reason (like qualifying for a deduction phaseout or keeping income below a certain threshold). If your rate today and in the future are the same, you've just moved the tax earlier with no benefit — you lose the deferral advantage.

Naomi H.

Author

Same rate now and later is probably my situation, and I hadn't fully worked through what that means. I'm not sure my rate changes much. So I might be giving up deferral for nothing.

Deferral is genuinely valuable even if the rate stays the same. The money you would have paid in tax today keeps compounding until you sell. That's real money over a 10-20 year horizon.

I ran this exact scenario last year. Uploaded my brokerage statements and Schedule D into taxr.ai and it mapped out which lots were long-term, estimated the gain if I sold and rebought, and drafted a comparison showing what I'd owe now versus what I'd owe holding another five years at the same rate. Really helped me see the deferral loss in dollar terms. The wash sale check was part of it too — confirmed no issue on the gain side.

Naomi H.

Author

Good to know it can do that kind of side-by-side. I'll try it with my own statements before I decide anything.

One thing that matters a lot here: whether you're in the 0% long-term capital gains bracket. If your taxable income falls below the threshold for your filing status, you can harvest long-term gains and pay literally zero federal tax. That's the one scenario where this strategy is almost always worth doing — you reset basis for free.

Naomi H.

Author

Worth checking. I think I might be close to that threshold this year. I'll look at my projected income.

Agreed, the 0% bracket scenario is the clearest case. The instructions for Schedule D point to the Qualified Dividends and Capital Gain Tax Worksheet, which is where the actual rate calculation happens. Worth running that before deciding.

Keep in mind that harvested gains show up on Form 8949 and flow through Schedule D regardless of how you use the strategy. Each sale is a separate transaction — date acquired, date sold, proceeds, adjusted basis, long-term in Part II with box D, E or F depending on what your 1099-B shows. The IRS sees every lot.

There's also an estate planning angle. If you hold appreciated stock until death, the beneficiary generally gets a stepped-up basis to fair market value at the date of death under Publication 551. So if you're planning to hold forever and leave it to heirs, harvesting gains and paying tax now might actually be worse than just holding.

That's a real consideration. The step-up at death is one of the strongest arguments against gain harvesting in taxable accounts if you don't need the liquidity.

Naomi H.

Author

Not planning to hold forever, but good to know. Changes the calculus a bit depending on the time horizon.

Another angle: state taxes. If you're in a state with a high income tax rate that doesn't distinguish between short- and long-term capital gains, the combined federal-plus-state rate on the harvested gain could be significantly higher than you're mentally pricing in. The federal 0% bracket doesn't eliminate the state tax.

Naomi H.

Author

Good point. My state taxes capital gains as ordinary income so that's real money even if the federal rate is low.

Does this strategy interact with the net investment income tax? Asking because I've seen my AGI get close to the threshold where that 3.8% kicks in.

Yes, harvested gains add to net investment income. If the gain pushes your modified AGI above the threshold for your filing status, the net investment income tax applies to the lesser of your net investment income or the amount over the threshold. The Form 8960 instructions have the specifics.

So I need to model the total marginal rate including 3.8% before deciding this is worth it. That changes things.

Went through this decision last spring for my own portfolio. I gave Taxr the actual 1099-B from the prior year alongside a list of my current open lots and it checked whether my projected gain would stay in long-term territory and flagged which positions were borderline short-term. Helped me sequence the sales correctly so I wasn't accidentally recognizing short-term gains instead of long-term ones. Worth doing before you sell anything.

Naomi H.

Author

Sequencing is something I hadn't thought about. Some of my positions are right at the one-year mark. I'll check the acquisition dates carefully.

The holding period rule is worth repeating here: for securities traded on an established market, the holding period begins the day after the trade date you bought and ends on the trade date you sold. Not the settlement date. So if you're trying to push a position into long-term territory, count from the trade date, not when the shares settled in your account.

This matters a lot in practice. I've seen people miscalculate by a day and end up with a short-term gain at their ordinary rate when they thought it was long-term.

Naomi H.

Author

Thanks — will count from trade dates. I'll pull the trade confirmations, not just the account statements.

If you do harvest gains and immediately rebuy, make sure your broker records the new cost basis correctly. The repurchase price becomes your new basis in the new lot. The old lot is closed out. Your 1099-B next year should reflect the proceeds from the sale; your basis in the new shares should update to what you paid. Worth verifying in the account the next day.

I had a year where I did this in multiple accounts and it got confusing fast — different lots, different acquisition dates, some covered some not. I uploaded everything to Taxr and it went through each lot on my 1099-B, matched each one to Form 8949, flagged where the basis shown didn't match what I calculated, and drafted the column (g) adjustments I needed. Saved me from filing with wrong numbers.

Naomi H.

Author

With multiple positions, I could end up in that same mess pretty easily. Good to know it can work through the lot-by-lot detail.

To put the core question directly: gain harvesting every year is not automatically good or bad. It's a tool that works in specific conditions — 0% rate bracket, expecting higher rates later, or simplifying a complex lot structure. Outside those conditions you're accelerating tax and losing the time value of deferral. Run the actual numbers for your situation before treating it as a default annual move.

Naomi H.

Author

This is a helpful framing. I'll run the numbers on my projected income and rate before doing anything this year.

The holding period rules and how gains and losses are classified are laid out in Publication 550 at irs.gov. Topic 409 on the IRS site covers the limit on deducting capital losses and how the unused loss carries forward, not the long-term versus short-term rate structure — the rate on the gain is figured with the Qualified Dividends and Capital Gain Tax Worksheet. Those together give you the framework for evaluating whether the gain you'd harvest is actually taxed at a favorable rate.

Worth noting: if you have capital loss carryforwards from prior years, harvesting gains can be a way to absorb them without paying tax on the gain. The carryforward offsets the harvested gain on Schedule D. If you have unused losses sitting there, that changes the math completely in favor of harvesting.

This is probably the strongest practical case for gain harvesting outside the 0% bracket. Using a carryforward to absorb a gain costs you nothing in current tax.

Naomi H.

Author

I do have a small carryforward from 2022. That's actually a good reason to harvest some gain this year specifically.

One last check: if you're in an account with both short- and long-term lots in the same stock, make sure you specify to your broker which lot you're selling. If you don't, the broker will use their default method (often FIFO) and you might not sell the lot you intended. You can usually specify lot at the time of the trade or shortly after, but confirm with your broker what window they give you.

Naomi H.

Author

Good reminder. I'll make sure I know the broker's default and change it if needed before placing the sell order.