Skip to main content
Capital Gains: Short vs Long-Term

Cost Basis Explained: The Foundation of Capital Gains Calculation

Pomegra Learn

Cost Basis Explained: The Foundation of Capital Gains Calculation

Your cost basis is the original price you paid for an investment, plus any fees or adjustments. It is the foundation of every capital gains calculation. When you sell an asset, your capital gain or loss is the difference between the sale price and your cost basis. A simple misunderstanding of cost basis can lead to overpaying taxes by hundreds or thousands of dollars over a lifetime of investing. This article clarifies what cost basis is, how to calculate it, and how to track it strategically.

Quick definition: Cost basis is the original cost of your investment, including purchase price and any associated fees or adjustments. Your capital gain is sale price minus cost basis.

Key takeaways

  • Cost basis is the foundation of capital gains calculations; errors here cascade to your entire tax liability
  • Cost basis includes the purchase price and all fees (brokerage commissions, buying spreads, transfer fees), but not holding fees
  • If you buy the same security at multiple prices, you must choose a cost-basis method (FIFO, LIFO, average cost, or specific identification)
  • Specific identification gives you the most control and is often the most tax-efficient method
  • Reinvested dividends increase your cost basis in the underlying position, reducing future gains
  • Cost basis adjustments (stock splits, mergers, spinoffs) carry forward the original basis
  • The IRS requires you to track cost basis; your broker will help, but the ultimate responsibility is yours
  • Incorrect cost basis can trigger audits and result in back taxes and penalties

The Basic Formula

The capital gain or loss when you sell an investment is simple math:

Capital Gain (or Loss) = Sale Price - Cost Basis

If you buy Apple stock for $100 per share and sell it for $150 per share, your gain is $50 per share. If you sell for $80, your loss is $20 per share.

But cost basis is more than just the purchase price. It includes fees.

Components of Cost Basis

Purchase Price

This is the per-share price you paid when you bought the security (or the total price divided by shares if you bought a lump sum).

Commissions and Fees

Any fees you paid to execute the purchase—brokerage commissions, wire fees, advisory fees—are added to your cost basis.

Example:

You buy 100 shares of a stock at $50 per share = $5,000. Your brokerage charges a $50 commission. Your cost basis is $5,050 (total purchase cost). Your per-share cost basis is $50.50.

When you sell, your gain is calculated against $50.50 per share, not $50. This reduces your reported gain and thus your tax.

Many online brokerages eliminated commissions, but fees may still apply (advisory fees, account fees, wire transfer fees, etc.). All trading-related fees should be included in cost basis.

Reinvested Dividends

When you own a dividend-paying stock or fund and dividends are automatically reinvested to purchase additional shares, the purchase price of those new shares (including any dividend reinvestment fees) becomes your cost basis for those shares.

Example:

You buy 100 shares of a dividend stock for $50/share = $5,000 cost basis. The stock pays a $200 dividend (reinvested at $50/share), purchasing 4 additional shares. Your total cost basis is now $5,200 (original $5,000 + $200 of dividend reinvestment).

When you eventually sell all 104 shares, your gain is calculated against the $5,200 total basis, not the original $5,000. Reinvested dividends reduce your net gain.

This applies to mutual funds with reinvested distributions as well. Every distribution reinvested increases your cost basis.

Market Adjustments and Corporate Actions

Certain corporate events adjust cost basis without changing the dollar amount:

Stock Splits: If your stock splits 2-for-1, your per-share cost basis is halved, but total basis remains the same. If you owned 100 shares at $100 basis and the stock splits 2-for-1, you now own 200 shares at $50 basis each. Total basis: still $10,000.

Mergers and Acquisitions: If Company A is acquired by Company B and you receive Company B stock in exchange, your cost basis in the new stock is equal to the fair market value of Company B stock on the exchange date (or the fair market value of the Company A stock you surrendered, whichever is more reliable). This carryover basis ensures the total basis is preserved.

Spinoffs: Similar to mergers, a spinoff allocates your original basis between the parent and spun-off company based on fair market values.

Step-Up in Basis at Death

If you inherit an asset, your cost basis is stepped-up to the fair market value on the date of the decedent's death. This is an enormous tax benefit.

If your grandfather bought Apple stock in 1990 for $1,000 and it's worth $100,000 at his death in 2024, your inherited cost basis is $100,000. If you sell it for $102,000, your gain is only $2,000 (not the original $99,000 appreciation).

