Tax Planning

Cost Basis: What It Is and How to Figure It for Stocks and Funds

Figures checked November 16, 2026 against primary sources

Cost basis is the number you subtract from the sale price to find your gain or loss when you sell an investment. The IRS puts it simply in Topic no. 703: "Basis is generally the amount you paid for the asset." For stocks and bonds, that is the purchase price plus costs such as commissions. A higher basis means a smaller taxable gain, so getting it right matters every time you sell.


The Short Answer

  • Bought it: your basis is the purchase price plus commissions and recording or transfer fees.
  • Adjusted basis: the starting basis changes after events such as stock splits, reinvested dividends and return-of-capital distributions.
  • Several purchases: you can name the shares you sell (specific identification). If you cannot, the oldest shares count as sold first (FIFO). Mutual fund and dividend reinvestment shares can also use an average basis.
  • Inherited: generally the fair market value on the date of death, and any sale counts as long-term.
  • Gift: generally the giver's adjusted basis, with a special rule when the stock was worth less than that on the day of the gift.

Your gain or loss is the sale price minus your adjusted basis. For the tax rates that then apply, see our guide to capital gains tax, or run the numbers in the capital gains tax calculator.


What Cost Basis Means

IRS Publication 550 describes basis as "a way of measuring your investment in property for tax purposes. You must know the basis of your property to determine whether you have a gain or loss on its sale or other disposition."

For stocks and bonds you buy, IRS Topic no. 703 says: "your basis is the purchase price plus any additional costs such as commissions and recording or transfer fees." The same applies to mutual funds. Publication 550's example: you buy 100 shares of a fund for $10 a share and pay a $50 commission. Your cost basis is $10.50 a share ($1,050 divided by 100).

Basis is not always what you paid. If you got the investment some other way, by inheritance, as a gift or as pay for work, a different starting point applies. Those cases are covered below.


Adjusted Basis: Splits, Reinvested Dividends and Return of Capital

The number you use when you sell is your adjusted basis. Topic 703: "Before figuring gain or loss on a sale, exchange, or other disposition of property ... you must determine your adjusted basis in that property." For investors, the common adjustments are these.

  • Stock splits and nontaxable stock dividends. Your total basis stays the same but is spread over more shares. Publication 550's example: one share bought for $45, and the company distributes two new shares for each share held. You now own three shares with a basis of $15 each ($45 divided by 3).
  • Reinvested distributions. When a fund reinvests your dividends or capital gain distributions, the basis of the new shares is "the amount of the distributions used to purchase each full or fractional share," per Publication 550. Each reinvestment is a new purchase with its own basis. Leave these out of your records and you overstate your gain when you sell.
  • Return of capital. A nondividend distribution reduces the basis of your stock. Publication 550: "It is not taxed until your basis in the stock is fully recovered."

Which Shares Did You Sell? Specific ID, FIFO and Average Basis

If you bought the same stock or fund more than once at different prices, the basis of a sale depends on which shares count as sold. Publication 550 gives three methods.

MethodHow it worksWho can use it
Specific share identificationYou name the shares to sell. When your broker holds the shares, you tell the broker which shares at the time of the sale and receive a written confirmation within a reasonable time.Stocks, bonds and fund shares
First in, first out (FIFO)If you cannot identify the shares you sold, "the oldest shares you own are considered sold first."The default when shares are not identified
Average basisThe basis of each share is the total basis of all identical shares in the account divided by the number of shares.Mutual fund shares, and shares acquired after 2011 through a dividend reinvestment plan, left in an account with a custodian or agent
Source: IRS Publication 550 (2025), chapter 4.

Points to know before you choose:

  • Average price is limited to funds and reinvestment plans. Publication 550: "Except for certain mutual fund shares ... you cannot use the average price per share to figure gain or loss on the sale of the shares."
  • Once you average, you stay with it for that fund. You can use a cost basis for fund shares "only if you did not previously use an average basis for a sale, exchange, or redemption of other shares in the same mutual fund."
  • Choosing average basis at a broker. For covered securities, you elect it by written notice to the custodian or agent, which can be electronic. You can revoke it by written notice, generally by the earlier of 1 year after the election or the first sale after it.
  • Holding period still uses the oldest shares. Under average basis, "the shares disposed of are considered to be those acquired first" when you work out whether a gain is short-term or long-term.
  • The proof is on you. With specific identification, "You continue to have the burden of proving your basis in the specified shares at the time of sale or transfer."

Specific identification gives you the most control: selling the highest-cost shares first produces the smallest gain or the largest loss. It only works if you name the shares at the time of the sale, not later.


Basis of Inherited Stock

The basis of inherited property is generally its fair market value on the date of the owner's death. Publication 550 lists the alternate valuation date as the other common case, if the estate's personal representative elects it. Two more rules matter when you sell:

  • Always long-term. Publication 550: "If you sell or dispose of inherited property that is a capital asset, the gain or loss is considered long-term, regardless of how long you held the property."
  • Estate tax value. If the executor gives you a Schedule A (Form 8971), Publication 550 says to "use the final estate tax value of the property reported on the Schedule A to determine your basis."

One exception: if you or your spouse gave appreciated property to the person who died within the 1-year period ending on the date of death, and you inherit it back, your basis is the decedent's adjusted basis, not the market value. For the wider estate picture, see what to do with an inheritance and our inheritance tax guide.


Basis of Stock You Received as a Gift

