Do I pay capital gains tax if I only sell my original investment amount?

Trying to figure out if I owe capital gains tax if I only sell my original investment amount and keep the gains invested. Like say I put $5k into a fund, it grew to $8k, and I pull out exactly $5k. Do I still owe tax on part of that? My broker sent a 1099-B and the proceeds show $5,000 but my cost basis is way less per share since I've been reinvesting dividends over the years. I tried looking at the 1099-B but honestly the numbers aren't matching what I expected. Already spent an hour on this and still confused about whether the IRS looks at the dollar amount I withdraw or the actual shares I sold.

35 comments

Wait, are you selling specific shares or does your broker choose which shares get sold? That changes everything here. The IRS doesn't care how much cash you originally deposited — it looks at which shares you sold and what you paid for those specific shares.

Sean T.

Author

Broker just sold whatever, I didn't specify. So I guess they picked the shares. Does that mean I could owe tax even though I only took out what I put in originally?

Yes, that's exactly the situation. If the broker used FIFO (first in, first out), those earliest shares might have a very low cost basis even if you "only" withdrew your original dollar amount. The gain is calculated per share, not on your total cash flow in and out.

Had a similar mess with reinvested dividends inflating my proceeds vs. what I thought my basis was. I uploaded my 1099-B and my broker's cost basis statement to taxr.ai and it identified every lot, matched the CUSIP numbers, and gave me a reconciled list of what was actually taxable. Worth doing before you guess at numbers. The short version of what I learned: each dividend reinvestment creates a new lot with its own purchase date and basis. So selling $5k of proceeds can still produce a taxable gain if the shares sold had a low per-share basis.

Sean T.

Author

Oh so the reinvested dividends actually raise my basis? I didn't realize each reinvestment was its own lot. That might actually help me.

They do raise your overall basis, yes — but only for the shares acquired with those dividends. If your broker sold your oldest shares first, those might predate most of the reinvestments and have a much lower basis. That's the mismatch you're seeing.

Can you check your 1099-B for box 1e? That's the cost basis reported. If that number is lower than the proceeds in box 1d, you have a reportable gain regardless of how much cash you originally deposited.

Sean T.

Author

Box 1e is blank on a couple of the lots. What does that mean?

Blank box 1e usually means the broker didn't report basis to the IRS — those are non-covered securities. You'd check box B (or box E for long-term) on Form 8949 and enter your own correct basis in column (e).

The capital gains calculation has nothing to do with your net cash position in the account. It's proceeds minus basis for the specific shares sold, full stop. If those shares were held more than one year, any gain is long-term. One year or less, short-term. The IRS counts from the day after you acquired each lot to the trade date you sold.

Did you elect any specific lot identification method with your broker before you sold? Because if you hadn't, most brokers default to FIFO and you can't go back and change it after the sale.

Sean T.

Author

I didn't elect anything, so yeah, probably FIFO. That explains why the gain looks bigger than I expected — older shares have lower basis.

Something I had to learn the hard way: even if you owe zero tax after losses or deductions, you still have to report the sale on Form 8949 and carry the totals to Schedule D. You can't skip reporting just because you think the gain is offset.

A mutual fund with years of reinvested dividends gave me this exact headache two years ago. My 1099-B had something like 40 lots and I couldn't figure out which were covered vs. non-covered. I pasted everything into Taxr and it sorted the lots by holding period, flagged the ones where basis wasn't reported to the IRS, and drafted a summary I could hand to my CPA. Saved me a lot of back-and-forth. For the actual reporting: covered lots with basis reported go in Part I box A (short-term) or Part II box D (long-term) on Form 8949. Non-covered go in box B or E respectively.

Does the same covered vs. non-covered split apply if some of those reinvestments were in a DRIP directly through the company rather than through a brokerage?

Generally yes — shares acquired through a direct DRIP before the covered security rules took effect would be non-covered. If you're not sure, the basis statement from the plan administrator should say. If it doesn't, non-covered is the safer assumption and you report what you can reconstruct.

Are you sure the $5k you pulled out matches the proceeds on the 1099-B exactly? Sometimes brokers net out fees and the 1099-B proceeds reflect something slightly different from what hit your bank account.

Sean T.

Author

Good point, let me check — I think there were some small transaction fees. So I'd use whatever box 1d says, not my bank deposit amount?

Use box 1d from the 1099-B in column (d) of Form 8949. The IRS instructions say to always enter the proceeds shown on the 1099-B, even if the amount you received differs because of fees.

To be clear on one thing people get wrong: withdrawing your "original investment" doesn't create a tax-free transaction in a taxable brokerage account. That concept applies to Roth IRA contributions, where you can withdraw your basis tax-free. In a regular brokerage account, every sale is a taxable event based on the shares sold.

Sean T.

Author

That's actually a really useful distinction. I was mixing up how Roth withdrawals work with regular brokerage accounts. Makes more sense now.

How many separate lots showed up on your 1099-B? If it's a lot of them and basis is reported for all with no adjustments needed, you might be able to use the Exception 1 shortcut — report the totals directly on Schedule D line 1a or 8a instead of filling out every row of Form 8949.

Sean T.

Author

There are maybe 12 lots. Some have basis reported, a few don't. So I guess I'd have to use Form 8949 for at least the non-covered ones?

Exactly. You can use the Schedule D shortcut only for the covered lots with no adjustments. The non-covered lots (box B or E) need their own rows on Form 8949 with your reconstructed basis in column (e).

What tax software are you using? Most of them let you import the 1099-B directly and they'll handle the lot breakdown. The issue is they can only use what the broker reports — if basis is missing for non-covered shares you still have to enter it manually.

Is there any chance you have capital losses from other sales this year? If your gains here are short-term, losses from other positions could offset them on Schedule D before you get to any net taxable amount.

Sean T.

Author

I do have one position I sold at a loss earlier this year. So those losses would reduce what I owe here?

Yes. Short-term losses offset short-term gains first, then long-term losses offset long-term gains. After netting, if losses still exceed gains, there's a cap on how much you can deduct against ordinary income in one year — check Topic no. 409 on irs.gov for the current limit and the carryover rules.

There's a solid section in Publication 550 on irs.gov about how holding periods work for reinvested dividends specifically. Each reinvestment starts its own holding period clock the day after the shares are acquired.

Did your broker offer a "specific identification" or "spec ID" option before you sold? If you'd selected your highest-basis lots, your taxable gain could have been much smaller or even zero. Worth knowing for next time before you place the trade.

Worth noting that specific ID has to be elected before the sale — you have to identify which lots you're selling and get a written confirmation from the broker at that time. You can't go back and assign lots after the fact.

One more thing to verify: check whether any of your lots show a wash sale loss disallowed amount in box 1g of the 1099-B. If you bought back into the same fund within 30 days before or after a loss sale, the disallowed loss gets added to the basis of the new shares instead — it doesn't just disappear.

Sean T.

Author

I don't think I sold at a loss in this batch, but good to know. So a wash sale code would actually increase my basis on the replacement shares?

Correct. The disallowed loss is added to the cost of the new shares and the new shares' holding period includes the period of the shares you sold. It's not lost forever, just deferred. The instructions for Form 8949 at irs.gov/instructions/i8949 have the detail on entering code W in column (f).

To pull it all together for you: figure out which shares were sold and their actual basis (including any reinvested dividend lots), determine the holding period for each lot, report each lot on Form 8949 in the right part and box, then carry the totals to Schedule D. The taxable amount has nothing to do with your original deposit — it's gain per lot.