Investing

Stock Average Calculator

Combine buy lots with costs, or solve the hypothetical next price needed for a target average.

By Nitin Raturi · Last reviewed

Your buy lots

How to use the Stock Average Calculator

Match each buy quantity with its price and optional costs.

  1. Enter the share quantities and matching buy prices in the same order.
  2. Leave lot costs blank or enter one total cost for every lot.
  3. Read both the price-only and cost-inclusive averages and check the lot ledger.
  4. To test a target, choose Target price and enter an exact target, extra shares and extra costs.
  5. Read the hypothetical price and feasibility message; keep or share the address only if you intend to reveal the entered holdings.

Good to know

  • Lists stay in your browser and URL fragment, not analytics or a server query.
  • This is not a sell ledger, tax cost basis or investment recommendation.

Enter matching lists for the same security. Commas separate entries, not thousands: write 1000, not 1,000.

Question

Question

Either find the average of existing buy lots or solve a hypothetical next price for an exact target average.

How to fill it in

  • Average summarises the lots you enter.
  • Target price also asks for the target average, extra quantity and extra costs.

Example

The default average is ₹86.67; the default target scenario needs a hypothetical price of ₹60.00.

Keep in mind: Target mode is an equation, not an instruction to place a trade or average down.

Share quantities

How many shares were purchased in each buy lot.

How to fill it in

  • Enter 1 to 100 lots, separated by commas, semicolons, spaces or new lines.
  • Each lot must have 1 to 1,00,00,000 whole shares. No fractional shares here.
  • Grouping commas are not accepted: write 1000, not 1,000.

Example

The default list totals 30 shares.

1 to 100 buy lots. Whole shares only. Separate quantities by comma, space or new line.

Buy prices

The price per share for each matching quantity, before separately entered costs.

How to fill it in

  • Enter one price per quantity, in the same order, using the same separators.
  • Each price is ₹0.01 to ₹1 crore; use a dot for decimals and no currency symbol in the list.

Example

The default trade values add up to ₹2,600.00.

Keep in mind: All lots should refer to the same security and currency on a consistent share basis. Splits and corporate actions are not adjusted automatically.

One rupee price per lot, in the same order. No currency symbols or grouping commas.

Lot costs (optional)

Total additional acquisition costs for each lot, not a per-share fee or percentage.

How to fill it in

  • Leave blank for zero costs, or enter one cost per lot.
  • Each cost is ₹0 to ₹100 crore. Use amounts you have checked; no brokerage or tax rates are supplied.

Example

The cost example adds ₹30.00, bringing the inclusive average to ₹87.67.

Blank means zero costs. Otherwise one total rupee cost per lot, not a percentage or per-share fee.

Average acquisition cost per share

₹86.67

30 shares with total acquisition outlay ₹2,600.00 have a cost-inclusive average of ₹86.67.

Current shares
30
Total trade value
₹2,600.00
Total acquisition costs
₹0.00
Total acquisition outlay
₹2,600.00
Price-only average
₹86.67
Cost-inclusive average
₹86.67
Buy-lot ledger
Entered buy lots and acquisition outlay
LotSharesPriceTrade valueCostsOutlay
110₹100.00₹1,000.00₹0.00₹1,000.00
220₹80.00₹1,600.00₹0.00₹1,600.00

Holdings stay in your browser and URL fragment. Anyone receiving the full address can read them. No list or price is sent to analytics.

Arithmetic only, not investment advice or a recommendation to average down. Uses whole-share buy lots in one security/currency. No sells, splits, tax cost-basis rules, dividends or live market quotes. Rounded only for display.

How this calculator works

  1. Step 1Add the shares30A larger buy lot counts more than a smaller one.
  2. Step 2Add acquisition outlay₹2,600.00Quantity times price, plus separately entered costs.
  3. Step 3Divide outlay by shares₹86.67This is cost per share across the entered buys.

Each share has equal weight; each buy price does not. Buying different quantities at different prices means the combined average is total acquisition outlay divided by total shares, not a plain average of the quoted prices.

Enter matching lists for share quantities and prices. Optional lot costs are total rupee charges for each buy, not per-share fees or percentages. Blank costs mean the calculation deliberately ignores them.

Worked example: buys of different sizes

Follow the quantities and rupee amounts
Each trade
trade value = shares × buy price
Combined outlay
C = sum(trade values) + sum(lot costs)
Cost-inclusive average
average = C ÷ total shares
  1. Lot 110 shares at ₹100.00₹1,000.00
  2. Lot 220 shares at ₹80.00₹1,600.00
  3. Total shares30
  4. Total trade value₹2,600.00
  5. Total entered acquisition costs₹0.00
  6. Outlay divided by shares₹86.67

The cheaper lot contains more shares, so it pulls the combined average towards its price. Rearranging the list does not change the result, provided each quantity keeps its matching price and cost.

The ledger shows every lot’s share count, trade value, costs and outlay. Use it to catch a shifted row or duplicated cost before interpreting the headline average.

Price-only and cost-inclusive averages

  • Price-only average₹86.67Weights prices by the purchased share quantities.
  • Average with the cost example₹87.67Includes total additional costs of ₹30.00.
  • Total outlay with those costs₹2,630.00The amount reconciled across both entered lots.

Acquisition costs increase outlay without adding shares. That makes the cost-inclusive average higher than the price-only average when costs are positive. The calculator shows both so the basis is never hidden.

