This share average calculator works one way, whichever name you came in with: add every purchase, and you get your average share price, total shares and total cost — plus profit or loss when you enter a current price. What it gives back is the figure an average share price calculator is asked for, one weighted price for the whole position rather than a plain average of the prices you paid. It is also an average cost of shares calculator in the plain sense — everything you paid, divided by the shares you hold — and that figure is your cost basis per share; the cost basis calculator is where those same buys are costed purchase by purchase.
Each purchase is weighted by how many shares you bought. That is the whole idea — a weighted average, not a plain average of the prices.
Average price = (q1×p1 + q2×p2 + … + qn×pn) ÷ (q1 + q2 + … + qn)
where q is the number of shares bought and p is the price paid per share. The top of that fraction is your total cost; the bottom is your total shares.
Worked example: 100 shares at $50, then 50 shares at $60. Total cost = 100×50 + 50×60 = 8,000. Total shares = 150. Average = 8,000 ÷ 150 = 53.3333. That is the same figure this page returns when you type those two rows in.
Rounding: every figure on this page is rounded down, never up. Prices are shown to four decimals and amounts to two, so the number you read is never larger than the real one.
This is a share average calculator for one position at a time. It uses only the share counts and prices per share you type in. Some call it a stock calculator average and others an average calculator stock — the wording moves around, the arithmetic does not.
If you want your commission included, add it into the price per share for that purchase before typing it in — that is the usual way to fold fees into an average cost per share figure. Amounts are shown in whatever currency you typed; no exchange rate is applied anywhere.
Dividends are not part of an average cost, so this page leaves them out — a dividend is cash the shares paid you, not money you put in. For that side of the same holding, the dividend calculator works out what the shares pay you now, per payment and per year.
When you sell part of a holding, the tax rules want to know which shares you sold — and the three usual answers can produce three different gains on the same account. Here is what each one means, when it is available, and what this page does.
What it is: the shares you bought earliest are treated as the ones you sold, whichever ones you actually had in mind. When it applies: it is the fallback when a sale is not adequately identified — "If you buy and sell securities at various times in varying quantities and you cannot adequately identify the shares you sell, the basis of the securities you sell is the basis of the securities you acquired first". On this page: not used. This page does not pick a first lot; it averages every purchase you enter.
Source: IRS Publication 550, Investment Income and Expenses (2025), chapter 4 — Stocks and Bonds, "Identification not possible". IRS page last reviewed 30 Apr 2026; checked 16 Sep 2026.
What it is: every share in the position carries the same cost — the total cost divided by the number of shares. When it applies: the IRS allows an average basis for identical shares bought at different times and prices and left with a custodian or agent, and only where they are mutual fund shares (or another regulated investment company) or shares held in a dividend reinvestment plan: "Average basis is determined by averaging the basis of all shares of identical stock in an account regardless of how long you have held the stock". On this page: this is the method we use. Enter your purchases and the page returns the weighted average per share, total shares and total cost.
Source: IRS Publication 550, Investment Income and Expenses (2025), chapter 4 — Special Rules for Mutual Funds, "Average Basis". IRS page last reviewed 30 Apr 2026; checked 16 Sep 2026.
What it is: you name the exact shares being sold, so their own purchase price becomes the basis of that sale. When it applies: only if you identify the shares to your broker at or before the sale and have it confirmed — "Specify to your broker or other agent the particular shares to be sold or transferred at the time of the sale or transfer, and Receive confirmation in writing from your broker or other agent within a reasonable time". On this page: not used. There is no lot to point at here — the page blends every purchase into one average.
Source: IRS Publication 550, Investment Income and Expenses (2025), chapter 4 — Stocks and Bonds, "Adequate identification", and Special Rules for Mutual Funds, "Specific share identification". IRS page last reviewed 30 Apr 2026; checked 16 Sep 2026.
Where this page's number sits. What this page returns is an average cost — one weighted average for the whole position. That is the right figure for reading your own position, and it is what people mean by cost basis per share. It is not automatically the figure that goes on a tax return: for ordinary shares the IRS does not accept an average price per share for gain or loss — "Except for certain mutual fund shares, discussed later, you cannot use the average price per share to figure gain or loss on the sale of the shares" — and the average basis method itself is limited to mutual fund shares and shares held in a dividend reinvestment plan. If you are working out a taxable gain, use the method your broker has on file for the account and check it with a tax professional. This page does not adjust for commissions, stock splits, dividends or return of capital, and nothing here is tax advice.
Sources: IRS Publication 550, Investment Income and Expenses (2025), chapter 4 (adjusted basis; identification of stock sold; average basis) — IRS page last reviewed 30 Apr 2026. IRS Publication 551, Basis of Assets, Table 1 (Examples of Increases and Decreases to Basis) — IRS page last reviewed 30 Apr 2026. Both checked 16 Sep 2026.
As many as you need. Start with two rows, then use + Add purchase for each extra buy and the × on a row to remove it. There is no cap.
Yes — those are three names for the same weighted average. This page is one tool, not three: the same inputs, the same formula, one answer.
Both. The average is the headline figure, and the same run also gives you the total shares, the total cost, and, once you type a current price, the market value, the profit or loss and the return. It works on one position at a time and looks nothing up.
This one does, and that is where its figure comes from. Type each buy in, shares and price, and the page pools them into one cost basis per share. Nothing is imported from a broker and no average has to be copied from anywhere first, so every buy behind the figure is a row you entered yourself.
For a position you have only bought into, yes — your average cost per share is your cost basis per share. Cost basis is what the shares cost you: as Publication 550 puts it, "The basis of stocks or bonds you own is generally the purchase price plus the costs of purchase, such as commissions and recording or transfer fees." Average cost is that total divided by the number of shares, which is exactly what this page returns. The two words drift apart on the tax side, where "cost basis" also covers the other ways a sale can be matched to shares — first in, first out, specific share identification and the average basis method. The section above, Cost basis methods, walks through all three; they can give different gains on the same account.
It is your cost basis after the increases and decreases the tax rules require. Publication 550: "Before you can figure any gain or loss on a sale, exchange, or other disposition of property or figure allowable depreciation, depletion, or amortization, you must usually make certain adjustments (increases and decreases) to the basis of the property. The result of these adjustments to the basis is the adjusted basis." For stock, the usual downward adjustments are nontaxable stock dividends, stock splits and nondividend distributions — a return of capital that reduces your basis, up to the amount of that basis. Publication 551 lists the common increases and decreases side by side in its Table 1. This page adjusts nothing: it averages the share counts and prices you type in, and nothing else.
The rules do not assign you a method — they set a fallback for a sale that is not identified. Publication 550: "If you buy and sell securities at various times in varying quantities and you cannot adequately identify the shares you sell, the basis of the securities you sell is the basis of the securities you acquired first." In plain terms, the oldest shares are treated as the ones sold, which is what people call FIFO. Specific identification is only available if you specify the particular shares to your broker at the time of the sale or transfer and receive confirmation in writing within a reasonable time, and the average basis method is only available for mutual fund shares and shares held in a dividend reinvestment plan. So what you actually get by default is whatever your broker has set for the account — check that setting before you sell, and ask your broker if it is not obvious.
Sources for the three questions above: IRS Publication 550, Investment Income and Expenses (2025), chapter 4 — Basis of Investment Property, Stocks and Bonds, and Special Rules for Mutual Funds; IRS Publication 551, Basis of Assets, Table 1. IRS pages last reviewed 30 Apr 2026; checked 16 Sep 2026.
Because you bought different quantities. Buying 100 shares at $50 and 50 at $60 gives 53.3333, not 55 — the bigger, cheaper purchase pulls the average toward it.
This page counts only what you type. Brokers often fold commissions into the figure, and they may treat sales, dividends or corporate actions their own way. If your broker's number includes something this page excludes, its number will differ — that is a difference in what is included, not an error in the arithmetic here.
Not directly. This page works out the average of the buys you enter; it does not model selling some of a holding, stock splits, or more than one ticker. Enter only the purchases that make up the position you want averaged.
Yes. The fields stack to a single column on a narrow screen and the results stay inside the width of the page.
No. Everything runs in your browser on this page; your numbers are not sent anywhere and are not saved.
This page is a calculator, not investment advice. Averaging down does not make a position safer. Contact: contact@stockavg.com