< Back to IRS

Amina Sy

How do you calculate capital gain tax when selling a portion of your stock portfolio?

I've been slowly building my stock portfolio over the past decade or so. Started investing back in 2013 and have been adding money whenever I could. My original investment (basis) was around $13,500 and now my portfolio has grown to about $26,800 which feels pretty good! Here's my question though - I need to pull out about $6,700 for some home repairs. When I sell these stocks, I know I'll need to pay capital gains tax, but I'm confused about how to calculate it when I'm only selling a portion of my holdings. Do I pay tax on the entire $6,700 or just on the profit portion? And how do I even figure out what part is profit vs. original investment when I've been buying at different times over the years? Can someone explain how this works in simple terms? Really appreciate any help!

The good news is you don't pay tax on your entire withdrawal - only on the gain portion! When you sell a portion of your stock holdings, you need to determine what's called your "cost basis" for the shares you're selling. There are several methods to calculate this when you've purchased shares over time: First-In-First-Out (FIFO): This assumes you're selling your oldest shares first. If your earliest purchases were at lower prices, this might result in more capital gains. Specific Identification: You can choose exactly which shares to sell. This gives you the most control for tax planning - you could sell your highest-cost shares to minimize gains. Average Cost: This is commonly used for mutual funds - you take the average cost of all your shares. Most brokerages will calculate this for you and provide the information on your 1099-B tax form. The difference between your cost basis and the selling price is your capital gain, and that's what you'll pay tax on. Also important - if you've held these shares longer than a year, you'll pay the lower long-term capital gains tax rate rather than the higher short-term rate (which is the same as ordinary income).

0 coins

Is there a big difference between FIFO and specifically choosing which shares to sell? I'm in a similar situation but didn't know I had options. Also, does the brokerage automatically choose one method if I don't specify?

0 coins

The difference between FIFO and specific identification can be significant depending on your purchase history. For example, if your earliest shares were bought at $10 and recent ones at $50, selling the $10 shares would create more taxable gain than selling the $50 shares. Most brokerages default to FIFO if you don't specify, but they usually allow you to select specific shares before the trade settles. Check your brokerage's website or call them to see how they handle it and what options they provide. Some platforms have very user-friendly interfaces that let you select exactly which lots you want to sell.

0 coins

