Understanding how cost basis works can reduce reporting mistakes and help you make more tax-efficient sell decisions.
Financial & Tax Disclaimer: This content is for educational purposes only and does not provide tax, legal, accounting, or investment advice. Rules can vary by jurisdiction and by your personal situation. Before acting, review official IRS guidance and the tax-lot rules for your brokerage account, or consult a qualified tax professional.
The size of your tax bill depends on your holding period and what you paid for the shares (your cost basis). Cost basis is the starting point for calculating a gain or loss when you sell, and it can be adjusted by certain events over time.
Brokers track shares in tax lots and apply a default “disposal method” unless you choose a different one. Your choice can change the gain or loss reported for a sale—sometimes by a lot.
At a high level, most investors run into three common approaches:
- FIFO (first-in, first-out): oldest lots are treated as sold first.
- Most-recent-lots-first (often labeled “LIFO” by broker platforms): newest lots are treated as sold first.
- Average cost (average basis): commonly used for mutual fund shares when properly elected.
The key rule underneath these methods is whether you adequately identify which shares you sold. If you don’t, the default treatment generally applies (commonly FIFO).[2]
What Is Cost Basis and Why It Matters for Your Investments
Defining cost basis in investing terms
Cost basis is the amount you invested in a position for tax purposes. For most investors, it starts with what you paid for the shares, and it may include certain transaction costs depending on how your broker reports and how your records are kept.
Example: You buy 100 shares at $50 and pay a $10 fee. Your total basis is $5,010. If you later sell shares, the tax result depends on which lot(s) are treated as sold.
The role of cost basis in capital gains calculations
When you sell an investment, your taxable result is generally based on the difference between your sale proceeds and your adjusted basis:
- Capital gain = Sale price − Adjusted cost basis
- Capital loss = Adjusted cost basis − Sale price (when the sale price is lower)
Why accurate tracking saves you money
If the wrong lots are treated as sold, your reported gain can be overstated (or understated). That can mean paying more tax than necessary—or having to fix it later. Keeping your own records (trade confirmations, statements, and corporate action notices) is still smart even when brokers provide tax forms.
Tax Lots vs. “Cost Flow” in Accounting (Important Difference)
You’ll often hear FIFO/LIFO/average cost discussed in inventory accounting. Investors hear similar terms because both contexts involve a question like “which units were sold first.” But for securities, the tax outcome is driven by lot identification rules—not inventory rules.
In plain English: for stocks and many ETFs, what matters is whether you properly identify which shares you sold (and your broker confirms that identification). If you don’t, default rules apply.[2]
FIFO Method: First In, First Out Explained
FIFO treats your oldest shares as sold first. In many tax contexts, FIFO is the default if you do not adequately identify the lot being sold.[2]
How FIFO works for investment transactions
FIFO can increase taxable gains in a rising market because your earliest shares may have the lowest purchase price.
Step-by-step FIFO example
- You buy 100 shares at $10 on January 1.
- You buy another 100 shares at $15 on March 1.
- You sell 100 shares on April 1.
FIFO result: the January 1 lot ($10) is treated as sold first, so your basis for the sale is $10/share.
When FIFO may be helpful
- You want simplicity and minimal lot management.
- You’re prioritizing older shares (which may be long-term) when selling.
- You don’t need fine control over which lots are sold.
“LIFO” on Broker Platforms: Last In, First Out Breakdown

In investing, many broker platforms offer a setting labeled LIFO (or “sell newest shares first”). Practically, this is usually a lot-selection instruction: you’re telling the broker which lots to treat as sold. Tax rules still center on whether that identification is properly made and confirmed.[2]
LIFO-style calculation example
You buy:
- 100 shares at $50
- 100 shares at $60
- 100 shares at $70
If you sell 100 shares and your broker applies “newest first,” the $70 lot is treated as sold first. That can reduce taxable gains in a rising market because you’re using a higher basis.
Key takeaway
Don’t assume “LIFO” is universally available for every security type or every account. Always confirm what your broker supports and whether you can select lots at order time.
Average Cost Method: Weighted Average Cost Approach

