Can I offset ESPP capital gains with tax loss harvesting like regular cap gains?
So I've been working at my company for about 3 years now and I'm in their ESPP program where I get a 15% discount on company stock. I finally sold some shares last month and made about $4,200 in capital gains. I also have some other investments that aren't doing so hot - down about $5,800 this year. I'm wondering if I can use tax loss harvesting from my regular investment account to offset the capital gains from my ESPP stock sales? Does it work the same way as offsetting regular capital gains, or are there special rules because it came from an employee stock purchase plan? Also, do I need to be concerned about that discount I received when purchasing the shares? Does that get treated as income or is it just rolled into the capital gains calculation? This is my first time dealing with this and I want to make sure I don't mess up my 2025 taxes. Any advice would be really appreciated!
19 comments


Emma Davis
Yes, you can offset capital gains from ESPP sales with losses from other investments through tax loss harvesting. The IRS treats capital gains as capital gains regardless of the source, so your ESPP gains and regular investment losses can offset each other. However, there's an important distinction with ESPPs. The discount you received (15%) is considered compensation income, not capital gains. Your employer should report this discount amount on your W-2 as ordinary income in the year you purchased the shares. The capital gains portion only applies to any appreciation above your purchase price (which includes the discount). For example, if the market price was $100 and you bought at $85 (15% discount), that $15 discount is reported as income. If you later sell at $120, your capital gain is $35 ($120 - $85), not $20.
0 coins
CosmicCaptain
•Wait I'm confused... so if the discount is already reported as income on my W-2, does that mean I pay tax on it twice? Once when I buy the shares and then again when I sell them?
0 coins
Emma Davis
•You don't pay tax twice on the same money. The discount is taxed as ordinary income when you purchase the shares (reported on your W-2). When calculating your capital gains, your cost basis is the discounted price you actually paid, so you're only paying capital gains tax on the appreciation that occurred after purchase. For tax loss harvesting, you can offset your ESPP capital gains with capital losses from other investments, up to $3,000 in excess losses against ordinary income. Any additional losses can be carried forward to future tax years.
0 coins
Malik Johnson
I was in a similar situation last year and found taxr.ai super helpful for sorting through my ESPP sale documentation. My employer's statements were confusing as hell, mixing up the discount reporting with the actual sale proceeds. I uploaded my documents to https://taxr.ai and it automatically identified which portions were ordinary income vs. capital gains - saved me from a major headache trying to figure out the correct cost basis. Their system also flagged that I could do exactly what you're asking about - use losses from my other investments to offset the ESPP gains. Helped me save almost $900 in taxes!
0 coins
Isabella Ferreira
•Does it work with all the major brokerages? I have my ESPP through Fidelity but my regular investments are with Vanguard. Can it pull everything together?
0 coins
Ravi Sharma
•Sounds interesting but I'm not great with uploading financial docs online. Is there an easier way? Can I just take pictures of my statements or something?
0 coins
Malik Johnson
•It works with all major brokerages including Fidelity and Vanguard. You can either connect your accounts directly or upload statements - whatever you're comfortable with. They support both types of integration, which was helpful because my company uses a smaller brokerage for the ESPP. For those concerned about uploading documents, yes, you can actually just take pictures of your statements with your phone. They have this document scanning feature that works surprisingly well. It extracts all the important numbers even from photos, which I found super convenient when I couldn't find some of my digital statements.
0 coins
Ravi Sharma
Just wanted to update that I tried taxr.ai after posting my question here. It was actually much easier than I expected! I took pictures of my ESPP statements and my investment account statements showing my losses. The system automatically identified which losses could offset my ESPP gains and showed me exactly where everything goes on my tax forms. It even explained that my company had already reported the 15% discount as compensation on my W-2, so I only needed to report the additional gain since purchase. Honestly saved me hours of confusion and probably a call to a tax professional. Definitely using it again next year!
0 coins
Freya Thomsen
If you're trying to reach the IRS to confirm how to report your ESPP sales correctly, good luck getting through on the phone! I spent 3 weeks trying before I discovered https://claimyr.com - they got me connected to a real IRS agent in less than 20 minutes. Check out their demo at https://youtu.be/_kiP6q8DX5c to see how it works. I needed clarification on reporting my ESPP sales since my company's tax documents were missing some info, and the IRS agent walked me through exactly what forms I needed and how to calculate my basis correctly. They even emailed me some documentation to help with next year's filing. Way better than waiting on hold for hours!
0 coins
Omar Zaki
•How does this even work? Do they like have a special line to the IRS or something? Seems sketchy that they can get through when nobody else can.
0 coins
AstroAce
•Yeah right, I'll believe it when I see it. Been trying to talk to someone at the IRS for months about my stock questions. No way they're getting through when the IRS phone lines are practically useless.
0 coins
Freya Thomsen
•They don't have a special line exactly. From what they explained to me, they use an automated system that navigates the IRS phone tree and waits on hold for you. When they finally get a representative, they call you and connect you directly. It's basically like having someone wait on hold so you don't have to. I was skeptical too at first. I had been trying for weeks to get through about my ESPP reporting questions with no luck. But I figured I'd try it as a last resort before hiring a CPA. I got connected in about 15 minutes and the IRS agent was actually really helpful once I explained my situation.
0 coins
AstroAce
I have to eat my words. After posting my skeptical comment, I decided to give Claimyr a shot as a last resort. I couldn't figure out if my ESPP gains were qualified or disqualified dispositions (which affects the tax rate). Used the service yesterday morning and got connected to an IRS agent in about 12 minutes. The agent confirmed I had a disqualified disposition since I sold within a year, but also explained how I could still use my investment losses to offset the capital gains portion. They even sent me some reference materials about ESPPs that clarified everything. Didn't think it would actually work, but saved me from paying my accountant another consulting fee. Consider me surprised and impressed.
0 coins
Chloe Martin
Don't forget about wash sale rules if you're planning on tax loss harvesting! If you sell investments at a loss and buy "substantially identical" securities within 30 days before or after the sale, you can't claim the loss for tax purposes. I learned this the hard way last year when I tried to harvest losses but accidentally bought back into a similar fund too quickly. The IRS disallowed my losses and I ended up owing way more than expected.
0 coins
Javier Torres
•This is a really good point I hadn't considered. What counts as "substantially identical" though? Like if I sell shares of one tech ETF at a loss and buy a different tech ETF, would that trigger the wash sale rule?
0 coins
Chloe Martin
•For ETFs and mutual funds, it depends on their underlying holdings and investment objectives. Different tech ETFs would generally not be considered substantially identical as long as they track different indexes or have significantly different compositions. Individual stocks are more straightforward - selling Apple and buying Apple again within the 30-day window would trigger the wash sale rule. But selling Apple and buying Microsoft would not, even though they're both tech companies. With ESPP shares specifically, be careful if you're continuing to acquire company stock through your ESPP program. If you sell some shares at a loss but are still purchasing new shares through regular payroll deductions, those new purchases could potentially trigger the wash sale rule.
0 coins
Diego Rojas
Dont forget about the difference between qualified and disqualified dispositions for ESPP! If u hold the stock for at least 1 yr from purchase date AND 2 yrs from offering date, its a qualified disposition and part of your gain gets taxed as long term cap gains instead of ordinary income. could be BIG tax savings!!
0 coins
Anastasia Sokolov
•I think you might be confusing ESPP with ISOs (Incentive Stock Options). The rules are slightly different. With ESPPs, the discount is always ordinary income regardless of holding period, but you're right that the rest of the gain can be long-term capital gains if you hold long enough.
0 coins
Lydia Santiago
Great question! Yes, you can absolutely use tax loss harvesting from your regular investments to offset ESPP capital gains - they're treated the same way by the IRS for offsetting purposes. Just to clarify the ESPP tax treatment since there seems to be some confusion in other comments: The 15% discount you received is indeed treated as ordinary income and should appear on your W-2. Your cost basis for capital gains purposes is the discounted price you actually paid ($85 in Emma's example), so you only pay capital gains tax on appreciation above that amount. One thing to watch out for - make sure you understand whether you had a qualified or disqualified disposition. Since you mentioned selling after about 3 years, you likely met the holding period requirements (1 year from purchase AND 2 years from grant date), which could make part of your gain eligible for more favorable long-term capital gains treatment. Also be careful about wash sale rules if you're still participating in the ESPP program - continuing to buy company stock through payroll deductions while selling at a loss could potentially disallow those losses. You might want to double-check your 1099-B and W-2 to make sure the tax reporting aligns with your actual transactions before finalizing your tax loss harvesting strategy.
0 coins