Finder makes money from featured partners, but editorial opinions are our own. Advertiser disclosure

Not knowing your stock’s cost basis can cost you

Minimize capital gains tax by identifying the optimal cost basis method for your investments.

If you purchase stocks, the time may come when you’re ready to sell — and knowing what to sell matters. That’s where cost basis comes into play.

Cost basis defined

Cost basis is the amount you paid to purchase an investment, including any trading, commission or brokerage fees. There are several methods that can be used to calculate cost basis, including average cost, specific share identification and first-in, first-out (FIFO).

Cost basis:

The original purchase price of an investment for tax purposes.

The good news is you typically won’t need to run the numbers to determine your cost basis. Your broker has likely already done it for you. But you need to understand how cost basis impacts your investments — primarily because it affects your taxable income.

Why does cost basis matter to you?

For one: it’s an investor’s responsibility to report cost basis information to the IRS by submitting Form 8949. But don’t panic — brokers are required by law to report cost basis and capital gains on Form 1099-B, which they then distribute to investors. Plus, cost basis can help you identify any capital gains earned from the sale of an investment. And knowing how much profit you’ve made from a sale is important, because capital gains are subject to tax. Cost basis can also help you identify potential losses; losses of up to $3,000 can be deducted from your taxable income annually.
Calculating cost basis doesn’t really come into play unless you’re selling investments from a taxable brokerage account. Why? Because investments in tax-advantaged accounts aren’t subject to the same capital gains taxes as investments in taxable accounts, like individual retirement accounts (IRAs) and 401(k)s.

How cost basis works

Cost basis can help you determine capital gains and losses as they pertain to taxable income. Simply put:

  • Gains and losses are the result of subtracting an investment’s cost basis from its sale price.
  • If the figure is a positive number, you’ve generated a capital gain.
  • If the figure is a negative number, you’ve generated a loss.

There are multiple ways to calculate cost basis because how and when you sell off your investments matters. Ultimately, you want to lessen the impact of capital gains. And the cost basis method you use has the potential to impact how much in taxes you’ll pay come tax season.

4 ways to calculate cost basis

While you may not be responsible for crunching the numbers — your broker will do that for you — it will help for you to get a basic understanding of how cost basis can be calculated. It will also help you to identify which method your broker relies on to calculate cost basis. Average cost; specific share identification; first-in, first-out; and last-in, first-out are four of the most popular methods of calculating cost basis. But additional methods also exist. More than likely, your broker will use the average cost basis method.

MethodDescription
Average cost methodThe total amount invested is divided by the number of shares owned.
Specific share identification methodYou hand-pick which shares are sold in order to minimize tax impact.
First-in, first-out (FIFO) methodWhen selling numerous investments of the same type, the first assets bought will be the first to be sold.
Last-in, first-out (LIFO) methodWhen selling numerous investments of the same type, the last assets bought will be the first to be sold.

Calculating cost basis

Cost basis varies by method. And the best way to understand the different methods is to see them in action. Let’s say you bought a number of shares from Company X over the course of four years.

  • Year one: You purchased 50 shares at $10 per share.
  • Year two: You purchased 25 shares at $12 per share.
  • Year three: You purchased 25 shares at $15 per share.
  • Year four: You purchased 50 shares at $16 per share.

Your total investment over four years? $1,975 for 150 shares.
A few months later, you decide you’d like to sell 25 shares at the current market price of $17, resulting in a profit of $425. Let’s see how the cost basis for this sale shakes out by method.

Average cost

Average cost takes the total cost of your combined shares — $1,975 — and divides it by the total number of shares purchased –– 150. This brings your cost basis to $13.16 per share. To arrive at the cost basis of your sale, multiply the cost basis per share by the number shares sold. This works out to a cost basis of $329. After selling 25 shares for $425, you realize a capital gain of $96 for the sale using the average cost method.

Specific share identification

Using this method, you select which shares you’d prefer to sell. Ideally, you want to arrive at the highest figure possible when calculating cost basis to reduce taxable capital gains. The easiest way to do this is by selling shares you purchased for a higher price — in this case, the shares you bought in year four for $16 per share. That said, selling shares you’ve held for less than one year will result in being taxed at short-term capital gains rates, which treats capital gains like ordinary income and can result in higher tax rates.

