Free to Use

Stock Average Cost Basis Calculator

Calculate your average stock price across multiple purchases. Track your cost basis, current value, and profit or loss on any stock position.

๐Ÿ“‹ Your Stock Purchases

Shares Purchased Price Per Share ($) Date (Optional)

Real-World Stock Average Examples

๐Ÿ“ˆ Dollar-Cost Averaging into an ETF

An investor buys shares of an S&P 500 ETF over several months: 10 shares at $420, 15 shares at $415, and 20 shares at $430.

Total Shares: 45

Total Cost: $18,875.00

Average Cost Per Share: $419.44

At Current Price $440: Current Value = $19,800.00, Profit = +$925.00 (+4.90%)

Dollar-cost averaging smooths out market volatility โ€” buying more shares when prices are lower and fewer when prices are higher.

๐Ÿข Building a Position Over Time

A trader builds a position in a tech stock: first buys 50 shares at $85, then adds 30 shares at $92, and finally 20 shares at $78.

Total Shares: 100

Total Cost: $8,570.00

Average Cost Per Share: $85.70

At Current Price $95: Current Value = $9,500.00, Profit = +$930.00 (+10.85%)

Adding shares at different prices changes your average cost basis. A lower average means a lower price target for profitability.

๐Ÿ“‰ Averaging Down After a Drop

An investor initially buys 100 shares at $50. The stock drops to $35, and they buy another 100 shares.

New Total Shares: 200

New Average Cost: $42.50

Total Cost: $8,500.00

By averaging down, the investor lowered their break-even price from $50.00 to $42.50. If the stock recovers to $45, they now have a gain instead of a loss.

Understanding Stock Average Cost Basis

Your cost basis is the average price you've paid for each share of a stock, considering all your purchases over time. When you buy shares at different prices, your average cost per share changes. This is crucial for calculating your true profit or loss when you decide to sell.

The Average Cost Formula

Average Cost = (ฮฃ Sharesแตข ร— Priceแตข) รท ฮฃ Sharesแตข
Sharesแตข = Number of shares in purchase i
Priceแตข = Price per share in purchase i
ฮฃ = Sum across all purchases

How the Calculation Works

1
Calculate total shares: Add up all the shares you've purchased across every buy order.
2
Calculate total cost: For each purchase, multiply shares ร— price per share, then add them all together.
3
Calculate average cost: Divide total cost by total shares to get your average cost per share.
4
Calculate current value: Multiply total shares by the current market price.
5
Calculate profit/loss: Subtract total cost from current value. Divide by total cost and multiply by 100 for the percentage return.

Key Terms to Know

๐Ÿ’ฐ Cost Basis

The original value of an asset for tax purposes, adjusted for stock splits, dividends, and return of capital. Your average cost per share is your cost basis.

๐Ÿ“‰ Averaging Down

Buying additional shares at a lower price than your original purchase, which reduces your overall average cost per share.

๐Ÿ“ˆ Dollar-Cost Averaging

Investing a fixed dollar amount at regular intervals regardless of price. This strategy reduces the impact of volatility on large purchases.

๐Ÿ’ต Unrealized Gain/Loss

The profit or loss on shares you still hold, based on the difference between current market price and your average cost basis.

Tips for Tracking Your Cost Basis

๐Ÿ“Š Keep Detailed Records

Save every trade confirmation. Track the date, number of shares, price per share, and any commissions or fees paid.

๐Ÿ”„ Account for Stock Splits

A 2-for-1 stock split doubles your shares and halves your price per share. Adjust your purchase records accordingly to keep an accurate cost basis.

๐Ÿ’ก Reinvested Dividends Count

If you reinvest dividends, those purchases add to your position and affect your average cost. Don't forget to include them in your calculation.

๐Ÿงพ Tax Implications Matter

When you sell, your cost basis determines your capital gain or loss. Accurate records help you minimize taxes and avoid IRS issues.

๐Ÿ“Š
Multi-Purchase Tracking
Add unlimited purchase entries to track your average cost across all buy orders. Add or remove rows as needed.
๐Ÿ’ฐ
Complete P&L Analysis
See total shares, total cost, average cost per share, current market value, and both dollar and percentage profit/loss.
๐Ÿ“…
Optional Date Tracking
Add dates to your purchases for a complete record of when you bought shares and at what price.
๐Ÿ“
Step-by-Step Breakdown
Follow the complete step-by-step calculation showing how your average cost, total investment, and profit are determined.

