Average Cost Basis Calculator

If you’ve bought shares of the same stock or ETF at different prices over time, your average cost basis is what you actually paid per share on average. It’s the number you need for tracking gains, losses, and taxes. Add each purchase below to calculate it.

How It’s Calculated

Average Cost Basis = Total Amount Invested ÷ Total Shares Owned. For example, if you bought 10 shares at $45 and later 5 shares at $52.50, you’ve spent $712.50 for 15 shares — an average cost basis of $47.50 per share.

Why Average Cost Basis Matters

Your cost basis is what you compare a stock’s current price against to see your actual gain or loss, and it’s also what tax reporting is based on when you sell. This calculator gives a simple average — note that if you sell only part of a position, your broker may use a different accounting method (like FIFO or specific-lot identification), so check your brokerage statements for the exact figures used at tax time.

How to Use This Calculator

  1. Enter the number of shares from your first purchase and the price paid per share.
  2. Add each additional purchase as a separate row, including fractional shares when applicable.
  3. Select Calculate Average Cost to see total shares, total amount invested, and average cost per share.
  4. Compare the result with your broker’s records before using it for tax reporting.

Result Interpretation

A current market price above the calculated average indicates an unrealized gain before fees and taxes; a lower market price indicates an unrealized loss. The result is a weighted average, not a simple average of purchase prices.

Limitations and Tax Considerations

This tool does not adjust for stock splits, return of capital, wash sales, transferred shares, reinvested distributions, commissions, or partial sales. Tax rules may require FIFO, specific-lot identification, or another permitted basis method. The IRS explains that dividend-reinvestment shares generally have a basis equal to their cost plus applicable adjustments; review the IRS guidance on stock basis and dividend reinvestment plans and consult a qualified tax professional for your circumstances.

FAQ

Can I enter fractional shares?

Yes. The calculator accepts decimal share quantities, which is useful for dividend reinvestment and fractional-share purchases.

Does this choose the tax lots I sold?

No. It calculates an overall weighted average only. Your broker’s confirmed lot-selection and tax records control the basis reported for a sale.

Worked Example

Say you bought 10 shares at $100 and later bought 10 more shares at $80. Your average cost basis is $90 per share ($1,800 invested ÷ 20 shares).

What This Means

If the stock is now trading at $95, your position is worth about $5 per share more than your average purchase price — roughly $100 of unrealized gain across your 20 shares, before commissions or taxes. It’s a paper gain only; nothing is realized until you actually sell.

Related Tool

Once you know your average cost basis, use the Stock Profit/Loss Calculator to see your exact profit or loss, including commissions, if you sell at a given price.

Weighted Average Example Step by Step

PurchaseSharesPrice per sharePurchase cost
First10$45.00$450.00
Second5$52.50$262.50
Third8$40.00$320.00
Total23—$1,032.50

The weighted average cost is $1,032.50 ÷ 23 shares = $44.8913 per share. A simple average of the three purchase prices would be wrong because the number of shares bought at each price is different.

Average Purchase Price vs. Tax Cost Basis

The calculator provides an overall weighted average purchase price for the shares entered. Tax cost basis can be different after commissions, stock splits, return-of-capital distributions, wash-sale adjustments, inherited or gifted shares, reorganizations, and reinvested dividends.

For U.S. tax reporting, do not assume that an overall average can be used for every sale. The permitted basis method depends on the asset and the election or instructions on file with the broker. Mutual-fund shares may qualify for an average-basis method under applicable rules, while individual stock lots are commonly reported using specific identification or a default method such as FIFO. Use the broker’s tax-lot records and Form 1099-B when preparing a return.

Records to Keep

  • Trade confirmations showing date, shares, price, and commissions.
  • Statements documenting reinvested dividends and capital-gain distributions.
  • Corporate-action notices for splits, mergers, spin-offs, and return of capital.
  • Records for transferred, inherited, or gifted securities.
  • Tax-lot selections and the broker’s sale confirmation.
  • Forms 1099-B and 8949 used for tax reporting.

Common Input Mistakes

  • Averaging purchase prices without weighting them by share quantity.
  • Entering total purchase cost in the price-per-share field.
  • Leaving out fractional shares from dividend reinvestment.
  • Using pre-split share quantities with post-split prices.
  • Ignoring commissions or basis adjustments recorded by the broker.
  • Using the calculator’s overall average as the tax basis of a partial sale without checking the selected tax lot.

Official Tax Resources

Last reviewed September 18, 2026. This calculator is for educational record-checking only and does not determine the tax-lot method required for a sale. Consult current broker records and a qualified tax professional when appropriate.