First-in, first-out (FIFO)

The first-in, first-out method dictates that the shares you bought first will be the first sold. Since your first batch of 50 shares was purchased for $10 per share, your sale of 25 shares will result in a cost basis of $250.
After selling 25 shares for $425, you realize a capital gain of $175 for the sale using the first-in, first-out method.

Last-in, first-out (LIFO)

The last-in, last-out method dictates that the shares you bought last will be the first sold. Since your final batch of 50 shares was purchased for $16 per share, your sale of 25 shares will result in a cost basis of $400. Keep in mind that you’ll be taxed at short-term capital gains rates because you’re selling shares that were purchased less than one year ago. After selling 25 shares for $425, you realize a capital gain of $25 for the sale using the last-in, first-out method.

Adjusted cost basis: 7 factors that affect cost basis

If cost basis was nothing more than the price you paid for an investment, things would be a whole lot simpler. But that isn’t the case. When determining cost basis, you need to adjust your calculations based on a handful of additional factors — and these factors differ depending on the type of investment you’re selling.

1. Dividends

The biggest factor you need to consider when calculating the adjusted cost basis of a stock is dividends. If you purchased 10 shares for $100, received a dividend of $6 and reinvested the dividend, your adjusted cost basis would be $106 — not the $100 you paid for the initial investment.

2. Bond interest

Now, bonds don’t pay dividends, but they do pay interest. But you don’t need to factor interest into your adjusted cost basis for bonds because bond interest is taxed as ordinary income — not a capital gain.

3. Stock splits

Stock splits will affect your cost basis, but the overall value of your investment will remain unchanged. So, let’s say you purchased 10 shares for $100 and the company issued a 2:1 stock split. Now your 10 shares have become 20 shares and your per share cost basis dropped from $10 per share to $5 per share.

4. Mergers and acquisitions

Mergers may also affect your cost basis — but not always. If a merger results in a difference in the number of shares you hold, this will affect your cost basis in much the same way as a stock split. More shares will result in a smaller cost basis. But for most mergers, the cost basis of the stock after the acquisition will be factored into the restructuring of the stock.

5. Real estate

Finding the adjusted cost basis for real estate investments can get complicated in a hurry — and that’s because there are numerous factors that affect the value of real estate after it’s been purchased, including:

  • Home improvements and renovations.
  • Depreciation.
  • Insurance payouts.
  • Zoning costs.
  • Residential energy credits.

You may have paid $100,000 to acquire a rental property, but if you spent $10,000 to redo the roof, you’ve increased the value of the property and this needs to be factored into the adjusted cost basis.

6. Inherited or gifted investments

Inheriting investments can also complicate the adjusted cost basis. When valuing an investment that’s been inherited, your cost basis is based on the fair market value of the asset on the date of the individual’s death — not what that person originally paid.
Oh, and if you’re given an investment as a gift by someone who is still alive, the rules — again — diverge:

  • Stock’s fair market value is equal to or greater than the giver’s cost basis: The cost basis is based on the giver’s cost basis.
  • Stock’s fair market value is less than the giver’s basis: The cost basis is based on fair market value on the date the investment was gifted.

7. Short- and long-term capital gains

Short- and long-term capital gains come into effect when relying on the specific share identification method of calculating cost basis. Essentially, you need to take into account the amount of time you’ve held an investment when picking which investments to sell off. Is it worth selling shares you’ve held for less than a year and getting taxed at the potentially higher short-term rate? Possibly. How much did you pay for those shares? Will selling them result in higher capital gains? Bigger capital losses? These must all be factored into your decision before you sell.

Compare stock trading platforms