The $99,000 of appreciation during your grandfather's lifetime is forgiven and never taxed.

What Does NOT Add to Cost Basis

Holding Fees: Annual fees charged just for holding a security (some advisory accounts charge these) are not part of cost basis. They're deductible investment expenses on your tax return but don't adjust basis.

Selling Commissions: Fees you pay when you sell are not added to your cost basis; they're subtracted from your proceeds. This reduces your gain (which reduces your tax) but doesn't increase your basis.

Market Changes: The price fluctuation of your security does not change your cost basis. Only purchases, sales, and corporate actions affect basis.

Interest Paid on Margin: If you borrow on margin to buy a security, the interest you pay is not part of cost basis; it's a deductible expense.

Tracking Cost Basis

Your brokerage firm is required to track cost basis and report it to the IRS on Form 1099-B (Proceeds from Broker and Barter Transactions). However, you are ultimately responsible for accuracy.

Modern brokers make this easier. Most provide:

  • Historical purchase records showing per-share cost basis
  • Automatic adjustment for splits, mergers, and dividends
  • Year-end tax statements with gain/loss summaries
  • Ability to export cost basis for tax software

But you should:

  • Verify your broker's calculated basis against your records
  • Keep old statements for reference (don't rely solely on the broker in case records are lost)
  • Review basis before selling, especially if you bought at multiple prices

Common Cost Basis Mistakes

Forgetting to include commissions: Some investors calculate cost basis as only the share price, forgetting the commission. This overstates gains and results in overpaying tax.

Not adjusting for stock splits: After a 3-for-1 split, some investors continue using the pre-split cost basis, resulting in an understated per-share basis and overstated gains.

Losing records: If you bought a security years ago and no longer have the statement, you must reconstruct the basis or risk having the IRS assume your entire proceeds are gain. Keep statements forever, or use your broker's records if available.

Mixing up cost basis methods. If you bought the same stock at different prices, you must choose a method (FIFO, LIFO, average cost, or specific identification) and document your choice.

Cost Basis Methods

When you own the same security purchased at different prices, you can choose how to calculate your gain. The IRS allows four methods:

FIFO (First-In, First-Out)

You sell the oldest shares first (the ones you bought earliest).

Example:

You bought:

  • 100 shares on January 1, 2020 at $50/share
  • 50 shares on June 1, 2021 at $60/share
  • 75 shares on January 1, 2023 at $80/share

You sell 150 shares on February 1, 2024 at $100/share.

Using FIFO, you sell the 100 oldest shares (January 2020) and 50 of the June 2021 shares. Your cost basis is (100 × $50) + (50 × $60) = $5,000 + $3,000 = $8,000. Your gain is (150 × $100) - $8,000 = $15,000 - $8,000 = $7,000.

LIFO (Last-In, First-Out)

You sell the newest shares first.

Using LIFO on the same example: you sell the 75 newest shares (January 2023) and 75 of the June 2021 shares. Your cost basis is (75 × $80) + (75 × $60) = $6,000 + $4,500 = $10,500. Your gain is (150 × $100) - $10,500 = $15,000 - $10,500 = $4,500.

LIFO results in a lower gain and thus lower tax (in this example, $4,500 vs. $7,000 gain).

However, note: LIFO is not allowed for mutual funds and is uncommon in practice. It's mainly relevant for stocks and commodities.

Average Cost

You calculate the average price paid per share across all purchases and use that as your cost basis.

Using average cost on the same example: total cost = (100 × $50) + (50 × $60) + (75 × $80) = $5,000 + $3,000 + $6,000 = $14,000. Total shares = 225. Average cost = $14,000 / 225 = $62.22 per share. Your cost basis for 150 shares = 150 × $62.22 = $9,333. Your gain = $15,000 - $9,333 = $5,667.

Average cost is simple and is the default for mutual funds. It's acceptable for stocks but less flexible than specific identification.

Specific Identification

You explicitly identify which shares you're selling by specifying their purchase date and cost.

Using specific identification on the same example, you could choose to sell the 75 shares from January 2023 (highest cost, $80/share) and 75 shares from June 2021 ($60/share). Cost basis = (75 × $80) + (75 × $60) = $10,500. Gain = $15,000 - $10,500 = $4,500.

Or, you could choose to sell the 100 shares from January 2020 and 50 from June 2021. Cost basis = $8,000. Gain = $7,000.

Specific identification gives you complete control over your gain and is often the most tax-efficient method.

Which Method Is Best?

For most investors, specific identification is optimal because it gives you the flexibility to minimize gains in high-income years and harvest losses strategically.

However, specific identification requires you to document your intent. You must tell your broker (in writing, via your account) which shares you're selling before the sale is executed. If you don't specify, most brokers default to FIFO.

For mutual funds, you're usually stuck with average cost, which is the IRS default for funds. Specific identification is less commonly available for funds.

A Detailed Cost Basis Example

Let's trace a position from purchase to sale:

  1. January 2022: You buy 100 shares at $50/share. Cost basis = $5,000.
  2. June 2022: The company pays a $100 dividend, reinvested at $60/share, purchasing 1.67 shares. New cost basis = $5,000 + $100 = $5,100. Total shares = 101.67.
  3. January 2023: The stock splits 2-for-1. You now own 203.34 shares. Total cost basis remains $5,100. Per-share basis = $5,100 / 203.34 = $25.07.
  4. January 2024: You sell 100 shares at $80/share.
    • Using FIFO: You sell 100 of the original January 2022 shares (cost basis $25/share for the split-adjusted basis). Gain = (100 × $80) - (100 × $25) = $8,000 - $2,500 = $5,500.
    • Using specific identification to sell the dividend shares first: Cost basis is slightly higher per share because the dividend shares were purchased at a higher price relative to the split. But the principle is the same: you control which shares you sell and thus your gain.

Tracking basis through all these corporate actions is complex, but your broker handles most of the adjustments automatically. Verify that the final cost basis reported matches your expectations.

Common Mistakes

Assuming cost basis is only the share price. It includes commissions and fees. Many investors don't add these back, overstating their gains.

Not adjusting basis after dividends are reinvested. Every reinvested dividend increases your cost basis. If you ignore this, you'll overstate your gain when you sell.

Choosing a cost-basis method without documenting it. If you use specific identification, you must document which shares you sold (usually through your broker's interface). Without documentation, the IRS may disallow your method and use FIFO instead.

Failing to account for stock splits or mergers. Your broker usually handles this, but verify. A miscalculation here affects all future basis calculations.

Not keeping records. If your broker loses records (rare, but possible), you need backup documentation. Keep statements for at least 7 years (the IRS statute of limitations for most audits).

Using LIFO for mutual funds. Most mutual fund custodians don't support LIFO. Check with your provider before assuming it's available.

FAQ

If I lose my broker statement, how do I prove my cost basis? Ask your broker for historical account records. Most brokerages maintain archival records for 7+ years. If records are unavailable, the IRS may allow you to reconstruct basis using trade confirmations, bank statements, or other evidence. As a last resort, if basis cannot be proven, the IRS may deem your entire proceeds as gain.

Does my cost basis change if my stock price falls? No. Cost basis is locked in at the time of purchase and adjusted only for dividends, splits, mergers, and fees. If you buy at $100 and the stock falls to $50, your cost basis is still $100.

Can I adjust my cost basis after I've filed my tax return? Yes, through an amended return (Form 1040-X). If you discover that your cost basis was incorrect, you can file an amended return to claim a refund or pay additional tax. However, amended returns are subject to the statute of limitations (typically 3 years, or 7 years if there's substantial underreporting).

What is "adjusted basis"? Adjusted basis is your cost basis after adjustments (for reinvested dividends, stock splits, corporate actions, depreciation, improvements, etc.). It's the true basis used for capital gains calculations.

If I inherit stock, is my cost basis the purchase price my relative paid? No. Your cost basis is stepped-up to the fair market value on the date of death (or alternate valuation date). This is a major benefit and is one reason holding appreciated assets until death is favorable.

Do I need to track cost basis separately for each share I own? You need to track it by lot (purchase date and price). Your broker aggregates this into an average or FIFO basis, but you should know the composition of your position. Use specific identification to track which lots you sell.

Summary

Cost basis is the original price of your investment adjusted for fees, reinvested dividends, and corporate actions. It is the foundation of every capital gains calculation. Accurate cost basis tracking is essential; errors here cascade to your entire tax liability. Your broker provides most of the tracking, but you bear the responsibility. For positions purchased at different prices, you can choose FIFO, average cost, or specific identification—each resulting in different gain calculations. Specific identification often provides the most tax-efficient outcome. Keep detailed records and verify cost basis before selling. Rules and calculations are detailed and may change; confirm current methodology with the IRS or a qualified tax professional.

Next

Cost Basis Methods