To figure the basis of a gift, Publication 550 says you need the giver's adjusted basis just before the gift, the fair market value at the time of the gift, any gift tax paid on it, and the date of the gift. The rule then depends on whether the stock was worth more or less than the giver's basis on the day you received it.

  • Worth the same or more than the giver's basis: your basis is the giver's adjusted basis. For gifts after 1976, it is increased by the part of any gift tax paid that relates to the increase in value.
  • Worth less than the giver's basis: you have two bases. For figuring a gain, use the giver's adjusted basis. For figuring a loss, use the fair market value at the time of the gift.

The second case can leave you with neither a gain nor a loss. Publication 550's example: the property had an adjusted basis of $10,000 and was worth $9,000 when given. You later sell it for $9,500. Using the $10,000 basis gives a $500 loss; using the $9,000 basis gives a $500 gain. The result: "You have neither gain nor loss." Our gift tax guide covers when the giver owes gift tax.


Other Cases: Stock From Your Spouse, Stock Received as Pay, Wash Sales

  • From your spouse. If property is transferred to you from your spouse, or from a former spouse when the transfer is incident to a divorce, "your basis is the same as your spouse's or former spouse's adjusted basis just before the transfer."
  • Received for services. If you receive investment property as pay for work, you include its fair market value in income, and "The amount you include in income then becomes your basis in the property."
  • After a wash sale. If a loss is disallowed under the wash sale rule, the disallowed loss is added to the basis of the replacement shares. Publication 550's example: you buy 100 shares for $1,000, sell them for $750 and buy 100 shares of the same stock within 30 days for $800. The $250 loss is disallowed and the basis of the new shares is $1,050. The exception is a repurchase inside your IRA or Roth IRA, where no basis is added. See tax-loss harvesting for how the rule works.

Example: From Purchase to Sale

A hypothetical investor buys 50 shares at $40 a share and pays a $10 commission. Later the company splits its stock 2 for 1. Years after that, the investor sells all the shares.

StepSharesBasis
Purchase: 50 × $40 + $10 commission50$2,010 ($40.20 a share)
2-for-1 split: same total basis over twice the shares100$2,010 ($20.10 a share)
Sale of all 100 shares at $30100Proceeds $3,000
Gain: $3,000 minus $2,010$990
Hypothetical example, our arithmetic using the rules in IRS Topic 703 and Publication 550. Commissions on the sale, if any, would also reduce the gain.

If the investor had used the pre-split price of $40.20 a share as the basis for the post-split shares, the gain would be wrong. If they had forgotten the $10 commission, they would have overstated the gain by $10.


Where to Find Your Basis

  • Form 1099-B. For a covered security, the Instructions for Form 8949 say its basis "should be shown in box 1e on Form 1099-B." Generally, a covered security includes stock you acquired after 2010, or after 2011 for mutual fund shares and shares acquired through a dividend reinvestment plan.
  • Older shares. For noncovered securities, such as stock bought before those dates, the broker may not report basis to the IRS, and you enter the correct basis yourself.
  • Lost records. The Form 8949 instructions say: "If you lost or didn't keep records to determine your basis in securities, contact your broker for help."
  • Keep your own record. Publication 550: "You should keep a separate record of each purchase and any dispositions of the shares until all shares purchased at the same time have been disposed of completely."

If the basis on your 1099-B is wrong, you report the correct figure on Form 8949 with an adjustment. Our tax season checklist lists the forms to gather.


Sources & Methodology

  • IRS, Topic no. 703, Basis of assets (last reviewed November 9, 2026): the definition of basis, the purchase-price-plus-costs rule for stocks and bonds, and adjusted basis.
  • IRS, Publication 550 (2025), Investment Income and Expenses, chapter 4: cost basis, basis other than cost (gifts, inheritances, spouses, property received for services), stock splits and dividends, reinvested distributions, share identification, FIFO, average basis, and the wash sale basis adjustment. The fund commission, split, gift and wash sale examples on this page are the IRS's own.
  • IRS, Instructions for Form 8949 (2025): covered securities, basis in box 1e of Form 1099-B, and lost records.

Method notes. Every rule on this page comes from the IRS documents above, read on November 16, 2026. The purchase-to-sale example is our arithmetic and is hypothetical. These rules apply to federal income tax; state treatment can differ.

This article is for general information and is not tax advice. Rules checked against the primary sources on November 16, 2026.


FAQ

What is cost basis in simple terms?
It is your investment in an asset for tax purposes, generally what you paid for it plus costs such as commissions. When you sell, your gain or loss is the sale price minus your adjusted basis.

Do commissions count toward cost basis?
Yes. IRS Topic 703 says the basis of stocks or bonds you buy is "the purchase price plus any additional costs such as commissions and recording or transfer fees."

How do reinvested dividends affect my cost basis?
Each reinvestment buys new shares, and the basis of those shares is the amount of the distribution used to buy them. Add them to your records so you do not pay tax on the same money twice when you sell.

What happens to cost basis after a stock split?
Your total basis stays the same and is divided over the new number of shares. After a split that triples your shares, each share has one third of the old per-share basis.

Which shares are sold first if I don't choose?
The oldest shares. If you cannot identify the shares you sold, Publication 550 treats the shares you acquired first as sold first (FIFO).

What is the cost basis of inherited stock?
Generally its fair market value on the date of death, or on the alternate valuation date if the estate elects it. A sale of inherited stock is treated as long-term no matter how long you held it.

What is the cost basis of stock received as a gift?
Generally the giver's adjusted basis. If the stock was worth less than that on the day of the gift, you use the giver's basis to figure a gain and the lower market value to figure a loss.

What if I can't find my cost basis?
Check box 1e of your Form 1099-B, which shows basis for covered securities. If you lost or did not keep records, the IRS suggests contacting your broker for help.