How to calculate capital gains on stocks — what actually goes on each form?

Trying to figure out how to calculate capital gains on stocks for my return this year and I keep getting confused about which numbers go where. I sold a few positions through my brokerage — some held over a year, some under. My 1099-B shows proceeds and cost basis for each lot, but I'm not sure if I add everything up myself or if the numbers flow somewhere specific. I tried reading the Schedule D instructions and got lost around the Part I vs Part II split. Do I enter every single transaction on Form 8949, or is there a shortcut? And does the holding period date come from my brokerage statement or do I calculate it myself from the purchase date? Just want to make sure I'm not missing anything before I file.

35 comments

The core of how to calculate capital gains on stocks is: proceeds minus cost basis equals gain or loss. For each lot, that number is either short-term (held 1 year or less) or long-term (held more than 1 year). Short-term goes in Part I of Form 8949, long-term in Part II. The totals from 8949 carry to Schedule D lines 1b and 8b (or 1a and 8a if you qualify for the exception). Your 1099-B should already break the lots into those two buckets.

Ben B.

Author

So my brokerage is already doing the short vs long split for me? I assumed I had to figure out the holding period myself from my own records.

The holding period question tripped me up too. The IRS counts from the day after you bought to the trade date you sold — not the settlement date. So if you bought on June 1 and sold on June 1 the following year, that's exactly one year and it's still short-term. You need more than one year for long-term. Your 1099-B usually labels the lot already but it's worth double-checking, especially for shares you bought in different lots at different times.

Ben B.

Author

More than one year, not one year exactly. Got it, that's the part I was fuzzy on.

Same confusion for me when I started. The trade date rule — not settlement — was the part my brokerage's statement obscured because they show settlement date in a different column.

I uploaded my 1099-B and all my trade confirmations to taxr.ai last month when I was sorting out the same question. It read each lot, matched the proceeds and basis to the right box on Form 8949, and put together a worksheet showing which Part I and Part II boxes applied. Saved me from manually reconciling like 30 rows. The rule it was applying is exactly what the others said — proceeds minus basis, then sorted by holding period — but having it laid out against the actual form lines made it click for me.

Ben B.

Author

Interesting — did it flag anything you would have missed on your own?

There were two lots where my broker had the wrong acquisition date on the 1099-B. The worksheet made those obvious because the holding period didn't match what I expected from my own confirmations.

One thing people skip: check whether any of your sales triggered a wash sale. If you sold at a loss and bought back the same stock within 30 days before or after, the loss is disallowed. Your 1099-B box 1g will show the disallowed amount if the broker caught it, but they only report it when the buy-back happened in the same account with the same CUSIP. Cross-account wash sales are your problem to find.

Ben B.

Author

I did sell some shares at a loss and bought back in a different account. So the 1099-B might not show that at all?

Exactly. The broker only tracks within the same account and same CUSIP per Publication 550. Cross-account is on you. If the repurchase was within that 30-day window on either side, you have a wash sale even if box 1g shows nothing.

For Form 8949 specifically: if your 1099-B shows basis reported to the IRS and you have no adjustments, those transactions can skip Form 8949 entirely and go straight to Schedule D line 1a (short-term) or 8a (long-term) under Exception 1. You still need Form 8949 for any lot where you're adjusting basis, correcting dates, or reporting a wash sale with code W.

This saved me a lot of time last year. Most of my covered-security sales had no adjustments so they went straight to 1a and 8a. Only the lots where the basis was wrong needed the full 8949 treatment.

My situation last year had inherited shares in the mix, which threw me off completely. Inherited stock is automatically long-term regardless of how long you actually held it — that's the rule even if you turn around and sell the day after. The basis is generally the fair market value at the date of death, not what the original owner paid.

Ben B.

Author

Good to know — I don't have inherited shares this year but I'll remember that for my parents' estate eventually.

Don't forget that if your losses are bigger than your gains, you can only deduct up to the annual limit against other income — the rest carries forward. The carryover amount gets calculated on the Capital Loss Carryover Worksheet in Publication 550 or the Schedule D instructions. The Schedule D itself has the lines for figuring whether you have a net loss situation before you get to the deduction limit.

