Cost basis for stocks & mutual funds: Calculation examples and what it is
At a glance
- Cost basis is the original price you paid for an investment, including fees, and is essential for calculating capital gains or losses for tax purposes.
- Different calculation methods – such as FIFO, LIFO, specific identification, and average cost (for mutual funds) – can significantly affect your tax outcome.
- Specific identification offers the most control over your tax situation by letting you choose which shares to sell.
Smart investing decisions for stocks and mutual funds is more than knowing what to buy. When it comes time to sell, you’ll want to understand the concept of cost basis and how it impacts your bottom line.
Essentially, cost basis is what you’ll use to calculate if you have a capital gain or capital loss for tax purposes. Read to understand what cost basis is, how to calculate cost basis with the various cost basis methods (such as First-In, First-Out, Last-In, First-Out, and average cost basis) and how basis affects your taxes.

Heads up: If you cannot establish your basis, the IRS may presume a basis of $0, which could mean a higher tax outcome.
What is cost basis?
Your cost basis for an investment is typically the purchase price of your shares, plus any commissions or fees. You may also hear this referred to as your tax basis or original cost basis.
When you sell your assets, it’s considered a taxable event. For that reason, the Internal Revenue Service (IRS) requires you to report your cost basis information as part of your annual tax filing for that year.
Tracking your cost basis correctly is important as it’s used to determine if you have a capital gain or loss when you sell your assets, which impacts your overall tax liability.
Often when people are trying to understand the meaning of cost basis, they are also trying to determine the capital gains tax implications for that tax year.
Related: How to calculate capital gains
File with H&R Block to get your max refund
How to determine cost basis: Important factors
When calculating your cost basis in stock or mutual funds you sell, accuracy is key. This holds true for tax reporting purposes, but it can also be helpful in evaluating the performance of your investments.
Gather your statements and other documentation to check the following:
- Make sure the amount(s) you’re starting with are correct. You may have bought shares at different periods over time – each purchase may be at different share prices.
- Look for events that have happened since you bought the shares such as dividends received or stock splits as they can impact your total cost basis.
Cost basis methods: How to calculate cost basis
There are a handful of ways to calculate cost basis, each with their own strategy. We’ll break down a few common cost basis methods below.
- First-In, First-Out (FIFO)
- Last-In, First Out (LIFO)
- Specific Share Identification (SSID)
- Average cost
Most investment firms and brokerages use FIFO as the default method. Average cost is usually the default for mutual funds (and not used for cost basis of a stock). However, the default method isn’t always the best option for your situation. That’s why understanding the impacts of cost basis is important.
First-In, First-Out (FIFO)
With the FIFO cost basis method,the first shares you bought are the first ones sold.
Benefit: This method is simple and generally the default method used by brokers.
Example:
- Bought 100 shares at $10
- Bought 100 shares at $20
- You sell 100 shares. The share price on the day of your sale was $25.
- FIFO assumes you sold the $10 shares.
- Multiply $10 x 100 shares to arrive at a cost basis of cost basis = $1,000.
- Multiply $25 x 100 to arrive at the total sale price of $2,500.
- Subtract the cost basis from your sale price: $2,500 – $1,000 and you’d have a capital gain of $1,500.
Last-In, First-Out (LIFO)
If you’re using LIFO for cost basis, the most recently purchased shares are the ones you would sell first.
Benefit: This method may be able to reduce taxable gains in a rising market.
Example:
- Bought 100 shares at $10
- Bought 100 shares at $20
- You sell 100 shares. The share price on the day of your sale was $25.
- LIFO assumes you sold the $20 shares
- Multiply $20 x 100 shares to arrive at a cost basis of $2,000.
- Multiply $25 x 100 to arrive at the total sale price of $2,500.
- Subtract the cost basis from your sale price: $2,500-$2,000 and you’d have a capital gain of $500.
Specific Share Identification
This cost basis method allows you to choose exactly which shares to sell, which can help you manage capital gains or losses more strategically.
You could use this method to take advantage of tax loss harvesting. Typically, people will do this when the share price is lower than your purchase price. If you have a capital loss, you can use it to offset other income and lower your tax bill.
Benefit: Offers the most control over tax outcomes by selecting shares with the highest or lowest cost basis.
Example:
• Bought 100 shares at $10
• Bought 100 shares at $20
• Bought 100 shares at $30
• You sell 100 shares. The share price on the day of your sale was $25.
• You specifically choose to sell the 100 shares purchased at $30.
• Multiply $30 × 100 shares to arrive at a cost basis of $3,000.
• Multiply $25 × 100 to arrive at the total sale price of $2,500.
• Subtract the cost basis from your sale price: $2,500 – $3,000 and you’d have a capital loss of $500.
Average cost basis
Typically used for mutual funds, the average cost method does exactly what the name implies. It averages the cost of all shares purchased, including reinvested dividends, to determine a single cost basis per share.
Benefit: One reason average cost basis is a popular method is that it’s simple to calculate and track, especially when shares are bought at different prices.
Example:
- Bought 100 shares at $10 = $1,000
- Bought 100 shares at $20 = $2,000
- Add both purchases for a total cost of $3,000
- Divide that by 200 shares (total number of shares) for an averagecost per share of $15.
- You sell 100 shares. The share price on the day of your sale was $25.
- Multiply 100 × $15 to arrive at a cost basis of $1,500.
- Multiply 100 x $25 to arrive at a total sale price of $2,500.
- Subtract the cost basis from your sale price: $2,500 – $1,500 for a capital gain of $1,000.
Cost basis for cryptocurrency
If you’re investing in cryptocurrency, you may already be aware that cryptocurrency taxes are different than those of other investments. Where cost basis is concerned, there are some similarities. For example, your cryptocurrency cost basis includes the acquisition cost along with any fees and commissions.
Cost basis method options for crypto
As of January 1, 2025, your cost basis options are dictated by specific IRS rules. These rules may assume you are not completely selling all of your digital assets.
- If your units are held in the custody of a broker, your basis is determined by your standing order, and then First-In, First-Out out if a standing order cannot be found.
- If your units are not held in the custody of a broker, your basis will be determined by using specific identification.
What tax forms are used when reporting the sale of investments?
Your investment firm will send Form 1099-B for the sale of stocks and mutual funds. Depending on the age of your shares, the firm may also be required to send you cost basis information.
Investment companies are not required to provide cost basis information for:
- Stock shares purchased before 2011
- Mutual fund shares purchased before 2012
You’ll use the information found on these documents to report your sale and any taxable gain or loss on your tax return.
Rely on H&R Block for help with reporting your capital gains
While taxes for your investments can be tricky, you don’t have to go it alone. Trust the expertise of H&R Block to help make sense of your taxes. Make an appointment to file with a tax pro or with H&R Block Online.
Was this topic helpful?