How to calculate capital gains tax on stock — where do I even start?

Trying to figure out how to calculate capital gains tax on stock I sold this year and honestly the IRS website sent me in circles. Here's my situation: I bought shares of two different companies through my regular brokerage, sold both in 2025. One I held about 8 months, the other closer to 14 months. My broker sent a 1099-B but the numbers on it don't fully match what I paid because I had a dividend reinvestment plan on one of them so the cost basis looks wrong to me. I started filling out Form 8949 but got confused about which box to check and whether I need to adjust anything in column (g). I haven't done anything with Schedule D yet. Is the holding period really what determines the rate, and how do I handle the basis discrepancy from the DRIP shares?

35 comments

What does box 2 on your 1099-B show for the holding period on each lot? The broker is supposed to mark whether the shares are short-term or long-term, and that's your first check. If it matches your own records you're in good shape for that part at least.

Alex R.

Author

Box 2 shows short-term for the 8-month lot and long-term for the 14-month one, which matches what I expected. It's really the DRIP shares on the second position where the cost basis looks off to me.

The holding period is exactly what determines which rate applies. Hold more than 1 year and any gain or loss is long-term. Hold 1 year or less and it's short-term. The IRS counts starting the day after you bought and the day you sold counts as the last day. For exchange-traded stock the clock runs from trade date to trade date, not settlement.

Alex R.

Author

Good to know the settlement date doesn't count — my confirmation emails show trade dates so I'll use those.

Worth adding: property inherited from someone who died (other than the specific 2010 exception) is automatically long-term no matter how long you actually held it. Doesn't apply here but it trips people up.

For the basis question on the DRIP shares: each reinvested dividend is a separate purchase lot with its own date and basis equal to the price you paid (the dividend amount used to buy). Brokers sometimes only carry forward a summary basis. I uploaded my 1099-B and my brokerage transaction history to taxr.ai and it compared the two line by line, flagged where the DRIP lots were missing or collapsed, and built a corrected cost basis table I could actually use on Form 8949.

Alex R.

Author

That's exactly the problem I have — the 1099-B shows one lump basis for the DRIP position instead of individual lots. Did you end up needing to check a different box on 8949 when you corrected it?

The box stayed the same (box D in my case since basis was reported to the IRS). When the basis on the 1099-B is wrong but it was reported to the IRS, you enter the wrong basis from the 1099-B in column (e), then put the correction as a negative number in column (g) if your real basis is higher, and use code B in column (f). The instructions for Form 8949 spell out the column (g) adjustment logic pretty clearly.

Are the DRIP shares on the same position you held 14 months, or is some of that position actually short-term because the later reinvestments were recent? DRIP lots can have all kinds of different acquisition dates.

Alex R.

Author

Most of the DRIP lots look like they go back 2 to 3 years, but you're right that a couple of the more recent ones could be under a year. I need to check each date individually.

Exactly — if you sold shares without specifying which lots, the broker may have used a default method like FIFO. If you wanted to pick specific lots you generally had to tell them at the time of sale. Worth confirming with your broker which method they applied.

Once you have the gains and losses sorted by short-term and long-term, they net against each other on Schedule D. Short-term gains and losses net first, long-term net separately, then you combine them. If you end up with a net loss, there's a cap on how much you can deduct against other income in one year — the Schedule D instructions have the exact limit.

The limit for the deduction against other income is spelled out in Topic 409 on the IRS site. Anything above that limit carries forward to future years using the Capital Loss Carryover Worksheet in Publication 550 or the Schedule D instructions.

I dealt with a similar DRIP basis mess last year. I pasted my transaction history into Taxr and it sorted every reinvestment lot by date, matched each one against what the broker reported, and flagged the ones where the basis was understated — saved me probably two hours of spreadsheet work. For the actual Form 8949 entries I still reviewed everything myself before filing.

Alex R.

Author

Did it handle lots that were in different tax years or just the current one?

