ReckonBox logoReckonBox

Stock average calculator

Add every buy and sale of a stock for your average cost per share, matched FIFO as brokers and tax rules require, with charges and an average-down planner.

Inputs

Enter each trade in the order you made it: every buy of the same stock, and any sale. Sales are matched to your oldest shares first, as your broker and the tax return both do.

Trade
Shares
Price (₹)
Brokerage, STT and stamp duty across all buys. Raises your real cost per share.
The market price now, to see unrealised profit or loss.
Result
Average price per share
₹266.67
Total shares
300
Total invested
₹80,000

Weighted by shares, your average is ₹266.67. The plain mean of the buy prices is ₹262.50, which ignores that you bought more shares at one price than the other.

Key takeaways

  • Your average cost per share is the total you paid divided by the total shares, weighted by how many shares each buy covered.
  • Once you sell any shares, sales are matched to your oldest buys first, so the average on the shares you still hold changes.
  • In India, section 45(2A), now section 67(7)(c) of the 2025 Act, requires FIFO for demat shares, which is why Zerodha’s holdings average is FIFO.
  • In the US, IRS Publication 550 bars using the average price for a sale of stock; average basis is allowed only for mutual fund and DRIP shares.
  • Buy charges raise your real cost per share, and the average-down planner gives the exact shares to buy to reach a target average.

How the stock average calculator works

A stock average calculator finds your weighted average cost per share by dividing everything you paid by the total shares you hold. Buy the same stock more than once at different prices and you no longer have a single purchase price, you have a blended one, and that blended figure is what tells you whether you are up or down today. Enter each buy as a share count and a price, switch the region to rupees or dollars, and the average drops out instantly.

It also records sales, which none of the other calculators we checked can do. That matters more than it sounds, because once you've sold any shares, "your average" stops being one number, and the one your broker shows is worked out by a rule the law sets. More on that below.

What is the average share price formula?

The average share price is the total amount invested divided by the total number of shares: (shares1 x price1 + shares2 x price2 + and so on) / (shares1 + shares2 + and so on). It is a weighted average, which means each buy counts in proportion to how many shares it covers, so a big lot pulls the average toward its price and a small one barely moves it.

Most people trip on the same shortcut. Buy 100 shares at ₹250 and then 200 shares at ₹275, and it is tempting to average the two prices to ₹262.50. That misreads your position, because you own twice as many shares at the higher price. Weighting by quantity gives ₹80,000 paid across 300 shares, or ₹266.67 a share, ₹4.17 higher than the naive mid-price.

MethodWhat it doesResult on the buys above
Simple averageMean of the two prices, ignores size₹262.50
Weighted averageTotal paid over total shares₹266.67

The gap widens the more lopsided your lots are. Two shares at ₹100 and 998 at ₹500 sit almost entirely at ₹500, yet the simple average would tell you ₹300, a number you never paid and never will.

Sold some already? Then there are three averages

After a sale, your remaining shares are the ones bought most recently, because the law matches every sale to your oldest shares first. That rule is called FIFO, first in, first out, and it's why the average on your broker's app can differ from the one you'd work out by hand.

Zerodha publishes a case that shows it cleanly. Buy 50 shares of ITC at ₹260, then 30 at ₹256, sell 20 at ₹275, then buy 20 more at ₹270. Zerodha's holdings screen shows an average of ₹261. There are three ways to arrive at "an average" for that holding, and they don't agree:

MethodAverageWhat it assumes
FIFO₹261.00The sale took 20 of the ₹260 shares, leaving 30 @ ₹260, 30 @ ₹256 and 20 @ ₹270
Average cost₹261.38The sale left the average at ₹258.50, then the last buy lifted it
Every buy, ignoring the sale₹260.80The sale never happened

Only the first matches the broker, and only the first matches your tax return. The gap here is small. It isn't always: the realised gain on that sale is ₹300 under FIFO and ₹330 under the average-cost method, and on a large holding with old, cheap lots the difference in taxable gain can be substantial.

None of the other calculators we checked lets you record a sale; one takes a sell price, but only to value the holding. So anyone who has sold and enters their purchases gets the third figure, the one that matches nothing. Add your sale as a row in this tool, in the order it happened, and it matches the shares out FIFO and shows the average and the cost of the shares you still hold, the realised gain on what you sold, and the other two averages for comparison.

What does averaging down mean?

