FinWiz

Cost Basis Explained: How It Affects Your Tax Bill

intermediate8 min readUpdated March 15, 2026

Key Takeaways

  • Cost basis is the original value of an asset for tax purposes, used to calculate your capital gain or loss when you sell
  • Three primary calculation methods are FIFO (first in, first out), LIFO (last in, first out), and specific identification (you choose which shares to sell)
  • Adjusted basis accounts for stock splits, reinvested dividends, commissions, and fees — failing to adjust properly can cause you to overpay taxes
  • All cost basis calculations are reported on IRS Form 8949 and Schedule D when you file your tax return
  • Choosing the right cost basis method can save thousands of dollars in taxes over your investing lifetime

What Is Cost Basis?

Cost basis is the original purchase price of an investment, adjusted for certain events, that the IRS uses to determine your taxable gain or loss when you sell. In its simplest form, you bought a stock at one price and sold it at another — the difference is your capital gain or loss, and cost basis is the starting point of that calculation.

If you bought 100 shares of Apple at $150 per share, your cost basis is $15,000. If you later sold those shares at $200 each for $20,000, your taxable capital gain is $5,000 ($20,000 sale proceeds minus $15,000 cost basis). This gain is then subject to either short-term or long-term capital gains tax rates depending on your holding period.

The concept seems straightforward with a single purchase and single sale. But when you buy shares at different times and different prices — which virtually every active investor does — determining which shares you sold and at what cost basis becomes significantly more complex.

How Cost Basis Is Calculated

Your total cost basis includes more than just the share price. It encompasses all costs directly associated with acquiring the investment.

Cost Basis = Purchase Price + Commissions + Fees

Per-Share Cost Basis = Total Cost Basis / Number of Shares

Example: Purchase: 200 shares at $50.00 = $10,000.00 Commission: $4.95 SEC fee: $0.05 Total Cost Basis: $10,005.00 Per-Share Cost Basis: $10,005.00 / 200 = $50.025

While commissions have largely disappeared at major brokerages (Schwab, Fidelity, Robinhood, and Webull all offer commission-free stock trading), they still apply in certain scenarios — options contracts, OTC stocks, foreign exchanges, and some full-service brokers. Any commission or fee paid to acquire an investment adds to your cost basis.

This is actually beneficial from a tax perspective. A higher cost basis means a smaller taxable gain (or a larger deductible loss) when you sell. Never forget to include transaction costs in your basis calculations.

FIFO: First In, First Out

FIFO (First In, First Out) is the default cost basis method used by most brokerages and the IRS. Under FIFO, when you sell shares, the IRS assumes you are selling the oldest shares first — the ones you purchased earliest.

Consider this example:

  • January: Buy 100 shares at $40 (cost basis: $4,000)
  • June: Buy 100 shares at $55 (cost basis: $5,500)
  • November: Buy 100 shares at $70 (cost basis: $7,000)
  • December: Sell 150 shares at $75 (proceeds: $11,250)

Under FIFO, the 150 shares sold are assumed to be the first 100 shares (bought at $40) plus 50 of the next lot (bought at $55).

FIFO Calculation: First 100 shares: Sold at $75 − Bought at $40 = $35 gain × 100 = $3,500 Next 50 shares: Sold at $75 − Bought at $55 = $20 gain × 50 = $1,000 Total Taxable Gain: $4,500

Remaining shares after sale: 50 shares with cost basis of $55 100 shares with cost basis of $70

FIFO tends to produce larger taxable gains in rising markets because you are selling the cheapest shares first. However, it also tends to produce long-term capital gains more often (since the oldest shares have been held longest), which are taxed at lower rates.

LIFO: Last In, First Out

LIFO (Last In, First Out) assumes you sell the most recently purchased shares first. This method is less common for equities in the U.S. (it is more associated with inventory accounting) but understanding the concept is valuable for comparison.

Using the same example:

  • December: Sell 150 shares at $75

Under LIFO, you would sell the 100 shares bought at $70 first, then 50 of the shares bought at $55.

LIFO Calculation: Last 100 shares: Sold at $75 − Bought at $70 = $5 gain × 100 = $500 Next 50 shares: Sold at $75 − Bought at $55 = $20 gain × 50 = $1,000 Total Taxable Gain: $1,500

