Oldest first: 40 from lot A
- Cost basis$8,000
- Gain$5,000
What you get if you do nothing. Brokers use it by default for shares.
Cost basis is what you paid for an investment, fees included. When you sell, your gain or loss is what you got for the shares minus the cost basis of the shares you sold. Buy 50 shares at $200 with a $5 commission and your basis is $10,005, or $200.10 a share.
It keeps changing after you buy. Reinvested dividends add new lots, a split changes the basis per share but not the total, a wash sale moves a blocked loss onto your new shares, and inherited shares start again at their value on the day of death. Once you hold several lots, the method you use decides which of them a sale uses up: FIFO unless you pick the shares, or average cost for fund shares.
Proceeds are after selling fees. Sell those 50 shares for $13,000 and the gain is $2,995.
Enter each purchase as its own lot, then the sale. You'll see the cost basis of the shares sold, the gain, and what the other methods would give. It starts with the example further down.
Blue is sold, grey is what you keep.
US rules: a lot held more than a year when sold is long term. Buying fees are spread over the shares of that lot, and selling fees come off the proceeds. Under average cost the shares sold count as the oldest ones for the holding period. Picking LIFO or HIFO means naming those shares to your broker no later than the settlement date and getting its confirmation; average cost is only for fund shares and dividend reinvestment plans. It doesn't apply wash sales, splits or return of capital, so enter lots already adjusted for them.
One brokerage account, no fees, round prices. The same 40 shares sold on 12 September 2025 at $325.
Bought 50 VTI at $200
$10,000Bought 30 VTI at $235
$7,050Bought 20 VTI at $195
$3,900Proceeds of $13,000. The whole position cost $20,950, an average of $209.50 a share. Every lot is more than a year old, so any method gives a long-term gain.
What you get if you do nothing. Brokers use it by default for shares.
A form of naming your shares, so you pick it at the broker.
The smallest gain this year, and the cheap shares are still there for later.
Allowed here because VTI is a fund, and only if your broker has it set for this holding.
Same shares, same day, same price: the gain runs from $3,950 to $5,000. At the 15% long-term rate that's $592.50 or $750 of federal tax. HIFO doesn't make the gain disappear. It leaves you holding the shares with the lowest basis, so the tax comes when you sell those.
The price you paid is only the start. These are the adjustments that most often go missing.
$10,000 + $5They go into the basis of the lot you bought. Fees on a sale come off the proceeds instead.
new lot, $60A $60 dividend that buys 0.3 shares at $200 is taxed as a dividend that year and becomes a lot with a $60 basis. Leave it out and you pay tax on that $60 twice.
+ $500Sell at a $500 loss and buy the same shares back within 30 days: the loss isn't allowed yet. It's added to the basis of the shares you bought back, and the time you held the old shares counts toward theirs. Buy them back in an IRA and the loss is gone for good.
RSU, ESPPShares from work have a basis that includes the income on your W-2. The 1099-B often shows less, sometimes zero, so you fix it on Form 8949.
50 × $200 → 100 × $100After a 2-for-1 split you have twice the shares at half the basis each. The total stays at $10,000 and the purchase date doesn't change.
− box 3A payment shown in box 3 of Form 1099-DIV isn't income. It lowers your basis, and once the basis reaches zero anything more is a capital gain.
split by valueIn a tax-free spin-off the old basis is shared between your shares and the new company's in proportion to their market value, and the company publishes the split on IRS Form 8937. A tax-free share-for-share merger carries the old basis into the new shares.
± premiumExercise a call and what you paid for it goes into the basis of the shares. Get assigned on a put you sold and the premium you received comes off the basis of the shares you had to buy.
The basis is the market value on the date of death (or on the later date the estate chose), not what the person paid, and the gain is always long term. Shares bought at $20 and worth $150 when inherited have a $150 basis.
You take over the giver's basis and purchase date. If the shares were worth less than that when you got them, a loss is measured from that lower value and the date of the gift, and a sale between the two values gives neither a gain nor a loss.
RSUs: the amount taxed as pay when the shares were delivered. ESPP: what you paid plus any discount taxed as pay. Check the 1099-B against your W-2 before you file.
Brokers don't have to report the basis of these noncovered shares, and after an account transfer it's often missing. Your own records are the proof, so keep every buy confirmation.
Your broker's Form 1099-B, then Form 8949 and Schedule D on your return.
| Where | What it says about basis | What to check |
|---|---|---|
| Form 1099-B, box 1e | The cost or other basis of each sale, worked out by the broker | That reinvested dividends, wash sales and transferred-in shares are in it |
| Form 1099-B, box 12 | Ticked when the broker reported the basis to the IRS, as it must for covered shares | Noncovered sales may show no basis at all, so you supply it |
| Form 8949, boxes A and D | Short-term and long-term sales whose basis went to the IRS | If the basis is right and there's no adjustment, these can go straight to Schedule D |
| Form 8949, boxes B and E | Sales whose basis wasn't reported | You enter the basis in column (e) from your own records |
| Form 8949, columns (f) and (g) | Code W for a wash sale, code B when the reported basis is wrong, and the adjustment | RSU and ESPP sales usually need code B |
| Schedule D | The totals of Form 8949, short term and long term | Your loss carryover from last year |
The wash sale rule looks at every account you have, including an IRA and your spouse's, but each broker only sees its own. Sell at a loss at one broker and buy back at another within 30 days and your 1099-Bs usually won't show it. You make the adjustment yourself.
Same idea, different names and rules for which shares you sold.
One average cost per security across all your non-registered accounts, whichever broker sells. A superficial loss goes into the ACB of the shares that replaced them.
Adjusted cost base calculatorShares bought the same day go first, then shares bought in the next 30 days, and only then the pool at its average cost. That stops you selling and buying back to bank a loss.
UK share CGT calculatorFIFO across every broker in your name, so the oldest shares go first even if another broker holds them. Fees count on both sides.
Investing in SpainYou can choose which parcel you sold if you can identify it, and FIFO is the usual fallback. Residents get a 50% discount on the gain from parcels held at least 12 months.
Australian CGT calculatorThe VTI example above, entered in AllInvestView.
Each purchase stays a separate lot with its date, price and basis, from every broker you add, and a sale shows which lots it used. Under the lots, the same sales are run through FIFO, LIFO, HIFO and average cost with the gain and estimated tax for each. Pick another method at the top and the whole report is worked out under it.
See the tax report
AllInvestView
Each sale becomes Form 8949 rows in the right box, with the basis from your lots. Wash sales are caught across every account you add, and the blocked loss is added to the basis of the shares you bought back. Then each broker's total is set against its 1099-B, so you can see which one differs.
See the US tax report
AllInvestView
Your accounts side by side with the basis of each lot, real returns with dividends, and a tax report that compares FIFO, LIFO, HIFO and average cost before you file. Country packs for the US, Canada, the UK, Spain, Australia and more.
It's what you paid for an investment, commissions and fees included, adjusted later for things like reinvested dividends, splits and return of capital. When you sell, you take it away from what you got for the shares, and what's left is your gain or loss.
Multiply the shares by the price you paid and add the fees. If you bought at different times, keep each purchase as its own lot. When you sell, the basis is the cost of the lots the sale uses: the oldest under FIFO, the ones you name under specific identification, or the average for fund shares.
Yes. Each reinvested dividend is a new purchase with its own basis and date. You pay tax on the dividend in the year it's paid, so leaving it out of your basis means paying tax on the same money again when you sell.
Only under the average cost method, which the US allows for shares of mutual funds and most ETFs, and for shares bought through a dividend reinvestment plan since 2012. Your broker's app may show an average price for every holding, but for ordinary shares the basis of a sale comes from the lots it uses, FIFO unless you named them.
Look for old trade confirmations and statements, ask the broker that held the shares, or rebuild it from the purchase date and that day's price. For inherited shares, use the value on the date of death. Without any record, the IRS can treat the basis as zero, which makes the whole sale a gain.
Covered shares were bought after the reporting rules started: stocks from 2011, and fund and dividend reinvestment shares from 2012. Your broker reports their basis to the IRS. For noncovered shares the broker may leave the basis off, and you enter it on Form 8949 from your own records.
Yes. Commissions and fees on a purchase are part of its basis, and fees on a sale come off the proceeds. Either way they make the gain smaller.
Checked on 23 October 2026.
US federal rules for individuals unless a country is named. It isn't personal tax advice.