Calculators.Life Calculator
Investing

Cost Basis Calculator

Input Parameters

Scenarios
Number of shares purchased in lot 1
$
Purchase price per share for lot 1
Number of shares purchased in lot 2
$
Purchase price per share for lot 2
Number of shares purchased in lot 3
$
Purchase price per share for lot 3
Number of shares purchased in lot 4
$
Purchase price per share for lot 4
Number of shares purchased in lot 5
$
Purchase price per share for lot 5

Computed Results

Average Cost per Share
$53.33
Total Shares150
Total Cost Basis$8,000.00

The cost basis calculator helps investors determine the average price paid per share across multiple purchases. By entering the number of shares and the price per share for up to five separate transactions, you can quickly calculate your total accumulated shares, total investment cost, and average cost per share.

This calculator is for informational purposes only and does not constitute financial, investment, or tax advice.

Practical Use Cases

Investors often buy shares of the same asset at different times and at different prices, a strategy sometimes referred to as dollar-cost averaging. Tracking the overall cost basis is necessary for understanding the total amount invested and the average price paid per share. This calculator allows you to input up to five distinct purchase lots to find the weighted average cost of your position. This mathematical baseline is useful for evaluating current portfolio values against the original purchase costs.

Formula & Explanation

The calculator determines the average cost per share by dividing the total cost of all purchases by the total number of shares acquired. The formulas used are:

Total Cost = (Shares₁ × Price₁) + (Shares₂ × Price₂) + ... + (Shares₅ × Price₅)
Total Shares = Shares₁ + Shares₂ + ... + Shares₅
Average Cost per Share = Total Cost ÷ Total Shares

The total cost represents your total cost basis for the entered lots. The average cost per share is weighted by the number of shares bought at each price point, ensuring larger purchases have a proportionally greater impact on the final average.

Verified Scenario Walkthroughs

Here are examples of how the calculator processes different purchasing scenarios based on its formula:

Three Tiered Accumulation Lots

If you make three separate purchases of an asset as the price changes:

The calculator determines the total shares are 450 and the total cost is $11,500. Dividing the total cost by the total shares results in an average cost per share of $25.56.

Maximum Capacity Usage

If you utilize all five input lots with equal share amounts but increasing prices:

The total number of shares is 5,000, and the total cost basis is $150,000. The resulting average cost per share is exactly $30.00.

How to Use the Calculator

Follow these steps to calculate your average share price and total cost basis:

  1. Enter the number of shares acquired in your first transaction into the Purchase 1 - Shares field.
  2. Enter the price paid per share for that transaction into the Purchase 1 - Price per Share field.
  3. Repeat this process for up to four additional purchase lots using the subsequent fields. Leave unused fields at zero.
  4. Review the calculated results, which will display your average cost per share, total accumulated shares, and total cost basis.

Inputs & Outputs Table

Field NameTypeDescription
Purchase 1-5 - SharesInputNumber of shares purchased in the respective lot.
Purchase 1-5 - Price per ShareInputPurchase price per share for the respective lot.
Average Cost per ShareOutputThe weighted average price paid for all entered shares.
Total SharesOutputThe sum of all shares entered across the five lots.
Total Cost BasisOutputThe total monetary amount spent on all entered shares.

Frequently Asked Questions

What is a cost basis?

Cost basis is the original value or purchase price of an asset. In the context of this calculator, it represents the total amount of money spent to acquire the entered shares.

How does the calculator handle empty fields?

Any purchase lot fields left blank or set to zero are ignored in the calculation. The calculator only sums the shares and costs for the lots where both a share count and a price are provided.

Author portrait
About the Author
Arnab Biswas

Calculator developer and SEO strategist who builds practical online calculators and tests calculation logic, input handling, and expected results using real-world scenarios.