Cost Basis Calculator
Calculate cost basis with instant, accurate results and clear step-by-step output.
Original price paid per share.
Shares acquired at the purchase price.
Adds to cost basis (purchase commissions).
Total of all DRIP over the holding period — adds to basis.
Per-share sale price (0 if not yet sold).
About
A cost basis calculator computes the original tax value of an investment, adjusted for commissions, dividend reinvestments, and corporate actions like splits and mergers. Cost basis is the foundation of capital gains tax — when you sell, the capital gain equals sale proceeds minus cost basis. A higher basis means a lower gain and less tax. Tracking basis accurately matters because underreporting basis overstates your gain and overpays tax; overreporting basis understates your gain and exposes you to IRS penalties.
Brokers are required to track and report cost basis on Form 1099-B for shares acquired after January 1, 2011 (stocks), 2012 (mutual funds), and 2013 (bonds and options). For older holdings ("noncovered" shares), the broker reports only the sale proceeds and leaves basis blank — you must determine it yourself. For very old holdings, you may need to reconstruct from historical trade confirmations, broker statements, or even old tax returns. Missing basis for old holdings often leads to defaulting to zero basis (worst case) or FIFO (oldest lots first, usually highest gain).
Corporate actions adjust per-share basis but leave total basis unchanged (for tax-free reorganizations). A 2-for-1 stock split doubles share count and halves per-share basis; total basis stays the same. A 1-for-3 reverse split divides shares by 3 and triples per-share basis. Mergers transfer old basis to new shares, allocated by relative fair market value. Spinoffs allocate a portion of old basis to new shares (IRS Section 358). Companies publish Form 8937 with the exact allocation percentages — always consult it for complex actions rather than guessing.
Three tax lot identification methods determine which shares you sold. FIFO (First-In, First-Out) assumes you sell your oldest shares first — usually the highest gain in rising markets, not tax-optimal. Specific ID lets you pick which tax lots to sell — best for tax planning, allowing you to harvest losses by selling high-basis lots while deferring gains on low-basis lots. Average cost averages basis across all shares — only allowed for mutual funds, not individual stocks. Brokers must support Specific ID for shares acquired after 2011; use it to minimize taxes.
Dividend reinvestments (DRIP) create new tax lots at the reinvestment price — each reinvestment has its own cost basis (reinvested amount / shares purchased) and holding period. Track each lot separately for accurate tax reporting and Specific ID optimization. Reinvested dividends are taxed as dividend income in the year paid (qualified or ordinary), then add to cost basis — so they are not double-taxed on sale. Reinvested capital gains distributions also add to basis. Missing DRIP basis is a common error that overstates gain on sale; some brokers report it separately, others include it in the per-share basis.
For inherited assets, basis is generally stepped up to fair market value at the date of death (or the alternate valuation date, six months later, if elected by the executor). This means beneficiaries inherit the asset with a fresh, higher basis — no capital gains tax is owed on the appreciation during the deceased's lifetime. This is a massive tax benefit for long-held, low-basis assets. Conversely, gifted assets carry over the giver's basis ("carryover basis") — the recipient takes the giver's basis and holding period. Always request basis documentation when receiving gifts of appreciated assets.
How to Use
- 1Enter purchase price and number of sharesType the original purchase price per share and number of shares acquired. The calculator multiplies these for the initial total cost basis. Include any commissions or fees paid at purchase — they add to basis.
- 2Add commissions and dividend reinvestmentsType any commissions paid on the purchase (or sale) and the total dollar amount of dividend reinvestments over the holding period. Both add to cost basis. DRIP dividends were taxed when paid — they're not double-taxed on sale.
- 3Choose corporate action adjustment (if any)Pick None (default), Stock Split, Reverse Split, Merger, or Spinoff. For splits, the calculator multiplies shares by the split ratio and divides per-share basis proportionally. For mergers/spinoffs, you should consult Form 8937 — the calculator applies a simplified 1:1 ratio by default.
- 4Enter sale price and read capital gain / lossType the per-share sale price (or total proceeds). The calculator computes total cost basis, per-share cost basis, total proceeds, and capital gain or loss on the sale. A positive gain is taxable; a loss can offset other gains plus $3,000 of ordinary income per year.
Formula
Original total cost basis:
Basis = (Purchase Price × Shares) + Commission + Reinvestments
Corporate action adjustment:
Adjusted Shares = Shares × Split Ratio · Per-Share Basis = Basis ÷ Adjusted Shares
- Stock split (n-for-1): shares × n, per-share basis ÷ n; total basis unchanged.
- Reverse split (1-for-n): shares ÷ n, per-share basis × n; total basis unchanged.
- Merger: basis transfers to new shares (consult Form 8937 for allocation).
- Spinoff: portion of basis allocates to new shares (Section 358; Form 8937).
Capital gain / loss on sale:
Gain = (Sale Price × Adjusted Shares) − Total Basis
Tax lot identification methods:
- FIFO: oldest lots sold first (usually highest gain).
- Specific ID: pick which lots to sell (optimal for tax planning).
- Average cost: average basis across all shares (mutual funds only).
Inherited assets generally get stepped-up basis to FMV at date of death; gifted assets carry over giver's basis.
Worked Example
Suppose you bought 100 shares at $50/share, paid a $10 commission, and have $200 of dividend reinvestments over 5 years. The company then does a 2-for-1 stock split. You sell all shares at $30/share (post-split).
- Original basis = (100 × $50) + $10 + $200 = $5,210
- 2-for-1 split: shares × 2 = 200 shares; per-share basis ÷ 2 = $26.05
- Adjusted shares = 200, total basis still $5,210
- Proceeds = $30 × 200 = $6,000
- Capital gain = $6,000 − $5,210 = $790 (long-term if held > 12 months)
- Pre-split equivalent: sold 100 shares at $60 (2 × $30) = $6,000. Same basis and gain.
- If FIFO used on multiple lots, oldest lot sold first; with Specific ID you pick which lot to sell.
Tips
- Use Specific ID over FIFO to minimize taxes — sell high-basis lots to harvest losses and defer gains on low-basis lots.
- Track every dividend reinvestment as a separate tax lot — missing DRIP basis overstates your gain on sale.
- Consult Form 8937 from the company for any merger or spinoff — it specifies the exact basis allocation percentages.
- Keep old trade confirmations and statements forever — for noncovered shares (pre-2011), the broker doesn't report basis.
- For inherited shares, basis is generally stepped up to fair market value at date of death — beneficiaries get a fresh, higher basis with no capital gains tax on prior appreciation.
Common Mistakes
- Using FIFO by default in rising markets — sells oldest, lowest-basis lots first, maximizing gain.
- Missing DRIP basis — dividend reinvestments create new tax lots; forgetting them overstates gain.
- Defaulting to zero basis for noncovered (pre-2011) shares — broker doesn't report basis; you must reconstruct.
- Ignoring corporate action adjustments — splits/mergers adjust per-share basis proportionally.
- Forgetting stepped-up basis on inherited assets — beneficiaries get FMV at date of death, no gains tax on prior appreciation.
Frequently Asked Questions
- What is cost basis and why does it matter for taxes?
- Cost basis is the original value of an asset for tax purposes — typically the purchase price plus commissions. When you sell, you owe capital gains tax on the difference between sale price and cost basis (the gain). A higher cost basis means a lower gain and less tax. Tracking cost basis accurately matters because underreporting basis overstates your gain and overpays tax; overreporting basis understates your gain and exposes you to IRS penalties. Brokers are now required to report basis on Form 1099-B for shares acquired after 2011, but you remain responsible for accuracy.
- How do stock splits affect cost basis?
- Stock splits and reverse splits adjust the per-share cost basis proportionally, leaving total cost basis unchanged. In a 2-for-1 split, you double your share count and halve your per-share basis — total cost basis stays the same. In a 1-for-3 reverse split, you divide shares by 3 and triple the per-share basis. The adjustment factor is (post-split shares / pre-split shares). For a 2-for-1 split, factor = 2; multiply old shares by 2, divide per-share basis by 2. Stock splits themselves are not taxable events — no gain or loss is recognized.
- What is the difference between FIFO, Specific ID, and Average Cost?
- These are methods for identifying which shares you sold. FIFO (First-In, First-Out) assumes you sell your oldest shares first — usually highest gain in rising markets. Specific ID lets you pick which tax lots to sell — optimal for tax planning (sell high-basis shares for low gain, hold low-basis for later). Average cost averages basis across all shares in the holding — only allowed for mutual funds, not stocks. For stocks and ETFs acquired after 2011, brokers must support Specific ID — use it to minimize taxes. Average cost is the simplest but usually not optimal.
- How does a merger or spinoff affect cost basis?
- Mergers and spinoffs require cost basis allocation, not a taxable event (if structured as a tax-free reorganization). In a merger, your old company's basis transfers to the new company's shares, allocated based on relative fair market values. In a spinoff, you receive shares in a new company and must allocate a portion of your old basis to them — typically based on the relative FMVs immediately after the spinoff (per IRS Section 358). Companies publish basis allocation statements (Form 8937) showing the exact allocation percentages. Always consult the Form 8937 for the correct basis.
- How do I handle dividend reinvestments in cost basis?
- Dividend reinvestments (DRIP) are purchases at the reinvestment price — each reinvestment creates a new tax lot with its own cost basis (reinvested dividend / shares purchased). Track each lot separately. When you sell, you can use Specific ID to choose which lots to sell. Reinvested dividends are taxed as dividend income in the year paid (qualified or ordinary), then add to cost basis — so they are not double-taxed. Reinvested capital gains are also added to basis. Missing DRIP basis is a common error that overstates gain.
- Why is cost basis tracking harder for older holdings?
- Brokers are required to track and report cost basis on Form 1099-B for shares acquired after January 1, 2011 (stocks), 2012 (mutual funds), and 2013 (bonds/options). For older holdings ("noncovered" shares), the broker reports only the sale proceeds and leaves basis blank — you must determine it yourself. For very old holdings, you may need to reconstruct from historical trade confirmations, broker statements, or even old tax returns. Missing basis for old holdings often leads to defaulting to zero basis (worst case — full sale price taxed as gain) or FIFO (oldest lots first).
Cost basis basics
Cost basis is the original value of an asset for tax purposes — typically the purchase price plus commissions and reinvested dividends, adjusted for corporate actions. When you sell, the capital gain = sale proceeds − cost basis. A higher basis means a lower gain and less tax. Brokers report basis on Form 1099-B for shares acquired after 2011 (stocks), 2012 (mutual funds), 2013 (bonds/options). For older "noncovered" shares, you must determine basis yourself from historical records.
Adjusting for splits and mergers
Corporate actions adjust per-share basis but leave total basis unchanged (for tax-free reorganizations). A 2-for-1 stock split doubles share count and halves per-share basis. A 1-for-3 reverse split divides shares by 3 and triples per-share basis. Mergers transfer old basis to new shares, allocated by relative FMV. Spinoffs allocate a portion of old basis to new shares (IRS Section 358). Companies publish Form 8937 with the exact allocation percentages — always consult it for complex actions.
Specific ID vs FIFO vs avg cost
Tax lot identification methods determine which shares you sold. FIFO (First-In, First-Out) assumes oldest shares — usually highest gain in rising markets, not tax-optimal. Specific ID lets you pick which tax lots to sell — best for tax planning (sell high-basis lots for low gain). Average cost averages basis across all shares — only allowed for mutual funds, not stocks. Brokers must support Specific ID for shares acquired after 2011; use it to minimize taxes by harvesting losses and deferring gains.
Dividend reinvestment tracking
Dividend reinvestments (DRIP) create new tax lots at the reinvestment price — each reinvestment has its own cost basis (reinvested amount / shares purchased) and holding period. Track each lot separately for accurate tax reporting and Specific ID optimization. Reinvested dividends are taxed as dividend income in the year paid (qualified or ordinary), then add to cost basis — so they are not double-taxed. Reinvested capital gains distributions also add to basis. Missing DRIP basis is a common error that overstates gain on sale.
| Method | Cost basis | Proceeds | Gain / Loss | Gain % |
|---|---|---|---|---|
| FIFO (oldest shares) | $5,000 | $9,000 | $4,000 | 80.0% |
| Specific ID (highest basis) | $10,000 | $9,000 | -$1,000 | -10.0% |
| Average cost (mutual funds only) | $7,667 | $9,000 | $1,333 | 17.4% |
Authoritative References
- IRS Publication 550 — Investment Income and Expenses— irs.govIRS Publication 550 — comprehensive guide to investment income, including cost basis tracking, tax lot identification methods (FIFO, Specific ID, Average Cost), and treatment of corporate actions.
- IRS Publication 551 — Basis of Assets— irs.govIRS Publication 551 — the authoritative source on cost basis: how to determine basis for purchased assets, gifts, inheritances, and how to adjust for stock splits, mergers, and spinoffs.
- SEC — Investor Bulletin: Cost Basis— sec.govSEC investor bulletin on cost basis reporting — explains broker requirements, tax lot selection methods, and Form 1099-B in plain language.
Try our other free calculators
CalcGenius has 1,200+ free, ad-free, browser-based calculators for finance, health, math, science, and everyday life. No sign-up required.