Tax strategy for selling and rebuying stocks to reset cost basis?
I've been sitting on some stocks for years now with pretty substantial unrealized gains, but I've also accumulated a bunch of losses that I've been carrying forward each tax season. I'm considering selling off my winning positions now and using those carried-over losses to offset the capital gains. Then I'd just buy the stocks right back since I believe in them long-term anyway. My thinking is this would "reset" my cost basis to today's higher price, so when I eventually sell them years from now, I'd have less taxable gain since I repurchased at a higher price point than my original buy-in. Does this tax strategy actually work? Or am I missing something? And is there some waiting period required between selling and repurchasing the same stocks? I want to make sure I'm not violating any IRS rules while trying to optimize my tax situation.
27 comments


Carmen Ruiz
You need to be careful with this strategy because of the wash sale rule. The IRS doesn't allow you to claim a loss on a security if you buy the same or "substantially identical" security within 30 days before or after selling at a loss. However, in your case, you're planning to sell stocks with unrealized gains, not losses. The wash sale rule doesn't apply when you sell at a gain. So technically, you could sell your appreciated stocks, recognize the gains, use your carried-over losses to offset those gains, and then immediately repurchase the same stocks to establish a new, higher cost basis. But remember that any net gains that exceed your carried-over losses will be taxable. Also consider transaction costs and the potential for price movement between selling and buying back.
0 coins
Andre Lefebvre
•So if I understand correctly, the wash sale rule only applies to losses, not gains? So I could sell a stock that's up 50% and buy it back immediately with no problem?
0 coins
Carmen Ruiz
•That's exactly right. The wash sale rule only applies when you're trying to claim a tax loss. It was designed to prevent people from selling losers just to harvest tax losses and then immediately buying back the same position. If you're selling at a gain, the IRS has no problem with you immediately rebuying because you're not avoiding any taxes - you're actually realizing taxable gains. So you can sell winners and rebuy them even on the same day if you want to reset your cost basis higher.
0 coins
Zoe Alexopoulos
I tried using https://taxr.ai when I was doing something similar last year. I uploaded my brokerage statements and it helped me identify which positions made the most sense to sell based on my tax situation. It considers your loss carryovers automatically along with your current year gains/losses to optimize the tax outcome. One thing I learned is that it's not always best to reset your entire portfolio - sometimes it makes more sense to be selective about which positions to reset. The tool really helped me figure out the most tax-efficient approach.
0 coins
Jamal Anderson
•How does it handle more complex situations? Like if I have some stocks in a taxable account and others in an IRA, can it help optimize across different account types?
0 coins
Mei Wong
•Does taxr.ai connect directly to brokerages or do you have to manually upload statements? Also wondering how accurate it is with tracking your cost basis compared to what your broker reports.
0 coins
Zoe Alexopoulos
•It handles complex situations really well by analyzing each account separately and then providing an overall strategy. You can upload documents from different account types and it will respect the tax treatment of each (taxable vs. tax-advantaged). You don't need to connect your brokerage directly - you just upload your statements or transaction history and it processes them automatically. In my experience, it was extremely accurate with cost basis calculations. It matched what my broker had on record but also gave me a clearer picture of my overall tax situation across all accounts.
0 coins
Jamal Anderson
Just wanted to update after trying taxr.ai based on the recommendation here. It was actually super helpful for my situation! I had a mix of some big winners from 2019-2020 and some decent losses from the 2022 downturn that I'd been carrying forward. The tool showed me exactly which positions made sense to sell and rebuy, and which ones I should just keep holding. The analysis saved me from making a big mistake - I was going to reset everything, but it turns out that would have triggered unnecessary taxes on some positions where my carried-over losses wouldn't have fully offset the gains. Ended up saving about $3,200 in taxes I would have unnecessarily paid if I'd gone with my original plan. Definitely changed my approach to tax-loss harvesting.
0 coins
QuantumQuasar
I tried calling the IRS to get clarification on this exact strategy last year and spent literally 3+ hours on hold before giving up. Then I found https://claimyr.com which got me through to an actual IRS agent in about 20 minutes! You can see how it works in this video: https://youtu.be/_kiP6q8DX5c The agent confirmed what others are saying here - wash sale rules only apply to losses, not gains. They also told me to keep good records of my original purchase dates so I could properly calculate long-term vs short-term capital gains on the sales.
0 coins
Liam McGuire
•Wait, there's a service that actually gets you through to the IRS? That sounds too good to be true. Does it really work or is it just another scam taking advantage of desperate taxpayers?
0 coins
Amara Eze
•How exactly does this work? I don't understand how some random service can magically get you through the IRS phone tree when millions of people can't get through.
0 coins
QuantumQuasar
•It absolutely works - it's not a scam at all. They use an automated system that navigates the IRS phone tree and waits on hold for you. When an agent finally picks up, you get a call connecting you directly to that agent. It saved me hours of frustration. The technology is pretty simple when you think about it - they're just automating the hold process. I was skeptical too but was desperate after trying multiple times to get through on my own. The IRS agent I spoke with was really helpful and I got the exact clarification I needed on my tax situation.
0 coins
Liam McGuire
Just had to come back and say that Claimyr actually worked! After my skeptical comment earlier, I decided to try it since I had questions about capital loss carryovers that were similar to the original post. I had attempted to call the IRS three separate times on my own, waiting over an hour each time before giving up. With Claimyr, I got connected to an agent in about 35 minutes. The agent confirmed that I could use my carryover losses to offset gains from selling appreciated stock and then buy back those same stocks immediately to reset my basis. They also told me something really useful - I need to be careful about holding periods. If I sell stock I've owned for over a year (long-term gain) but rebuy and sell again within a year, that second sale would be a short-term gain taxed at my ordinary income rate.
0 coins
Giovanni Greco
One thing to consider with this strategy is how close you are to the end of the tax year. If you're planning to do this in December, you might want to split the transactions across year boundaries. For example, you could sell stocks to realize gains in December 2025, offsetting them with your carried-over losses. Then you could wait until January 2026 to repurchase. This way, if the market happens to drop right after your sale, you might be able to repurchase at an even better price in the new year. Just another strategic consideration on timing!
0 coins
Fatima Al-Farsi
•Wouldn't this risk missing out on potential dividends if the stocks pay them between December and January? Also what if the stocks shoot up during that waiting period?
0 coins
Giovanni Greco
•That's a valid concern about dividends - you'd want to check the ex-dividend dates for any stocks you're planning to sell to make sure you're not missing out on significant dividend payments. As for the risk of stocks shooting up, that's always a possibility and the main risk with this approach. You'd need to weigh the tax benefits against the market risk. For very volatile stocks, this strategy might not be worth it. For more stable stocks or in a sideways market, the tax benefits might outweigh the risk of missing some upside. There's no perfect strategy - it's about balancing different types of risk.
0 coins
Dylan Wright
Has anyone here considered the alternative minimum tax (AMT) implications when doing this? I did something similar last year and ended up triggering AMT unexpectedly which basically negated a lot of the tax benefits I was trying to achieve.
0 coins
Sofia Torres
•I don't think AMT would apply in most cases for this strategy. AMT typically gets triggered by things like exercising ISOs, large deductions, or certain tax preference items. Basic capital gains and losses are generally treated the same under regular tax and AMT calculations.
0 coins
GalacticGuardian
Dont forget to also consider state tax implications! Some states have different rules for capital gains. I live in California and did this strategy last year, worked great for federal taxes but CA had some quirks that meant I didn't get quite the same benefit at the state level. Check your states rules before proceeding!!
0 coins
Yuki Sato
•Thanks for this reminder! I'm in New York and hadn't even thought about state-specific rules. I'll definitely look into the NY state tax implications before I pull the trigger on this strategy.
0 coins
Jackson Carter
One additional consideration that hasn't been mentioned yet is the impact on your investment strategy timing. While the tax benefits are clear, you'll want to think about market conditions when executing this. If you're planning to sell and immediately rebuy, consider doing it during lower volatility periods or when the market is relatively stable. I made the mistake of trying this during a particularly volatile week last year and ended up rebuying at prices significantly higher than my sale price due to rapid market movement. Also, if you're dealing with large positions, consider breaking the transactions into smaller chunks over a few days to avoid moving the market against yourself, especially with less liquid stocks. The tax benefits are great, but execution matters too!
0 coins
Mei Chen
•Great point about market timing and volatility! I'm curious - when you mentioned breaking transactions into smaller chunks, do you have any rule of thumb for how to size those chunks? Like should I be thinking about daily volume as a percentage, or is it more about dollar amounts? I'm sitting on some positions that are pretty substantial relative to my overall portfolio, so I want to make sure I don't accidentally impact the stock price when I'm trying to execute this strategy.
0 coins
Zainab Omar
•@Mei Chen A good rule of thumb I ve'learned is to keep individual transactions under 10% of the stock s'average daily volume to avoid significant market impact. For less liquid stocks, I go even lower - maybe 5% of daily volume. In terms of dollar amounts, it really depends on the specific stock and market conditions. I usually break positions over $50K into at least 3-4 separate transactions spread over 2-3 days, but for highly liquid large-cap stocks you might be able to go bigger. The key is to watch the bid-ask spread and volume during your trading window. If you notice the spread widening significantly after your first sale, that s'a sign to slow down and space out the remaining transactions more. Better to take a few extra days than to lose the tax benefits to poor execution!
0 coins
Connor Murphy
Something else to keep in mind is the potential impact on your overall asset allocation. When you sell and rebuy stocks to reset your cost basis, you might be out of the market for a brief period (even if it's just minutes), and during volatile times this could affect your portfolio balance. I'd recommend reviewing your target allocation before executing this strategy. If you're planning to reset cost basis on a significant portion of your equity holdings, consider whether you need to rebalance other positions at the same time to maintain your desired asset mix. Also, make sure you have enough cash available in your account to rebuy immediately after selling. The last thing you want is to have your sale settle and then discover you can't rebuy right away due to settlement timing or insufficient funds, especially if the stock starts moving up while you're waiting.
0 coins
Grace Patel
•Great point about cash availability! I learned this the hard way when I tried to execute a similar strategy last year. I had calculated everything perfectly from a tax perspective but didn't account for settlement timing. My sales took T+2 to settle while the stock I wanted to rebuy jumped 8% during those two days, completely negating my tax savings. Now I always make sure I have enough cash on hand to rebuy immediately, or I use margin temporarily if my broker allows it. Some brokers will also let you place the buy order immediately after the sell order even before settlement, which can help minimize the time gap. Worth checking with your broker about their specific policies for this kind of strategy. The asset allocation point is spot on too - I use this as an opportunity to rebalance if I've drifted from my target allocation anyway.
0 coins
StormChaser
This is a solid tax strategy that I've used successfully myself. Just want to emphasize a few key points that others have touched on: 1. **Documentation is crucial** - Keep detailed records of your original purchase dates, sale dates, and repurchase dates. You'll need this for future tax calculations, especially to track holding periods for long-term vs short-term treatment on future sales. 2. **Consider your overall tax picture** - Make sure you're not pushing yourself into a higher tax bracket by realizing all these gains at once. Sometimes it makes sense to spread this strategy over multiple tax years. 3. **Transaction costs matter** - Don't forget to factor in brokerage fees when calculating whether this strategy makes financial sense, especially for smaller positions. 4. **Review quarterly** - I've found it helpful to reassess this strategy quarterly rather than just once per year, as your loss carryovers and current year gains/losses can change significantly throughout the year. The strategy absolutely works from a tax perspective - just make sure the execution aligns with your broader financial goals and risk tolerance. Good luck!
0 coins
Chloe Mitchell
•This is really comprehensive advice! I'm particularly interested in your point about reviewing this strategy quarterly. Do you have a specific process you follow for those quarterly reviews? Like, do you look at certain metrics or use any tools to help decide when to execute vs. when to wait? I'm wondering if there are certain market conditions or portfolio thresholds that make this strategy more or less attractive at different times of the year. For instance, would you avoid doing this during earnings season when individual stocks might be more volatile, or are there other timing considerations beyond just the tax calendar that you factor in? Also, when you mention keeping detailed records for holding period calculations - do you use any particular software or spreadsheet template for tracking all of this, or is it mostly manual record-keeping?
0 coins