This is not a statutory tax cost basis or a broker statement. It does not decide which charges are deductible, apply FIFO to sold shares, or adjust for corporate actions. Use appropriately adjusted inputs and authoritative records for those purposes.

Solve a hypothetical next price

Target mode fixes the extra quantity and solves the next price needed for an exact cost-inclusive average.

The target question does not look up a quote or decide whether a further purchase is sensible. It asks which hypothetical price would make the combined outlay, including all entered costs, equal the chosen target multiplied by the combined share count.

Default target scenario
Solve the weighted-average equation
next price = [target × (current shares + extra shares) − current outlay − extra costs] ÷ extra shares
  1. Current acquisition outlay₹2,600.00
  2. Target cost-inclusive average₹80.00
  3. Additional shares10
  4. Combined shares after the hypothetical buy40
  5. Required combined outlay₹3,200.00
  6. Hypothetical next price per share₹60.00

Additional costs reduce the share price that would achieve the same target. They are included inside the equation, not added afterwards. The solved price is displayed to six decimals because a two-decimal quote may not reproduce the target exactly.

An actual exchange can impose a different tick size or trading restriction. This tool neither rounds to an exchange tick nor claims the hypothetical price is available.

When a target is not feasible

Even a zero-price extra lot may not lower the average far enough for the entered quantity.

If the target requires a negative next price, the calculator reports that the scenario is infeasible. It does not silently increase the extra quantity, remove costs or show a zero quote as though the target had been met.

An exactly zero solved price is a mathematical boundary and is labelled as such. It is not a real free-share offer. Higher target averages can also produce a solved price above current lot prices; that is still arithmetic, not a trading suggestion.

Input limits and privacy

Match all lot lists in order and avoid thousands-grouping commas inside individual entries.

Use commas, semicolons, spaces or new lines as separators. For one thousand, write 1000 rather than 1,000. Prices and costs use decimal points. Empty comma-separated cells are invalid rather than silently discarded.

You can enter up to one hundred buy lots. Quantities are positive whole shares; fractional shares are not supported. Use one security, one currency and a consistent adjusted share basis. Do not mix pre-split and post-split quantities without adjusting them yourself.

Holdings and target inputs stay in the browser. The URL fragment keeps the lists out of ordinary server requests and analytics. Anyone who receives the full address can still read the entries, so share it only intentionally.

Common stock-average mistakes

  • Mistake: Take a simple average of buy prices when quantities differ.

    Instead: Weight each price by its share quantity, or divide total trade value by total shares.

  • Mistake: Enter a total lot fee as a per-share amount.

    Instead: Enter each lot’s full acquisition costs once in the costs list.

  • Mistake: Treat a lower acquisition average as proof that a loss disappeared.

    Instead: It changes the cost per share and exposure, not the market value of existing holdings.

  • Mistake: Use the target price as a recommendation or live quote.

    Instead: Read it only as a solved hypothetical equation, including its costs and quantity assumptions.

Sources and independent checks

Frequency-expanded shares check the weighted average; appending the solved lot checks the inverse.

The weighted-average equation follows OpenStax’s frequency treatment of the mean. Target mode rearranges that equation. Golden tests compare lot ledgers with individual-share expansion, then append hypothetical lots to reconstruct the target. Sources and review details are listed below.

An average price includes costs. Charges, returns and timing each have a tool.

To see every charge on an equity trade, including STT and stamp duty, use the brokerage calculator. For the return on a holding with dated buys and sells, try the XIRR calculator.

Read how we test our calculators, or browse more money calculators.

Frequently asked questions

How is the stock average calculated?

Each lot value is its share quantity multiplied by its buy price. The price-only average divides total trade value by total shares. The cost-inclusive average adds entered acquisition costs before dividing.

Why not take the simple average of buy prices?

Different lot quantities give the prices different weights. A simple average works only when every lot contains the same number of shares and costs are excluded.

Are costs per share or per lot?

Each cost entry is the total rupee acquisition cost for the matching lot. It is not a per-share fee or percentage. Leaving the costs list blank means zero costs for every lot.

How does target-price mode work?

It fixes your target cost-inclusive average, additional whole-share quantity and additional costs, then solves the next buy price algebraically. It does not fetch a quote, predict a market price or recommend buying.

Why can a target be infeasible?

The current outlay and extra costs can be too high for the chosen combined quantity and target, even with a zero-price extra lot. A required negative price is reported as infeasible. An exact zero is labelled only as a mathematical boundary.

Can I paste thousands-grouped amounts or fractional shares?

Use plain ungrouped amounts such as 1000, because commas separate entries. Semicolons, spaces and new lines also separate entries. Quantities must be whole shares; fractional shares are not supported.

Does this calculate capital gains or adjust for splits?

No. It covers buy lots only. It does not apply FIFO, tax rules, sales, dividends, stock splits or other corporate actions. Use one security, one currency and consistently adjusted quantities and prices.

Are my holdings private when I share the URL?

Inputs are stored in the URL fragment and processed in your browser, not sent to calculator servers or analytics. Anyone who receives the full URL can read those entries. Share the complete address only intentionally.

Sources and methodology

The formulas are standard time-value-of-money results. We check every figure against golden values worked out independently, by closed form and by month-by-month simulation; see the methodology.

Written and maintained by Nitin Raturi, a software engineer (about the author). Last reviewed 27 Oct 2026; next review due by . Found an error? Tell us.

Changelog

  • : Initial release: weighted buy-lot averages, acquisition costs, fragment state and an exact hypothetical target-price solver.