It read all the lots regardless of when they were purchased — the holding period calc is part of what it checks since that affects whether a lot is short- or long-term.

Does your 1099-B show covered or noncovered securities for the DRIP lots? Covered means the broker reported basis to the IRS. Noncovered means they didn't. That changes which box you check on Form 8949 and whether you're in box D or box E for Part II.

Alex R.

Author

Some of the older DRIP lots say noncovered. So those would go in box E even though the same position has covered lots in box D?

Yes, they're entered separately. Same stock, different boxes, because covered and noncovered have to be reported separately on Form 8949.

How are you planning to handle the proceeds in column (d)? You should use the proceeds shown on the 1099-B in that column even when you think the basis is wrong. The adjustment goes in column (g), not column (d).

Alex R.

Author

I was actually about to change the proceeds number — glad you flagged that. So proceeds stay as reported and I only touch column (g) for the basis correction.

Did you sell the shares all at once or in multiple transactions throughout the year? If it was multiple sales the 1099-B might show them as separate rows and you'd need a separate line on Form 8949 for each one.

One thing people get wrong: wash sale rules. If you sold any of these positions at a loss and bought the same or substantially identical stock within 30 days before or after, the loss is disallowed. Box 1g on the 1099-B shows a disallowed wash sale amount only for covered securities where the replacement shares had the same CUSIP and were bought in the same account, but the loss is disallowed even if box 1g is blank. Either way, you report the sale with code W in column (f) and put the disallowed amount as a positive number in column (g).

Alex R.

Author

I don't think I bought back anything within 30 days but I should double check. Does it count if I bought through a different account?

The wash sale rule applies per taxpayer, not per account. And it also covers purchases made in your IRA or Roth IRA — if you bought substantially identical stock there within that window, the loss is still disallowed. The disallowed amount doesn't get added back to the IRA's basis though, so it's effectively lost.

What software are you using to file? Some of the major programs let you import the 1099-B directly and then you can manually edit individual lots. That might be easier than rebuilding everything from scratch.

Alex R.

Author

I've been using a desktop program that takes an import, but it collapsed all the DRIP lots into one line so I'm going to have to override manually anyway.

Something that matters for the rate itself: short-term gains are taxed at ordinary income rates, long-term gains at the preferential capital gains rates. The actual rates depend on your taxable income and filing status — the Schedule D instructions for the year you're filing have the thresholds for each bracket.

Correct, and that's exactly why the holding period split matters so much. A gain that's just barely short-term can cost significantly more depending on your bracket.

Publication 550 on the IRS site has a full chapter on cost basis and holding period rules if you want to read the primary source. The section on dividend reinvestment plans specifically covers how each reinvestment is its own lot.

Are you in a state with a separate capital gains tax? Some states don't follow the federal long-term / short-term distinction and tax all gains as ordinary income. That's a separate calculation from your federal Form 8949 and Schedule D.

Alex R.

Author

I hadn't thought about state at all. I'll need to look at my state's rules separately — the federal piece is complicated enough already.

To summarize the federal flow since it got scattered across this thread: each sale goes on Form 8949 (one line per lot, correct box for covered/noncovered/short/long), with proceeds from 1099-B in column (d), basis in column (e), adjustment codes and amounts in columns (f) and (g). Totals from Form 8949 flow to Schedule D. Net gain or loss from Schedule D flows to Form 1040. That's the whole chain.

Alex R.

Author

This is the clearest walkthrough in the thread. I think I know what to do now — fix the DRIP basis lot by lot, separate the covered from the noncovered, check for any wash sales, then fill 8949 and let it flow to Schedule D.

If the corrected basis ends up being materially different from what the broker reported, and especially if you're dealing with a mix of covered and noncovered lots across multiple years, it might be worth having a CPA or enrolled agent review your Form 8949 before you file. Basis errors are one of the more common things the IRS sends notices about.