1 - 8 of 8
Name Product Ratings Available asset types Stock trade fee Minimum deposit Cash sweep APY Signup bonus
Tastytrade
Finder Score: 4.4 / 5: ★★★★★
Tastytrade
★★★★★
Stocks, Options, ETFs, Cryptocurrency, Futures, Treasury Bills
$0
$0
N/A
Get $50-$5,000
Competitive, capped options commissions, with a reliable trading platform designed for serious traders.
SoFi Invest®
Finder Score: 4.2 / 5: ★★★★★
SoFi Invest®
★★★★★
Stocks, Options, Mutual funds, ETFs, Alternatives
$0
$0
0.02%
Get up to $10,000 cash
Commission-free stocks, ETFs and options, with no options per-contract fees. Plus, a no-cost robo-advisor and complimentary access to certified financial planners (CFPs).
OPTO
Finder Score: 3.1 / 5: ★★★★★
OPTO
★★★★★
Stocks, ETFs
$0
$0
N/A
Earn up to $300
AI-driven thematic investing, with proprietary research, fractional shares and commission-free stocks and ETFs.
Wealthfront
Finder Score: 4.5 / 5: ★★★★★
Wealthfront
★★★★★
Stocks, ETFs
$0
$500
5%
Get $50
Automated stock and bond ETF investing with the ability to trade individual stocks for as little as $1 apiece.
E*TRADE from Morgan Stanley
Finder Score: 4.2 / 5: ★★★★★
E*TRADE from Morgan Stanley
★★★★★
Stocks, Bonds, Options, Mutual funds, ETFs, CDs, Futures
$0
$0
0.01% to 0.15%
Get up to $1,000
terms apply
$0 commissions on US-listed stocks, ETFs, mutual funds and options, with powerful, easy-to-use tools and complimentary market research.
Robinhood
Finder Score: 4.4 / 5: ★★★★★
Robinhood
★★★★★
Stocks, Options, ETFs, Cryptocurrency
$0
$0
5%
Get a free stock
Trade stocks, options, ETFs and crypto without commissions and on a user-friendly platform. Plus, a 1% IRA match and no options contract fees.
Public.com
Finder Score: 4.2 / 5: ★★★★★
Public.com
★★★★★
Stocks, Bonds, Options, ETFs, Cryptocurrency, Alternatives, Treasury Bills, High-yield cash account
$0
$0
5.1%
Get up to $10,000 and transfer fees covered
Build a diversified portfolio of stocks, bonds, options, ETFs, crypto and alternative assets, with a high-yield cash account and options contract rebates.
Moomoo
Finder Score: 4.3 / 5: ★★★★★
Exclusive
Moomoo
★★★★★
Stocks, Options, ETFs
$0
$0
Up to 8.10%
Get up to 15 free stocks
No commission stock, ETF and options trades, with $0 equity options contract fees, low margin rates and advanced trading tools.
loading

Bottom line: Cost basis affects taxes owed

Knowing how to calculate cost basis and what factors you need to adjust for is important because the cost basis of your investments impacts the amount of tax you owe. True tax-free investments don’t exist, but knowing how to minimize taxes owed on your investments can help.

Paid non-client promotion. Finder does not invest money with providers on this page. If a brand is a referral partner, we're paid when you click or tap through to, open an account with or provide your contact information to the provider. Partnerships are not a recommendation for you to invest with any one company. Learn more about how we make money.

Finder is not an advisor or brokerage service. Information on this page is for educational purposes only and not a recommendation to invest with any one company, trade specific stocks or fund specific investments. All editorial opinions are our own.

Shannon Terrell's headshot
Editor

Shannon Terrell is a lead writer and spokesperson at NerdWallet and a former editor at Finder, specializing in personal finance. Her writing and analysis on investing and banking has been featured in Bloomberg, Global News, Yahoo Finance, GoBankingRates and Black Enterprise. She holds a bachelor’s degree in communications and English literature from the University of Toronto Mississauga. See full bio

's expertise
has written 174 Finder guides across topics including:
  • Share trading
  • Robo-advisors
  • Merchant services

More guides on Finder

Ask a question

Finder.com provides guides and information on a range of products and services. Because our content is not financial advice, we suggest talking with a professional before you make any decision.

By submitting your comment or question, you agree to our Privacy and Cookies Policy and finder.com Terms of Use.

Questions and responses on finder.com are not provided, paid for or otherwise endorsed by any bank or brand. These banks and brands are not responsible for ensuring that comments are answered or accurate.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Go to site