Tax savings vs. FIFO: $4,500 − $1,500 = $3,000 less taxable gain

LIFO produces a smaller gain in this rising-market scenario because you sell the most expensive shares first. However, the remaining shares (the oldest, cheapest ones) would produce larger gains when eventually sold, so LIFO defers taxes rather than eliminating them.

Pro Tip

In most brokerage accounts, you cannot formally elect "LIFO" for stocks. Instead, you achieve the same result through specific identification, which allows you to choose exactly which shares to sell. Contact your broker or adjust settings in your account to enable specific lot selection before placing sell orders.

Specific Identification

Specific identification gives you the most control over your tax outcome. Instead of defaulting to FIFO or any other formula, you explicitly identify which lots (specific purchases) you want to sell.

This method requires you to specify the shares at the time of sale — you cannot go back and retroactively assign which shares were sold. Your broker must confirm the identification, and you must keep records documenting your selection.

Most modern brokerages make this easy through their platforms. On Fidelity, Schwab, and TD Ameritrade, you can view all your tax lots for a position and select exactly which ones to sell when placing an order.

When to use specific identification:

  • Minimize current-year taxes: Sell the highest-cost-basis shares first to minimize your taxable gain
  • Harvest losses: Sell shares that are underwater while keeping your profitable lots. This is the foundation of tax-loss harvesting
  • Control long-term vs. short-term: Sell lots held over one year to qualify for lower long-term capital gains rates, even if you have more recently purchased lots
  • Manage income levels: Keep your total realized gains below key tax bracket thresholds

Adjusted Basis: When Cost Basis Changes

Your cost basis is not necessarily locked in at the original purchase price. Several events can adjust your basis after the initial purchase.

Stock Splits

When a company executes a stock split, your share count increases but your total cost basis remains the same — the per-share basis is divided accordingly.

If you bought 100 shares at $200 (total basis: $20,000) and the company does a 4-for-1 split, you now own 400 shares with a per-share basis of $50 ($20,000 / 400). Your total basis is unchanged.

Reinvested Dividends

When you reinvest dividends to purchase additional shares, each reinvestment creates a new tax lot with its own cost basis. Many investors forget to account for reinvested dividends, which leads to double taxation — you already paid income tax on the dividend when it was received, and if you do not add the reinvested amount to your cost basis, you pay capital gains tax on that same money when you sell.

This is one of the most common and costly tax mistakes individual investors make. If you reinvested $500 in dividends over 10 years, your cost basis should be $500 higher than your original purchase price. Most brokerages track this automatically, but always verify.

Return of Capital Distributions

Some investments, particularly REITs, MLPs, and certain mutual funds, distribute return of capital payments that reduce your cost basis rather than being treated as taxable income when received. A $1 per share return of capital reduces your per-share basis by $1, which increases your eventual capital gain when you sell.

Inherited and Gifted Shares

Inherited stocks receive a stepped-up basis equal to the fair market value on the date of the decedent's death. If your grandmother bought stock at $10 per share and it was worth $100 when she passed away, your cost basis is $100 — not $10. This is one of the most valuable tax benefits in the U.S. tax code.

Gifted stocks carry over the donor's original cost basis in most cases. If someone gifts you stock they bought at $10, your basis is $10, not the current market value. This is called carryover basis.

Form 8949 and Schedule D

All capital gains and losses from stock sales must be reported on IRS Form 8949, which feeds into Schedule D of your individual tax return.

Form 8949 requires the following information for each transaction:

  • Description of the property (stock name and share count)
  • Date acquired
  • Date sold
  • Proceeds (sale price)
  • Cost basis
  • Gain or loss

Your broker provides this information on Form 1099-B, typically available by mid-February each year. However, the 1099-B may not always have your correct cost basis, particularly for shares transferred from another broker, inherited shares, or shares acquired through corporate actions. You are responsible for reporting the correct basis.

Pro Tip

If your broker's 1099-B shows an incorrect cost basis, do not simply accept it. Report the correct basis on Form 8949 using column (f) adjustment codes. Common codes include "B" (basis reported to IRS is incorrect) and "T" (for short-term transactions with basis not reported). Your broker may have your basis wrong for transferred shares, DRIP purchases, or shares acquired in mergers.