Average cost (often called average basis) is most commonly associated with mutual fund shares. The IRS discusses average basis elections and how to compute average basis for identical mutual fund shares.[1]
How weighted average cost is calculated
Add up the total cost of all identical shares and divide by the total number of shares. That gives an average cost per share used to compute gains/losses on sales (subject to the rules for making and maintaining an average-basis election).[1]
Simple average vs. weighted average
- Simple average averages purchase prices (ignores share counts).
- Weighted average accounts for how many shares were bought at each price (more accurate for investments).
Single-category vs. double-category averaging
Average basis rules can involve “single-category” or “double-category” treatment depending on the fund and how shares are classified for holding period purposes. The IRS addresses these mechanics in its guidance on average basis for mutual funds.[1]
Specific Identification: Taking Control of Your Cost Basis

Specific identification lets you choose exactly which lots you sell. This is often the most powerful option for tax planning—because you can choose high-basis lots to reduce gains or choose loss lots when harvesting losses (where appropriate). The IRS rules for adequate identification are detailed in the regulations.[2]
What specific lot identification means
You (or your broker) must be able to show which shares from which lot were sold, and the identification must be made in the manner and timeframe required by the rules.[2]
Strategic benefits
- Reduce gains: sell higher-basis lots first.
- Harvest losses: sell lots trading below your basis (when appropriate).
- Manage holding periods: choose long-term or short-term lots to match your goals.
Example tax-lot table
| Purchase Date | Shares | Cost/Share | Total Basis |
|---|---|---|---|
| Jan 2020 | 100 | $50 | $5,000 |
| Jun 2020 | 100 | $60 | $6,000 |
| Dec 2020 | 100 | $70 | $7,000 |
What Your Broker Shows: Where to Find Default Cost Basis Settings
Most major broker platforms show cost basis and tax lots at the position level, and many allow you to select a default disposal method (such as FIFO) and/or choose lots on the trade ticket. Features vary by broker, security type, and account type.
How to find your cost basis screen
- Log in to your brokerage account.
- Open your Holdings or Positions page.
- Click the security to view Tax Lots or Cost Basis.
- Look for Cost Basis Method, Disposal Method, or Lot Selection settings.
Before you sell
- Confirm whether the order will use the default method or requires lot selection.
- Save the trade confirmation and any lot selection confirmation for your records.
- If you use specific identification, make sure the lots selected match what you intended.
Common Mistakes (and How to Avoid Cost Basis Errors)

1) Not checking which lots were sold
Investors often assume they sold “the newest shares” or “the shares I bought last year,” but the broker may apply the default method unless you explicitly select lots.
2) Transfers between brokerages
Basis and lot details can sometimes display incorrectly after transfers. Keep your own records and compare the receiving broker’s tax lots with your original statements.
3) Corporate actions
Splits, mergers, spin-offs, and return of capital can change how basis is allocated or adjusted. Save corporate action notices and year-end tax forms for reference.
Conclusion
Cost basis isn’t just a number on your statement—it’s the foundation for calculating taxable gains and losses. FIFO is often the default, “LIFO” on broker platforms typically means newest-lots-first, and average basis is commonly used for mutual funds when properly elected.
If you want maximum control, learn how to use specific identification and confirm your selections before the trade settles.[2]
FAQ
What is cost basis in simple terms?
It’s what you paid for the shares (your investment amount for tax purposes), adjusted when applicable. When you sell, your gain or loss is based on sale proceeds minus adjusted basis.
Is FIFO always required?
No. FIFO is commonly the default when you don’t adequately identify shares sold. If you properly identify lots and your broker supports it, you can often use specific identification and other lot-selection approaches.[2]
Is “LIFO” allowed for stocks?
Many brokers offer a “newest shares first” option and label it LIFO. For tax purposes, the controlling issue is whether the lots are adequately identified and confirmed under the rules.[2]
When does average cost apply?
Average basis is most commonly used for identical mutual fund shares when properly elected and calculated under IRS guidance.[1]
References
- IRS, Publication 550: Investment Income and Expenses (Including Capital Gains and Losses) (Average basis rules for mutual fund shares).
https://www.irs.gov/publications/p550 - 26 CFR § 1.1012-1, Basis of property (Adequate identification of stock; default treatment when lots are not identified; average basis provisions).
https://www.law.cornell.edu/cfr/text/26/1.1012-1