Quick Answer
Cost basis is your original purchase price plus any fees, adjusted for stock splits and dividends. For stocks bought at different times, you can choose specific identification, FIFO (first in, first out), or average cost methods. Choosing the highest cost basis shares minimizes your taxable gain — potentially saving 15-37% in taxes.
Best Answer
Robert Kim, Tax Return Analyst
Investors who bought stocks at different times and prices
What is cost basis?
Cost basis is your original investment amount used to calculate capital gains or losses when you sell. According to IRS Publication 551, it includes the purchase price plus any fees, commissions, or other costs. The method you choose to calculate cost basis can significantly impact your tax bill.
The four main cost basis methods
Method 1: Specific Identification (Best for tax savings)
You choose exactly which shares to sell. This gives you maximum control over your tax outcome.
Example: You bought Microsoft stock in three purchases:
In December 2026, Microsoft trades at $350. You want to sell 100 shares ($35,000).
If you specify the March 2025 shares (highest cost):
If you let FIFO apply (January 2024 shares):
Tax difference: $10,000 swing! At 15% long-term capital gains rate, that's $1,500 in tax savings.
Method 2: First In, First Out (FIFO) - Default method
Your broker automatically sells the oldest shares first. This often creates larger gains as older shares typically have lower cost basis.
Method 3: Average Cost (Mutual funds only)
All shares are averaged together. You can't pick and choose specific shares.
Method 4: Last In, First Out (LIFO)
Sells newest shares first. Often better for tax purposes than FIFO but not as flexible as specific identification.
Step-by-step cost basis calculation
Step 1: Start with purchase price
Step 2: Add fees and commissions
Step 3: Adjust for corporate actions
Step 4: Calculate gain/loss on sale
Common cost basis adjustments
Key strategies for minimizing taxes
Strategy 1: Harvest losses first
Sell losing positions before winners to offset gains.
Strategy 2: Specify high-basis shares
Always identify the highest cost basis shares when selling winners.
Strategy 3: Avoid wash sale rules
Don't buy the same stock within 30 days of selling at a loss, or you lose the tax deduction.
Strategy 4: Track everything
Keep detailed records of all purchases, including dividend reinvestments and stock splits.
What you should do
1. Review your broker statements for cost basis information — many brokers now track this automatically
2. Choose specific identification for future sales to maximize tax control
3. Keep detailed records of all transactions, especially for older positions
4. Consider tax-loss harvesting before year-end to offset any gains
Use our refund-estimator tool to see how different cost basis methods could impact your tax refund, and ensure you're not overpaying on investment taxes.
Key takeaway: Choosing the right cost basis method can save thousands in taxes — specific identification gives you maximum control, potentially turning a $5,000 taxable gain into a $5,000 tax-saving loss on the same sale.
Key Takeaway: Proper cost basis calculation using specific identification method can save thousands in taxes by allowing you to choose which shares to sell, potentially turning gains into losses.
Comparison of different cost basis methods and their tax impact
| Method | Control Level | Best For | Tax Impact Example |
|---|---|---|---|
| Specific Identification | Maximum | Active tax management | Can choose $40k basis vs $30k basis = $1,500 tax savings |
| FIFO (Default) | None | Simple tracking | Often creates larger gains as older shares have lower basis |
| Average Cost | None | Mutual funds only | Smooths out basis differences, moderate tax impact |
| LIFO | None | Generally better than FIFO | Usually creates smaller gains than FIFO |
More Perspectives
Robert Kim, Tax Return Analyst
New investors who may not have detailed records of their stock purchases
Cost basis for beginners: Start with good habits
If you're new to investing and haven't been tracking cost basis, don't panic. Most brokers started providing cost basis information automatically in 2011, so your statements likely have what you need.
What to do if you're missing records
For stocks bought after 2011: Your broker's 1099-B should include cost basis. Double-check it's accurate.
For older stocks: You'll need to reconstruct your basis using:
Simple cost basis example for app-based trading
Let's say you use Robinhood and bought GameStop stock during the 2021 hype:
Using FIFO (automatic): You sold the February shares
Key lesson: Even with losses, you still need to report the sale and calculate basis correctly.
Set up good tracking now
1. Screenshot your purchase confirmations — apps sometimes don't keep long-term records
2. Use specific identification for future sales to control your taxes
3. Track dividend reinvestments separately if you have DRIP plans
4. Keep a simple spreadsheet with date, shares, price, and total cost
Key takeaway: Start tracking cost basis now even if you missed it before — your future tax savings will thank you, and most brokers provide the data automatically for recent purchases.
Key Takeaway: New investors should start tracking cost basis immediately and use specific identification for future sales to control tax outcomes, even if past records are incomplete.
Robert Kim, Tax Return Analyst
Long-term investors with decades of stock purchases and dividend reinvestments
Cost basis complexity for long-term investors
As a long-term investor, you likely have the most complex cost basis situations: multiple purchase dates, stock splits, spin-offs, dividend reinvestments, and merger adjustments spanning decades. Proper tracking becomes even more critical as your portfolio grows.
Managing dividend reinvestment plans (DRIPs)
DRIP plans create new cost basis entries every quarter, sometimes for fractional shares. Each dividend reinvestment is treated as a separate stock purchase.
Example: You owned 100 shares of Johnson & Johnson for 20 years with quarterly dividend reinvestments. You now have 127.3 shares with dozens of different cost basis entries. When you sell 50 shares, which ones are you selling?
Strategy: Use average cost method for mutual funds with DRIPs, but specific identification for individual stocks to maximize control.
Handling corporate actions over decades
Stock splits: Your 100 shares of Apple from 1990 became 2,800 shares after multiple splits. Original $1,000 basis is now $0.36 per share.
Spin-offs: When AT&T spun off parts of the company, you had to allocate your original AT&T basis between the remaining company and the new entities based on their relative values.
Mergers: Cash and stock deals require different basis calculations and may trigger immediate taxable events.
Tax-efficient withdrawal strategy
As you near or enter retirement, coordinate cost basis selection with your overall tax strategy:
1. Harvest losses in taxable accounts while taking gains from tax-advantaged accounts
2. Use high-basis shares for current income needs
3. Save low-basis shares for estate planning (heirs get stepped-up basis)
4. Consider Roth conversions in low-income years instead of realizing taxable gains
Key takeaway: Long-term investors need sophisticated cost basis tracking but gain the most from tax optimization — proper planning can save tens of thousands in taxes during retirement withdrawals.
Key Takeaway: Long-term investors with complex portfolios benefit most from meticulous cost basis tracking and strategic share selection, potentially saving tens of thousands in retirement taxes.
Sources
- IRS Publication 551 — Basis of Assets
- IRS Publication 550 — Investment Income and Expenses
Related Questions
Reviewed by Robert Kim, Tax Return Analyst on February 28, 2026
This content is for educational purposes only and is not a substitute for professional tax advice. Consult a qualified tax professional for advice specific to your situation.