Cost basis is the number that determines how much tax you owe when you sell an investment. Get it right and you could save hundreds or thousands of dollars. Ignore it, and you may pay tax on gains you’ve already paid tax on — or on gains you don’t actually have.

Why Cost Basis Matters

$$\text{Capital Gain or Loss} = \text{Sale Proceeds} - \text{Cost Basis}$$

The IRS taxes the gain. A higher basis means a smaller gain — and less tax. A lower basis means a larger gain.

Example: You sell 100 shares of a stock for $8,000.

  • If your basis is $3,000 → $5,000 taxable gain
  • If your basis is $6,500 → $1,500 taxable gain
  • If your basis is $9,000 → $1,000 capital loss (deductible)

How Cost Basis Is Calculated

Simple Purchase

For a single purchase with a brokerage commission:

$$\text{Basis} = \text{Purchase Price} + \text{Commissions and Fees}$$

Example: 100 shares at $45 each + $9.99 commission = $4,509.99 total basis ($45.10 per share)

Since most brokers now offer commission-free trading, basis is typically just the purchase price.

Multiple Purchases (Lots)

If you bought the same stock multiple times at different prices, you have multiple “lots”:

Purchase Date Shares Price Per Share Lot Basis
Jan 2023 50 $40 $2,000
Jun 2023 50 $55 $2,750
Dec 2024 100 $62 $6,200
Total 200 $10,950

When you sell, which lot you’re selling determines your gain or loss.

Cost Basis Methods

FIFO (First In, First Out)

The IRS default for most securities. The oldest shares are assumed sold first. If you sell 50 shares from the example above, FIFO sells the January 2023 lot at $40/share basis.

When FIFO helps: If your oldest shares have the highest basis (you bought when prices were higher).
When FIFO hurts: If your oldest shares have the lowest basis (you bought cheap, and they’ve appreciated the most — FIFO sells those first, maximizing your taxable gain).

Specific Share Identification

You designate exactly which shares you’re selling. This gives you the most control over your tax outcome. You can choose to sell high-basis shares first to minimize current-year gains — or low-basis shares to realize losses for harvesting.

Requirement: You must identify specific lots at the time of sale (before settlement). Keep records of your election. Most modern brokers let you do this in the order ticket.

Average Cost (Mutual Funds Only)

For mutual funds, you can elect average cost — the total basis divided by total shares.

$$\text{Average Cost Per Share} = \frac{\text{Total Basis}}{\text{Total Shares}}$$

From the example above: $10,950 ÷ 200 shares = $54.75 per share average basis

This simplifies record-keeping but gives you less control over which gains are realized.

Special Situations

Inherited Assets — Step-Up in Basis

Inherited assets receive a stepped-up basis to fair market value on the date of death. This eliminates all pre-death appreciation from taxation.

Example: Parent bought stock for $5,000 in 1990. Value at death in 2026: $180,000.
Your basis: $180,000. If you sell immediately for $180,000: $0 capital gain.

Gifted Assets — Carryover Basis

Assets received as a gift generally carry over the giver’s original basis:

  • If you sell at a gain: Your basis is the giver’s original basis
  • If you sell at a loss: Your basis is the lower of the giver’s basis OR fair market value at the time of the gift

Example: A friend gifts you shares with a $2,000 original basis now worth $8,000. You sell for $8,000 → $6,000 gain (taxed to you).

Reinvested Dividends

Each dividend reinvestment creates a new lot:

Date Dividend Shares Purchased Price New Basis
Mar 2024 $85 1.2 shares $70 $85
Jun 2024 $90 1.1 shares $82 $90
Sep 2024 $92 1.0 shares $92 $92

These lots accumulate over decades of DRIPs. Track them or you’ll double-pay on that income (once as dividend income, again as understated basis at sale).

Stock Splits

A 2-for-1 split: 100 shares at $80 basis/share → 200 shares at $40 basis/share. Total basis unchanged at $8,000.

A reverse 10-for-1 split: 200 shares at $4 basis/share → 20 shares at $40 basis/share. Total basis unchanged at $800.

Tracking Your Basis

Situation Who Tracks Basis
Stocks purchased after Jan 1, 2011 Your broker (covered securities — reported to IRS)
Stocks purchased before 2011 You (uncovered — not reported to IRS)
Mutual funds purchased after Jan 1, 2012 Your broker
Gifted assets You (using giver’s records)
Inherited assets You (using estate records or appraisal)

Keep all brokerage confirmations, Form 1099-B statements, and purchase records indefinitely — not just for 3–7 years. You may hold investments for decades.

Your cost basis determines your taxable gain or loss when you sell — see 2026 capital gains tax rates for the rates that apply based on your income and holding period. If you receive shares through an ESPP, cost basis tracking requires special attention — see ESPP guide for how shares are priced at vesting and grant. For how cost basis connects to tax-efficient investing, see investment strategies.

WealthVieu
Written by WealthVieu

WealthVieu researches and writes data-driven personal finance guides using primary sources including the IRS, Bureau of Labor Statistics, Federal Reserve, and Census Bureau.

The content on Wealthvieu is for informational purposes only and should not be considered financial, tax, or investment advice. Consult a qualified professional before making financial decisions. Full disclaimer · Editorial policy