Updated September 2026
Every number this calculator shows comes from one formula, applied consistently whether you're entering two lots in the quick view or ten rows in the multi-lot table. This page walks through exactly what happens to your numbers, in the same order the calculator runs it, so the result isn't a black box.
Your new average cost per share, coin, or contract is:
new average = Σ(shares × price) / Σ(shares)
In plain terms: multiply each lot's quantity by the price you paid for that lot, add those dollar amounts across every lot you own (your original position plus every additional buy), then divide by the total quantity. This is a quantity-weighted average, not a simple average of prices — that distinction matters enough that it gets its own page: see cost basis explained for a worked comparison of the two.
Load the calculator fresh and the quick view starts with 100 shares bought at $50, then 100 more bought at $30. Here's the arithmetic behind the answer it shows:
That $40.00 is also your break-even price by default — the price the position needs to reach for you to get back to exactly what you paid, before fees. Notice it isn't the midpoint between $50 and $30 (which would be $40 too, coincidentally, only because both lots were the same size) — with lots of different sizes, the weighted average pulls toward whichever lot had more quantity, not whichever had the more extreme price.
The "target gain" field defaults to 0%, which is exactly break-even: the average cost itself. Change it and the calculator applies:
target price = new average × (1 + target gain% ÷ 100)
So for the $40.00 average above, a target gain of 15% gives a target price of $40.00 × 1.15 = $46.00 — the price you'd need to reach to be up 15% on your blended cost, not on any single lot.
The "current market price" field is optional. When filled in, the calculator computes what your total position is worth right now against what you actually paid:
unrealized gain/loss = (total shares × current price) − total cost
shown both in dollars and as a percentage of total cost. For the example above, a current price of $35 gives a position value of 200 × $35 = $7,000 against a $8,000 cost basis — an unrealized loss of $1,000, or −12.5%.
The quick view is built for the single most common case: an existing position plus one new buy. The multi-lot table exists for everything beyond that — three, five, or more separate purchases at different prices and times. Both feed the identical weighted-average formula above; the multi-lot table just lets more than two rows contribute to the Σ(shares × price) and Σ(shares) sums, updating live as you edit any row.
Choosing Stock/ETF, Crypto, or Options only changes the labels on screen — "shares" becomes "coins/units" or "contracts." The underlying arithmetic never changes, because a weighted average doesn't care what the units represent. That said, what averaging down means for your risk genuinely differs by asset type — see the dedicated pages on stocks, crypto, and options for that distinction, since the math being identical doesn't mean the decision is.
Does the order I enter lots in matter? No — addition is commutative, so Σ(shares × price) comes out identical regardless of which lot you type first.
What if I sold some shares in between buys? This calculator only handles buys (accumulating a position). Partial sales change your remaining cost basis depending on which tax lot-selection method applies, which is outside what a simple weighted-average tool can compute — check your brokerage statement for that.
Is this the same formula my broker uses for "average cost basis" on my statement? Often yes for the average cost method specifically, but brokers may default to a different method (like FIFO) for tax reporting unless you've elected average cost. Always confirm against your actual statement before filing taxes.