I had a messy year with partial lot sales and reinvested dividends that added basis in weird increments. Fed my 1099-B and all the DRIP confirmations to Taxr and it built out a per-lot basis schedule showing exactly what each lot's adjusted cost was. What I actually got from that exercise was a clear Form 8949 column (e) number for each row that I could enter with confidence rather than guessing.

Ben B.

Author

DRIP shares are the ones that always throw me — every dividend adds a new lot at a different price.

Every single one. And if you sell anything, you have to figure out which lots you sold and in what order depending on your brokerage's default method (usually FIFO) unless you've made a specific identification election.

Specific identification is worth knowing about. If your broker allows it, you can tell them which lots to sell at the time of sale, which lets you choose high-basis lots to minimize gains or harvest losses strategically. But you have to do it at the time of sale — you can't go back after the fact and change which lots were sold. Publication 550 has the rules on identification methods.

I switched to specific ID a few years ago and it made a real difference during volatile years when I had lots at very different prices.

The column (g) adjustment field on Form 8949 is where a lot of people get confused. For a wash sale you put the disallowed loss as a positive number in column (g) with code W in column (f). For a basis correction when basis was reported to the IRS, you put the difference as a negative (in parentheses) if the correct basis is higher than what the 1099-B shows. The instructions for Form 8949 at irs.gov walk through each code.

The parentheses-for-negative part is easy to miss. Put the wrong sign and your gain/loss is completely off.

Something I had to learn the hard way: cost basis on the 1099-B can be wrong if you transferred shares in from another broker. The receiving broker often doesn't get the original purchase price and just leaves it blank or puts $0. You have to find your original trade confirmations and report the correct basis yourself, using code B in column (f) if the wrong basis was reported to the IRS.

Ben B.

Author

This is probably my biggest risk area — I moved brokers two years ago and I'm not sure all the basis transferred correctly.

Pull your current broker's cost basis screen and compare it against your old confirmations for anything you bought before the transfer. Discrepancies are common and fixing it on 8949 is straightforward once you have the right numbers.

RSUs complicate this if any of your stock came from equity comp. When RSUs vest, your company withholds shares and the fair market value at vesting becomes your basis and ordinary income on your W-2. If you then sell those shares, the gain or loss is calculated from that vested-day price, not zero. A lot of people calculate capital gains on stocks from equity comp using $0 basis by mistake and double-pay tax.

Ben B.

Author

I do have some RSU shares I sold this year. The vest price should be in my brokerage's system but I'll double-check it matches my W-2 income.

Schedule D line 16 is where the net capital gain or loss lands. If it's a loss, that line feeds into the deduction limit calculation. If it's a gain, it flows to your Form 1040. The tax rate on the gain depends on whether it's short-term (ordinary rates) or long-term (preferential rates) — but the specific rates depend on your taxable income, so I won't guess at a number; the Schedule D instructions have the qualified dividend and capital gain tax worksheet.

Covered vs non-covered securities is worth understanding before you start entering anything. Covered securities generally means the broker is required to track and report basis to the IRS; non-covered means they're not. For covered, you use box A or D on Form 8949. For non-covered, box B or E. The distinction matters because a basis error in a covered-security row (box A or D) requires you to enter the 1099-B basis in column (e) even if it's wrong, then correct it in column (g). For non-covered (box B or E), you just enter the correct basis directly.

The covered/non-covered split also determines whether the IRS already has the basis number or not, which changes your audit exposure if there's a discrepancy.

If any of your stock sales were from options exercises — not RSUs but actual options — the holding period starts from the date of exercise, not the date the option was granted. That catches people who think they've held a position for years because the option was granted a long time ago.

ISOs have a whole separate layer with AMT to worry about on Form 6251 at exercise. That's a bigger question than just capital gains.

To pull your situation together: for each sale, you need the proceeds from column (d) of your 1099-B, the correct basis for column (e), the acquisition and sale dates, the holding period to assign it to Part I or Part II of Form 8949, and any adjustments in column (g) with the right code. If a lot needs no adjustment and basis was reported to the IRS, it can go straight to Schedule D under Exception 1. Net everything on Schedule D and the result flows to Form 1040.

Ben B.

Author

This is basically the checklist I needed. I'm going to go through my 1099-B lot by lot with this in mind. Thanks everyone.