Average Cost Method for Mutual Funds

For mutual fund shares (but not individual stocks or ETFs in taxable accounts), the IRS permits an additional method called average cost basis. Under this method, you add up the total cost of all shares purchased (including reinvested dividends) and divide by the total number of shares to arrive at a single average cost per share.

Average Cost Basis = Total Cost of All Shares Purchased / Total Number of Shares

Example: Purchase 1: 100 shares at $20 = $2,000 Purchase 2: 50 shares at $25 = $1,250 Reinvested dividends: 10 shares at $22 = $220 Total: 160 shares, total cost $3,470 Average Cost per Share: $3,470 / 160 = $21.6875

Once you elect average cost for a mutual fund, you must use it consistently for that fund. The average cost method simplifies record-keeping significantly but gives you less tax optimization flexibility compared to specific identification.

Common Cost Basis Mistakes to Avoid

Several recurring errors lead investors to overpay taxes or face IRS scrutiny.

Forgetting reinvested dividends: As discussed, this leads to double taxation. Always ensure your cost basis includes all reinvested dividend purchases.

Ignoring commissions and fees: Every dollar of commission added to your basis is a dollar less of taxable gain. This was more significant when commissions were $7-$10 per trade but still applies in certain situations.

Not tracking wash sales: The wash sale rule disallows a loss if you repurchase a substantially identical security within 30 days. The disallowed loss adds to the cost basis of the replacement shares. Failing to track wash sales creates basis errors that compound over time.

Losing records for old purchases: If you cannot prove your cost basis, the IRS may assign a basis of zero, making your entire proceeds taxable. Keep records of all purchases, or ensure your broker has complete records for transferred positions.

Mishandling corporate actions: Mergers, acquisitions, spin-offs, and reorganizations can create complex basis calculations. When company A merges with company B, your basis in company A must be properly allocated to the new shares received. Your broker's 1099-B supplemental information usually provides the allocation ratios.

Frequently Asked Questions

Which cost basis method should I use?

For most investors, specific identification provides the greatest tax flexibility because you can choose the optimal lots for each sale based on your current tax situation. If you prefer simplicity and are a long-term buy-and-hold investor, FIFO works well because your oldest shares often qualify for lower long-term capital gains rates. Consult a tax professional if you have complex holdings or large positions.

Can I change my cost basis method?

Yes, but with restrictions. For individual stocks and ETFs, you can generally change your default method with your broker at any time for future sales. For mutual funds using the average cost method, switching to specific identification is more restricted — once you adopt average cost, changing back requires careful consideration and may have limitations.

Does my broker track cost basis for me?

Since 2011, brokers are required to track and report cost basis to both you and the IRS for "covered securities" — stocks acquired after January 1, 2011, and mutual funds acquired after January 1, 2012. For older "noncovered" securities or shares transferred from another broker without basis information, you are responsible for maintaining your own records.

How does cost basis work with options?

If you exercise a call option, the premium paid plus the strike price becomes your cost basis for the acquired shares. If you are assigned on a put option, the strike price minus the premium received becomes your basis. If the option expires worthless, the premium is treated as a capital loss. Options cost basis can be complex — see our guide on options taxes for detailed examples.

What is the cost basis for cryptocurrency?

The IRS treats cryptocurrency as property, so cost basis works similarly to stocks. Your basis is the fair market value at the time of acquisition (purchase price plus any fees). For crypto received through mining or staking, the basis is the fair market value at the time you received it (which was also reported as income).

Disclaimer

This is educational content, not financial advice. Trading involves risk, and you should consult a qualified financial advisor before making any investment decisions. Past performance does not guarantee future results.

Frequently Asked Questions

What is the best way to get started with trading taxes?

Start by reading this guide thoroughly, then practice with a paper trading account before risking real capital. Focus on understanding the concepts rather than memorizing rules.

How long does it take to learn cost basis explained?

Most traders can grasp the basics within a few weeks of study and practice. However, developing consistency and proficiency typically takes several months of active application.

Related Articles