What is Stock Average Cost Basis?

Stock average cost basis is the average price you've paid for all the shares you own in a particular stock. When you buy shares at different prices over time โ€” a strategy known as dollar-cost averaging โ€” your cost basis is the weighted average of all those purchases. Knowing your average cost is essential for understanding your true profit or loss and for making informed decisions about when to sell.

For example, if you buy 10 shares of a stock at $100 and later buy another 10 shares at $80, your average cost is not $90 (a simple average) but $90 per share (the weighted average, which in this case happens to be the same because you bought equal numbers of shares). If you had bought 20 shares at $100 and 10 at $80, your average would be $93.33. The more shares you buy at a given price, the more that price influences your average.

Why Cost Basis Matters

Your cost basis determines your capital gain or loss when you sell shares. If you sell above your average cost, you have a gain; if you sell below, you have a loss. This impacts your tax liability โ€” long-term capital gains are typically taxed at lower rates than short-term gains. Keeping accurate records of your cost basis helps you:

๐Ÿ“‹ Track Performance

Know exactly whether your investment is performing well by comparing current price to your true average cost.

๐Ÿ’ก Tax Optimization

Use tax-loss harvesting strategies by selling positions that are below your cost basis to offset gains elsewhere.

๐Ÿ“Š Informed Decisions

Decide when to add to a position or trim it based on how far the current price is from your average cost.

๐Ÿงฎ Accurate Reporting

Brokerages report cost basis to the IRS. Our calculator helps you verify these numbers independently.

Profit/Loss (%) = (Current Value โˆ’ Total Cost) รท Total Cost ร— 100
Your percentage return on investment, calculated from your total cost basis and current market value.

Frequently Asked Questions

What is the difference between average cost and simple average price?
The average cost (also called weighted average) accounts for how many shares you bought at each price. The simple average just averages the prices regardless of share count. For example, buying 100 shares at $10 and 10 shares at $20 gives a simple average of $15 but a weighted average cost of $10.91. Since the 100 shares at $10 have more weight, your true average cost is much closer to $10.
Does a stock split affect my average cost basis?
No โ€” a stock split does not change your total investment value or your cost basis per share in terms of total dollars invested. If you owned 100 shares at $50 each (cost basis $5,000) and a 2-for-1 split occurs, you'll own 200 shares at an adjusted cost basis of $25 each. Your total investment remains $5,000. However, you should adjust your purchase records to reflect the split for accurate average cost calculations going forward.
Should I include trading commissions and fees in my cost basis?
Yes! Trading commissions, fees, and any other transaction costs are part of your total cost basis. If you buy $1,000 worth of shares and pay a $10 commission, your total cost is $1,010. This increases your average cost per share slightly. Including fees gives you a more accurate picture of your true profit or loss. Many brokerages now offer commission-free trading, but for those that still charge, always include these costs.
How do dividend reinvestments affect my average cost?
When you reinvest dividends, you're buying additional shares, which changes your average cost basis. Each reinvestment is essentially a new purchase at the market price on that date. These additional shares increase your total share count and change your average cost per share. For accurate tracking, you should record each dividend reinvestment as a separate purchase entry in this calculator.
What's the difference between average cost and FIFO for tax purposes?
Average cost calculates your cost basis as the weighted average of all shares owned. FIFO (First In, First Out) assumes the oldest shares are sold first when you make a sale, using their original purchase price as the cost basis. The IRS allows different methods (FIFO, LIFO, Specific Identification, Average Cost) depending on the type of account. For most taxable brokerage accounts, you can choose which method to use. Always consult a tax professional for advice on your specific situation.
Can I use this calculator for other assets like ETFs or mutual funds?
Absolutely! This calculator works for any type of investment where you buy shares or units at different prices over time, including ETFs, mutual funds, REITs, and even cryptocurrencies. The concept of average cost basis applies to any asset you accumulate through multiple purchases. Simply enter your purchase details as you would for stocks, and the calculator will give you your average cost per unit.

โš ๏ธ Important Disclaimer: This Stock Average Cost Basis Calculator is for informational and educational purposes only. It provides estimates based on the data you enter and does not account for all factors that may affect your actual cost basis, including stock splits, dividend reinvestments, corporate actions, trading fees, or tax implications. Results should be verified with your brokerage statements or financial advisor. This calculator does not provide financial, investment, or tax advice.