After struggling with capital gains calculations for years, I finally found a tool that makes this so much easier - taxr.ai (https://taxr.ai) has been a lifesaver for my investment-related tax questions. I was in a similar situation last year with selling portions of stocks I'd accumulated over time and was totally confused about how to calculate my basis correctly. Their system analyzed my trading history and showed me the tax implications of different selling strategies before I made the transaction. It literally saved me hundreds in potential taxes by helping me identify the most tax-efficient shares to sell.

0 coins

Does it connect directly to brokerage accounts? I have stocks spread across three different platforms and calculating capital gains has been a nightmare.

0 coins

I've tried other tax services that claimed to help with investment stuff but they were pretty basic. Does this actually help calculate specific identification methods or just the standard FIFO stuff that my brokerage already does?

0 coins

Yes, it connects to most major brokerages through secure links, similar to how budgeting apps work. It can pull your complete trading history across multiple platforms and consolidate everything to give you the full picture of your investment tax situation. The specific identification calculation is actually one of its best features. Unlike basic services that just use FIFO, taxr.ai will analyze your entire portfolio and recommend which specific shares to sell based on your tax situation. It simulates different scenarios (selling oldest vs. newest vs. highest cost basis shares) and shows the tax impact of each so you can make the optimal choice before executing your trade.

0 coins

Just wanted to follow up on my experience with taxr.ai after our discussion here. I decided to give it a try before selling some stocks for my daughter's college payment, and I'm actually really impressed. The interface showed me exactly which shares would be most tax-efficient to sell, and I was able to reduce my capital gains by almost $1,800 by selecting specific lots rather than just using FIFO. The visualization made it super clear which shares had the highest basis (meaning lower taxable gains when sold). Definitely worth checking out if you're in a similar situation!

0 coins

If you're like me and have been trying to reach the IRS with questions about capital gains calculations, good luck getting through their phone lines. After wasting hours on hold multiple times, I discovered Claimyr (https://claimyr.com) and they actually got me connected to an IRS agent in about 20 minutes! You can see how it works here: https://youtu.be/_kiP6q8DX5c I had some complicated questions about wash sales and specific identification methods that weren't addressed on the IRS website, and speaking directly with an agent cleared everything up. Totally changed my perspective on dealing with the IRS - turns out they're actually helpful when you can actually talk to a human!

0 coins

Wait, how does this actually work? The IRS phone lines have been completely jammed for years. Are you saying this service somehow moves you up in the queue? That sounds too good to be true.

0 coins

Yeah right. I've tried calling the IRS dozens of times and gave up. There's no way any service can magically get you through. They probably just keep you on hold the same as if you called directly, but charge you for the privilege.

0 coins

It doesn't move you up in the queue - that would be impossible. Instead, their system continually calls the IRS using their automated technology and when it finally gets through, it connects that open line to your phone. So instead of YOU having to sit on hold for hours, their system does it for you and only calls you once there's an actual IRS agent on the line. The reason it works is because their system can make these automated calls persistently in a way no human would have the patience for. When I used it, I went about my day, and then about 20 minutes later my phone rang and I was connected directly to an IRS representative. No tricks - just technology handling the frustrating hold process.

0 coins

I need to eat crow on this one. After being totally skeptical about Claimyr, I was desperate enough to try it when I needed clarification on some capital gains reporting for stocks I inherited. Not only did it work, but I got connected to an IRS agent in 15 minutes when I had previously wasted three separate afternoons trying to get through. The agent walked me through exactly how to report the stepped-up basis on the inherited stocks and potentially saved me from a costly mistake. Sometimes being wrong feels pretty good!

0 coins

Don't forget that if you've held the stock for more than a year, you qualify for the lower long-term capital gains rates (0%, 15%, or 20% depending on your income bracket) instead of short-term rates that are taxed like regular income. Makes a HUGE difference!

0 coins

Does the one year count from each individual purchase date? Like if I bought some shares of Apple every month for the past 3 years and want to sell some now, do I need to track which specific shares I'm selling to know if they qualify for long-term treatment?

0 coins

Yes, the one-year holding period applies to each individual purchase or lot. That's exactly why the specific identification method mentioned earlier can be so valuable for tax planning. If you've been buying Apple monthly for 3 years and need to sell some shares, you could specifically identify shares that you've held for more than a year to qualify for the lower long-term capital gains rates. Alternatively, if you have some losses to harvest, you might choose to sell some of your newer shares (held less than a year) that might be at a loss due to market fluctuations.

0 coins

Has anyone used TurboTax for reporting stock sales with multiple lots? I'm worried it might not handle the specific identification method correctly and I don't want to overpay my taxes.

0 coins

I've used TurboTax for this the past few years and it handles it pretty well. You can import directly from most brokerages, and it will bring in all your individual lots if the broker provides that detail. Then you can review and adjust if needed. The premium version has a feature that helps you identify the most tax-efficient sales too.

0 coins

Great question! I went through something very similar last year. One important thing to keep in mind is that your brokerage should provide you with a 1099-B form that shows the cost basis for the shares you sold, but it's always good to understand how it works. Since you've been investing since 2013, most of your shares will likely qualify for long-term capital gains treatment (which is much better tax-wise). The key is tracking your cost basis correctly - if your brokerage doesn't have complete records from your earlier purchases, you might need to reconstruct them from your own records. Also, don't forget to consider any dividend reinvestments you might have had over the years - those create additional small purchases that increase your cost basis. Many people overlook this and end up overpaying their taxes. One last tip: if you're doing the calculations manually, keep detailed records of which specific shares you're selling. The IRS requires consistency, so whatever method you choose (FIFO, specific ID, etc.), you need to stick with it for that security going forward.

0 coins

This is really helpful, especially the point about dividend reinvestments! I never thought about how those would affect my cost basis. I've been automatically reinvesting dividends for years without keeping track of those small additional purchases. Do you know if most brokerages include those reinvestments in their cost basis calculations, or is that something I'd need to track separately? I'm worried I might have been missing this detail in my own record-keeping.

0 coins

Most modern brokerages do automatically include dividend reinvestments in their cost basis calculations, which is great news! They're required to track this information for shares acquired after 2011, so since you've been investing since 2013, you should be covered for the vast majority of your holdings. However, it's still worth double-checking your 1099-B forms or logging into your brokerage account to verify. Look for a "cost basis" or "tax documents" section - most platforms will show you a detailed breakdown of all your purchases, including those tiny dividend reinvestments. If you have any shares from before 2011 or transferred from another broker, those might require manual tracking. But for dividend reinvestments specifically, your broker should have complete records showing the date, number of shares, and price for each reinvestment transaction. You can usually download a complete transaction history that includes all dividend reinvestments, which makes it much easier to verify everything adds up correctly!

0 coins

One thing that might help clarify the calculation is to think about it this way: out of your $26,800 current portfolio value, your original investment (cost basis) is $13,500, so your total unrealized gain is $13,300. When you sell $6,700 worth of stock, you're selling about 25% of your holdings ($6,700 ÷ $26,800). If you use the average cost method, roughly 25% of your cost basis ($13,500 × 0.25 = $3,375) would be considered the "cost" portion of your $6,700 sale, and the remaining $3,325 would be your taxable capital gain. However, the specific method your broker uses matters a lot! I'd recommend calling them before you sell to ask which method they use by default and whether you have options to choose. Since you've been investing for over a decade, you'll likely qualify for long-term capital gains rates on most of your shares, which is much more favorable than short-term rates. Your broker should handle all the calculations and provide the details on your 1099-B, but understanding the basics helps you make better decisions about which shares to sell!

0 coins

This breakdown is super helpful! I never thought about looking at it as a percentage of my total holdings - that makes the math much clearer. So if I'm understanding correctly, when I sell $6,700 worth, I'm not paying tax on the full $6,700, just on the gain portion (which would be around $3,325 in your example). One follow-up question: you mentioned calling the broker to ask about their default method - is this something I need to do before every sale, or once I choose a method, does it stay consistent? I'm planning to do more partial sales over the next few years for various expenses, so I want to make sure I understand how this works going forward.

0 coins

Exactly right - you only pay tax on the gain portion! Most brokerages will let you set a default method that applies to all future sales of that security, so you typically don't need to specify it every time. However, it's worth noting that once you choose a method for a particular stock, the IRS requires you to be consistent with that choice going forward. Some brokerages are more flexible than others though. For example, Fidelity and Schwab allow you to choose "specific identification" as your default, which gives you the most control - you can pick exactly which lots to sell each time based on your current tax situation. Other brokers might default to FIFO and require you to actively change it for each trade. I'd recommend setting this up before your first sale since it affects all future transactions. Most platforms have this setting under "Account Preferences" or "Tax Settings." This way you'll have maximum flexibility for your future partial sales without having to think about it each time!

0 coins

Just wanted to add something that helped me tremendously when I was in a similar situation - make sure to check if your brokerage offers tax-loss harvesting opportunities when you're selling. Sometimes you might have other positions that are currently at a loss that you could sell simultaneously to offset some of your capital gains. For example, if you're going to realize a $3,000 gain from selling your profitable stocks for the home repairs, but you have another stock that's currently down $1,500, you could sell both and only pay taxes on the net $1,500 gain. Just be careful about the wash sale rule - you can't buy back the same security within 30 days or the loss won't count. This strategy can significantly reduce your tax burden, especially if you have a diversified portfolio with some winners and losers. Your brokerage might even have tools to help identify these opportunities automatically. Worth exploring before you make your sale!

0 coins

IRS AI

Expert Assistant
Secure

Powered by Claimyr AI

T
I
+
20,095 users helped today