Average Purchase Price Calculator - Weighted Cost Basis

    Enter up to five buy transactions and get the volume-weighted average cost per share. Add your broker commission to see the adjusted cost basis, then compare against the current price for unrealized gain or loss.

    Parameters

    Enter data for calculations

    Each tranche is a separate buy - e.g. 50 shares at $42 and 30 shares at $38 is 2 tranches.

    Form progress0 / 1 fields

    💡 Fill in all required fields to unlock the calculate button

    Five purchases, five prices, one weighted average that tells the truth

    Most investors build positions over multiple transactions. Each at a different price, each for a different number of shares. The arithmetic mean of those prices is wrong - it ignores volume. This calculator computes the volume-weighted average: total dollars spent divided by total shares owned. That is your real cost basis. Optionally, add broker commission and current market price to see adjusted basis and unrealized profit or loss.

    How to use - step by step

    1. Price per share + Number of shares - enter up to five buy transactions. Only Transaction 1 is required; leave unused rows empty.
    2. Broker commission (%) - optional. If entered, the calculator adds the fee to each transaction and shows the adjusted cost basis.
    3. Current share price ($) - optional. Enter the current market price to compare against your average cost and see unrealized gain or loss per share, total and as a percentage.
    4. Read the results - weighted average price, total shares, total value, transaction breakdown with percentage weights, and optional position comparison.
    Weighted vs arithmetic average - why it matters
    You buy 100 shares at $40 and 10 shares at $60. Arithmetic mean: ($40+$60)/2 = $50.00. Weighted average: (100x$40 + 10x$60) / 110 = $41.82. The $8.18 gap shifts your break-even point by 16%. Using the wrong average can make you think you are losing money when you are actually profitable.

    Averaging strategies compared

    Averaging down

    Buy more as the price falls to lower your average cost. Risk: catching a falling knife if fundamentals have deteriorated. Best used when you believe the drop is temporary and the company is sound.

    Averaging up

    Buy more as the price rises to confirm trend strength. Risk: reducing your safety margin. Best used when momentum and fundamentals both support continued growth.

    DCA (regular schedule)

    Fixed dollar amount at fixed intervals, regardless of price. Risk: lowest - removes emotion entirely. Best for long-term index fund and ETF accumulation.

    Lump sum (single buy)

    All capital deployed at once. Risk: bad timing. Statistically wins 67% of the time (Vanguard 2012), but the 33% where it loses can be psychologically devastating.

    Practical examples

    Scenario Transactions Arithmetic avg Weighted avg Difference
    Two equal-size buys 50 @ $40 + 50 @ $60 $50.00 $50.00 $0.00
    Heavy first buy 100 @ $40 + 10 @ $60 $50.00 $41.82 $8.18
    Averaging down 3x 50@$45 + 40@$38 + 60@$35 $39.33 $38.87 $0.46
    ETF DCA 5 months 5 buys, varying prices $40.70 $39.66 $1.04

    When buy sizes are equal, both averages match. When sizes differ, the weighted average drops toward the price of the larger purchase.

    FAQ - Frequently asked questions

    Why is the weighted average different from the simple average?
    Because position sizes differ. The weighted average formula is total value / total shares. If you bought mostly at a low price, the weighted average will be closer to that low price. The arithmetic mean treats all prices equally regardless of how many shares you bought at each price.
    I have more than five transactions. How do I calculate?
    Group your transactions into five or fewer batches. For example, if you made 12 monthly purchases, sum them into quarterly groups (3 months each = 4 groups). Use the total value and total shares of each group as one row. The weighted average will be identical.
    How does commission affect my average price?
    Commission increases the effective cost of each purchase. If you bought $1,000 worth of stock and paid $5 in commission, your effective spend was $1,005 for the same number of shares. The adjusted weighted average reflects this higher true cost. On small trades with minimum commission floors, the impact can be significant.
    Is averaging down always a good strategy?
    No. Averaging down only works if the stock eventually recovers above your new average. If the price keeps falling (due to deteriorating fundamentals, not temporary market sentiment), you are adding to a losing position. A falling stock that goes from $50 to $25 can still go to $5. Check the fundamentals before buying more.
    Can I use this for ETFs and mutual funds?
    Yes. The weighted average calculation works identically for individual stocks, ETF shares, mutual fund units and crypto tokens. Enter the price per unit and the number of units for each purchase.
    How does this connect to the Stock Profit Calculator?
    Use this calculator first to find your weighted average purchase price. Then enter that average as the "buy price" in the Stock Profit Calculator along with your total shares and sell price. This gives you the net profit from the entire multi-tranche position after commissions.

    Related tools

    DCA Calculator

    Compare dollar cost averaging vs lump sum investing across four market scenarios - See calculator

    Stock Profit Calculator

    Calculate net profit or loss from a stock trade after broker commissions - See calculator

    ETF Return Calculator

    Project long-term ETF portfolio value with compound growth and monthly contributions - See calculator

    Dividend Calculator

    Calculate annual dividend income, yield and growth from share price and payout data - See calculator

    Compound Interest Calculator

    See how savings grow with monthly contributions and compound interest over time - See calculator

    Similar calculators from this section