Averaging down means buying more shares after the price drops, which lowers your average cost per share. It is the move behind a lot of "should I add more?" questions, and the maths is the same weighted average run forward with one extra lot. Say you hold 300 shares at an average of 266.67 and the price has fallen to 200. Buy 100 more at 200 and your average slides to 250, because you have now paid 100,000 across 400 shares.

The average-down planner in this tool runs that logic in reverse, which none of the ten calculators we checked does. Instead of guessing a share count and checking the result, you set the average you want to reach and it returns the exact number of shares to buy at a given price. To reach an average, the price you buy at has to sit below that target, and the further below it sits, the fewer shares you need.

Target averageShares to buy at 200New total shares
26034334
250100400
240200500

Those rows start from the same 300 shares at 266.67. Reaching for a lower average costs disproportionately more shares, because each new share moves a bigger pile by less. If you've sold some shares, the planner works from what you still hold, at its FIFO cost, which is the average your broker is showing you.

Should you include brokerage and charges?

Your true cost per share includes what you paid to acquire the shares, not just the quoted price: brokerage, and in India the securities transaction tax and stamp duty on each buy. None of the ten calculators we checked folds these in. A few say so in their small print, and the rest simply report the bare average, which quietly understates what you actually need the price to recover to.

Enter the total buy charges and the tool shows both figures. On that ₹80,000 position, ₹300 of charges lifts the average from ₹266.67 to ₹267.67 across 300 shares, and that second number is your real break-even before you sell. It is small on a large trade and meaningful on a small one, which is exactly why a fixed 20 rupee brokerage hurts a ₹2,000 buy far more than a ₹2,00,000 one. If you've sold part of the holding, the charges are spread evenly across every share you bought and travel with the shares you still hold. To break the charges down line by line for an Indian trade, the brokerage calculator does the STT, stamp duty and exchange fees in full.

Is my average price the cost used for tax?

Only while you haven't sold anything. Once you sell, both India and the US work out the cost of the shares sold from your oldest purchases, not from the average.

In India, section 45(2A) of the Income-tax Act, 1961 says that for securities held through a depository, "the cost of acquisition and the period of holding of any securities shall be determined on the basis of the first-in-first-out method". The Income-tax Act, 2025 keeps the rule in section 67(7)(c) in almost the same words. The CBDT's Circular 768 of 24 June 1998 adds two practical points: FIFO runs separately for each demat account, so shares in a second account aren't treated as sold, and it doesn't reach shares held as physical certificates. Zerodha states the consequence plainly: the Income Tax Department "mandates using FIFO to report profit and loss (P&L) when filing income tax returns", which is why its holdings average is FIFO too.

In the US, IRS Publication 550 is just as direct: if you can't adequately identify the shares you sell, "the basis of the securities you sell is the basis of the securities you acquired first. 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." The average basis method is allowed only for identical shares held with a custodian that are mutual fund shares or are held in a dividend reinvestment plan. For ordinary stock you can choose a specific lot instead, but only by telling your broker which shares to sell at the time and getting written confirmation; otherwise it's FIFO.

The previous version of this page said the opposite, that the weighted average was the cost basis the IRS uses and India's cost of acquisition, and it cited Publication 550 for a rule Publication 550 rules out. We've corrected it. Two calculators ranking for this term make a version of the same mistake today: one says its weighted average "ensures accurate capital gains/loss reporting for simplified tax filing", and another lists finding an average "for tax" among its uses.

This tool gives you the cost of the shares you sold, matched FIFO, and the realised gain on that basis, but it doesn't apply a tax rate, a holding period or an exemption. The capital gains calculator does that for India, from the real buy and sell dates. Treat the figures here as inputs to that step, and check your contract notes and a qualified professional before you file.

What this calculator leaves out

It doesn't pull a live market price, so the current price is a value you type in, which keeps the result stable and private. It matches sales FIFO, the default in both countries, and shows the average-cost figure alongside, but it can't do US specific-lot identification, so if you told your broker to sell particular shares, the cost of those is yours to enter. It works on one demat or brokerage account at a time, which is how Indian FIFO runs anyway.

Corporate actions are still a manual step. A bonus issue adds shares at zero cost, which is why Zerodha's own help pages show an average falling sharply after one, and selling afterwards can leave an average of ₹0 once the bought shares have gone first. Splits change the share count without changing what you paid. Add bonus shares as a buy at a price of 0, and adjust share counts yourself after a split.

Frequently asked questions

What is a stock average calculator? A stock average calculator works out your weighted average cost per share when you have bought the same stock at more than one price. It divides the total amount you paid by the total shares you hold, so buying 100 shares at 250 and 200 shares at 275 gives an average of 266.67, not the plain mid-price of 262.50.

