Cost basis is the dollar figure the tax system treats as your investment in an asset, and it is what gets subtracted from a sale's proceeds to find a capital gain or loss. For shares bought for cash it starts as the price paid plus the costs of buying, which IRS Topic 703 lists as commissions and recording or transfer fees; later events move it up or down, and the running total is called adjusted basis. This entry follows the US federal rules in IRS Publications 550 and 551, which change from time to time, so check your own return with a tax professional. The stocks hub covers owning shares more broadly.
How do you calculate cost basis?
Add the buying costs to the purchase price, apply every adjustment since, and subtract the result from the net sale proceeds to get the gain or loss.
Selling costs reduce the proceeds instead of adding to basis: the Form 1099-B instructions tell brokers to report proceeds after commissions and transfer taxes, and sales also carry the SEC's Section 31 fee of $20.60 per $1 million of sales. Basis is kept lot by lot, so every purchase, reinvested dividend and share received in a corporate action has its own date and cost. Publication 550's simplest case is 100 fund shares bought at $10 with a $50 commission, a basis of $10.50 a share. The crypto profit calculator applies the same logic to a single coin trade, fees on both sides included.
What changes cost basis after you buy?
Corporate actions, fund distributions and the wash sale rule move basis after the purchase, and each leaves a form or notice to check against your records.
| Event | Effect on basis | Where it shows up |
|---|---|---|
| Dividend or fund distribution reinvested | A new lot, with the reinvested amount as its basis | Form 1099-DIV and the reinvestment confirmation |
| Stock split or nontaxable stock dividend | Same total basis, spread across the new share count | The issuer's Form 8937 |
| Nondividend distribution (return of capital) | Basis falls by the amount paid; once it reaches zero, the excess is a capital gain | Form 1099-DIV, box 3 |
| Loss disallowed as a wash sale | Added to the basis of the replacement shares | Form 1099-B, box 1g |
| Gains a fund keeps and pays tax on | Basis rises by the gain you report minus the tax the fund paid for you | Form 2439 |
| Merger or spin-off | Basis is divided between the old and new holdings | The issuer's Form 8937 |
Reinvested dividends are taxed in the year paid and then become basis, so leaving them out taxes the same money twice. Dividend reinvestment plans cover that record keeping, stock splits explained the split ratios and the wash sale rule guide the deferred loss. A capital gains distribution taken in cash is taxed but leaves the basis of existing shares alone.
Worked example: One position's basis from purchase to sale
- March 2021: you buy 40 shares at $62.50 and pay a $6.95 commission. Basis: $2,500.00 + $6.95 = $2,506.95, or $62.67 a share.
- June 2024: a 3-for-1 split leaves you 120 shares. Basis is still $2,506.95, now $20.89 a share, and the March 2021 purchase date carries over.
- March 2025: a $0.25-a-share special distribution, taken in cash, is reported in box 3 of Form 1099-DIV. It is not taxed; it cuts basis by $30.00 to $2,476.95, or $20.64 a share.
- December 2025: you turn on dividend reinvestment, and a $96.00 dividend buys 1.6 shares at $60. That is a second lot with a $96.00 basis and its own start date.
- October 2026: you sell all 121.6 shares at $66.
| Lot | Proceeds | Adjusted basis | Gain | Holding period |
|---|---|---|---|---|
| 120 split-adjusted shares from 2021 | 120 × $66 = $7,920.00 | $2,476.95 | $5,443.05 | Long-term |
| 1.6 reinvested shares from 2025 | 1.6 × $66 = $105.60 | $96.00 | $9.60 | Short-term |
The total gain is $5,452.65, less about 17 cents of SEC fee on $8,025.60 of sales. Starting from the bare $2,500 price instead would overstate the gain by $72.95: the $6.95 commission and the $96.00 reinvested dividend left out, partly offset by the $30.00 return of capital ignored.
How do gifts and inheritances set cost basis?
A gift usually hands you the giver's basis, while an inheritance resets basis to the market value on the date of death, whether that value is higher or lower.
Publication 551 gives gifts that have lost value two bases: the giver's basis for measuring a gain and the lower market value at the gift for measuring a loss, so a sale between the two figures gives neither. The holding period follows the basis used, and includes the giver's years only when the giver's basis applies. Part of any gift tax paid on the appreciation is added, though gifts within the giver's lifetime exemption involve no tax to add.
The executor of an estate that files Form 706 can instead value everything six months after death, but only if that lowers both the estate's value and its tax, and heirs who receive Schedule A of Form 8971 may have to use the estate tax value. Inherited shares count as long-term however soon they are sold; Form 8949 takes the word INHERITED in place of a purchase date.
Worked example: The same shares received four ways
Your aunt paid $12,000 for a block of shares. The table shows what happens when you sell them, depending on how they reached you and what they were worth then.
| How the shares reached you | Value then | Your basis | Sale price | Result |
|---|---|---|---|---|
| Gift, worth more than her basis | $30,000 | $12,000 | $31,000 | $19,000 gain |
| Inheritance | $30,000 | $30,000 | $31,000 | $1,000 long-term gain |
| Gift, worth less than her basis | $9,000 | $12,000 for gains, $9,000 for losses | $10,500 | Neither gain nor loss |
| Inheritance | $9,000 | $9,000 | $10,500 | $1,500 long-term gain |
- Row 1: $31,000 − $12,000 = $19,000, and her holding period counts toward yours
- Row 2: $31,000 − $30,000 = $1,000; the $18,000 rise in her lifetime is never taxed
- Row 3: a $1,500 loss measured from $12,000 but a $1,500 gain measured from $9,000, so neither
- Row 4: basis steps down to $9,000, and the $3,000 decline in her lifetime is never deductible by anyone
Crypto follows the same principles, covered in crypto gifts and donations tax and crypto inheritance planning.
Which cost basis method applies when you sell part of a position?
Unless you name specific lots, the shares bought first are treated as sold first; averaging is allowed only for fund shares and reinvestment-plan shares.
| Method | How the basis of the shares sold is found | Where it can be used |
|---|---|---|
| First in, first out (FIFO) | The earliest lots leave first | Any security; the fallback when no lots are named |
| Specific identification | You name the lots at the time of sale and get written confirmation | Any security |
| Average basis | Total basis of identical shares in the account divided by the shares held, regardless of dates | Shares of most mutual funds and other regulated investment companies, and shares in a qualifying dividend reinvestment plan |
When no lots are named, the 1099-B instructions have brokers treat shares with an unknown purchase date as sold first, then the earliest; averages are figured account by account. Capital gains tax on stocks shows how the choice changes the tax on a sale, and crypto cost basis methods covers the wallet-by-wallet rules for coins.
Where do you see cost basis?
You meet cost basis on trade confirmations, on the positions screen of a brokerage account and on the forms that report each sale.
- Trade confirmations record the price, quantity and commission of each purchase; FINRA suggests keeping every one.
- Positions screens set basis beside market value. The gap is a paper gain or loss, taxed only on a sale, the line drawn in realized vs unrealized gains.
- Form 1099-B. Box 1e is cost or other basis, box 12 is checked when it went to the IRS, box 5 flags a noncovered security whose basis may be left out, and box 1g holds any disallowed wash sale loss.
- Form 8949. Column (e) carries basis onto the return; a wrong 1099-B figure is corrected with code B in column (f) and an amount in column (g).
- Form 1099-DA is the crypto counterpart, phased in as follows: Gross proceeds for sales from January 1, 2025; cost basis for covered assets bought from January 1, 2026 in a custodial account. Form 1099-DA explained has the detail.
Stock acquired for cash after 2010, and fund or reinvestment-plan shares acquired after 2011, are covered securities whose basis the broker reports to you and the IRS; older shares depend on your records. When shares move between brokers, the sending firm owes a transfer statement within 15 days of settlement, and without a complete one the new broker may treat them as noncovered.
How is cost basis different from market value and average price?
Cost basis is what you put in; market value is what the shares would fetch today, and proceeds are what a sale actually brought in.
| Term | What it measures | Where you see it |
|---|---|---|
| Cost basis | Your investment for tax purposes, adjusted over time | Form 1099-B box 1e; Form 8949 column (e) |
| Market value | Shares held × the latest price | Statements and stock price pages |
| Proceeds | What a sale brought in, after commissions and fees | Form 1099-B box 1d |
| Average cost on a positions screen | Total cost ÷ shares held, as a display figure | Brokerage apps and websites |
| Book value | A company's assets minus its liabilities, unrelated to your purchase | Balance sheets and the price-to-book ratio |
The display average is the one that misleads. For individual stocks the IRS does not allow average basis, so selling part of a position uses the basis of the particular lots sold. Buy 10 shares at $100 and 10 more at $140 and an app may show a $120 average; sell 10 at $125 with no lots named and FIFO sells the $100 shares, for a $250 gain rather than the $50 the average suggests. Mutual fund shares are bought at net asset value plus any front-end sales charge, and that total is their starting basis.
What mistakes do people make with cost basis?
Most basis mistakes overstate the gain, because an adjustment was missed or a record was lost, though a few understate it.
- Treating a blank box 1e as zero. A noncovered sale still had a cost. Rebuild it from statements, the transfer agent and historical prices; FINRA warns that without records you may be stuck with the broker's figure or with zero.
- Using the decedent's purchase price for inherited shares. The heir's basis is the value at death, usually higher, which shrinks the gain.
- Using the gift date's value for a gift that had risen. Appreciated gifts carry the giver's basis, so the giver's records matter.
- Ignoring return of capital. An uncut basis understates the gain, and distributions after basis reaches zero are taxable gains in the year paid.
- Leaving pre-split records undivided. The 40 shares at $62.67 in the first example must become 120 shares at $20.89, or the per-share basis is three times too high.
- Assuming the broker caught everything. Brokers may ignore events outside the account, such as a repurchase elsewhere that creates a wash sale, so your figure can differ from box 1e.