How is the average share price calculated? The average share price is the total amount invested divided by the total number of shares: (shares1 times price1 + shares2 times price2 and so on) divided by (shares1 + shares2 and so on). It is a weighted average, so a buy counts in proportion to how many shares it covers, which is why a larger lot pulls the average toward its price.

What is the difference between a weighted average and a simple average? A simple average adds the buy prices and divides by how many buys there were, ignoring size. A weighted average multiplies each price by its share count first. Buy 100 shares at 250 and 200 at 275 and the weighted average is 266.67, while the simple average of the two prices is 262.50, so the simple version understates your real cost here by 4.17 a share.

What happens to my average after I sell some shares? Your remaining shares are treated as the most recently bought ones, because sales are matched to your oldest shares first under FIFO. In Zerodha's published example, buying 50 at 260 and 30 at 256, selling 20, then buying 20 at 270 leaves an average of 261, while leaving the average unchanged through the sale gives 261.38 and averaging every buy gives 260.80. Only the FIFO figure matches the broker and the tax return.

What does averaging down mean? Averaging down means buying more shares after the price falls, which lowers your average cost per share. If you hold 300 shares at an average of 266.67 and buy 100 more at 200, your average drops to 250. The average-down planner in this tool reverses that: you set a target average and it returns the exact number of shares to buy at a given price.

Should I include brokerage and charges in my average? Your true cost per share includes what you paid to buy: brokerage, and in India the securities transaction tax and stamp duty. Enter the total buy charges and the tool shows both the bare average and the average with charges. On an 80,000 rupee position, 300 rupees of charges lifts the average from 266.67 to 267.67 across 300 shares.

Is my average price used for capital gains tax? Only until you sell. In India, section 45(2A) of the Income-tax Act, 1961, now section 67(7)(c) of the 2025 Act, requires the cost of demat shares sold to be worked out first-in-first-out, account by account. In the US, IRS Publication 550 says you cannot use the average price per share for a sale of stock, except for certain mutual fund shares, so the default is FIFO unless you identify the specific lot with your broker. This tool shows the FIFO cost of the shares you sold and the realised gain, but does not calculate the tax.

Does the average change when the market price moves? No. Your average cost is fixed by what you actually paid, so it only changes when you buy or sell shares. The current market price you enter drives the unrealised profit or loss and the return percentage, but it never alters the average cost per share.

Can I use this for mutual fund units or crypto? Yes. The weighted average works for any asset bought in parts at different prices, so units of a mutual fund or a quantity of a coin follow the same total-paid divided by total-quantity rule. US mutual fund shares are also the one case where the IRS lets you use the average-cost figure for tax, which the tool shows beside the FIFO one once you add a sale.

Sources

Related calculators

  • 2026 Brokerage Calculator: Trading Charges Set your own brokerage plan and get every charge itemised at 2026 rates, with the April STT rise, BSE F&O rates, the breakeven and the cost per turnover.
  • 12.5% LTCG Calculator: Capital Gains Tax 2026 Enter the dates you bought and sold for the holding class, the rate regime, the section 112A grandfathered cost, the 15%-capped surcharge and the tax.
  • SIP Calculator Project what a monthly SIP grows to, or work backwards from a target, with step-up, inflation-adjusted value, a lumpsum and a year-by-year breakdown.
  • 2026 Down Payment Calculator: LTV Caps and EMI Your down payment, the loan it leaves and the monthly payment, for India or the US, with the RBI loan-to-value ceiling that sets the real minimum.
  • 5x Margin Calculator: Intraday, MTF and F&O Work out the cash a trade blocks under current rules: 5x at most intraday, MTF at VaR plus ELM, and F&O at the full SPAN margin, intraday or not.
  • Present Value Calculator Discount a future sum and a stream of payments back to what they are worth today, with every formula printed including the annuity due variant.

Embed this calculator

Free to use on your own site. Paste this where you want the calculator to appear. More calculator widgets.

<iframe src="https://reckonbox.com/embed/finance/stock-average/" title="2026 Stock Average Calculator with FIFO Sales by ReckonBox" width="100%" height="520" style="border:0;max-width:100%" loading="lazy"></iframe>

Built and reviewed by DexTechLabs against the primary sources cited above. Last reviewed 2026-11-13. How we build and verify tools.

This is an estimate for general information, not financial or tax advice. Rules and rates change, so check the current figures for your situation before you rely on it.