How to Calculate Your Portfolio’s Average Cost

Your average cost, also called your cost basis per share, is the total amount you invested divided by the total shares you own. When you buy the same holding at different prices, add up every dollar you spent, including trading fees, and divide by all the shares you hold. The result is your average cost per share.

Quick Summary

  • Average cost per share = total amount invested (with fees) divided by total shares owned.
  • Add together the cost of every purchase, not just the latest one, before you divide.
  • Include commissions and fees, because they are part of what you actually paid.
  • Buying more shares at a lower price, called averaging down, pulls your average cost down.
  • Your average cost sets the baseline for measuring gains and for figuring taxes when you sell.

What Is Average Cost, And Why Does It Matter?

Average cost is the single per-share price that represents everything you paid for a holding. Say you bought the same stock or fund three separate times at three different prices. Instead of tracking each lot in your head, you can collapse them into one number: your average cost per share. It answers a simple question. On average, what did each share I own actually cost me?

This number matters for two big reasons. First, it is the line you measure gains and losses against. Your position is only ahead when the current price sits above your average cost, so knowing that break-even point tells you where you truly stand. Second, your average cost is a form of cost basis, and cost basis is what the tax rules use to work out your taxable gain when you sell. Get the cost basis wrong and you can overstate or understate what you owe. Because tax situations differ, treat this article as educational and consult a tax professional about your own return.

The Average Cost Formula In Plain Terms

The math is deliberately simple. Here is the formula in plain ASCII:

Average cost per share = Total amount invested (including fees) / Total shares owned

To use it, follow three short steps. First, list every purchase of the holding and multiply the shares by the price you paid in each one. Second, add all of those purchase amounts together, then add any commissions or fees, to get your total amount invested. Third, add up every share you bought and divide the total invested by that total share count. The answer is your average cost per share, the same idea a brokerage statement labels as cost basis per share.

Notice that the price of your most recent buy does not decide your average on its own. Every dollar and every share across all your purchases pulls on the result together. That is why one small purchase at a very high or very low price barely moves a large position, while a big purchase can shift your average noticeably.

A Worked Example With Three Purchases

Numbers make this concrete. Imagine you built a position in one holding through three separate buys at different prices, paying a flat 5 dollar fee each time. The table below multiplies shares by price for each buy, adds the fee, and then totals everything so you can see the average fall out at the bottom.

Average Cost From Three Purchases At Different Prices
Purchase Shares Price Per Share Fee Total Cost
Buy 1 10 $50.00 $5 $505
Buy 2 20 $40.00 $5 $805
Buy 3 20 $30.00 $5 $605
Totals 50 $15 $1,915

Now apply the formula. Your total amount invested is 1,915 dollars, and your total shares owned is 50. Divide 1,915 by 50 and you get 38.30 dollars. That is your average cost per share. Even though you paid as much as 50 dollars and as little as 30 dollars along the way, the one number that captures your whole position is 38.30 dollars per share. If you had ignored the fees, you would have divided 1,900 by 50 for 38.00 dollars, which shows how a few dollars of commission nudge the figure up.

Three Buy Prices Blend Into One Average Cost Three bars show buy prices of fifty, forty, and thirty dollars, with a dashed line marking the blended average cost of about thirty-eight dollars per share. Three Buy Prices, One Average Cost $50 $30 $50 $40 $30 Buy 1 Buy 2 Buy 3 Avg $38.30
Every purchase pulls on the result, so the average cost lands between your highest and lowest buy prices.

You can run the same three-step math on any holding you own, then feed your average cost into a return calculation. Our ROI calculator lets you compare that cost basis against a current or sale price to see the percentage return on the position.

Why Fees Belong In Your Cost Basis

It is tempting to divide only the share price sums and skip the small stuff. Do not. Commissions, transaction fees, and similar buying costs are part of what you actually paid to own the shares, so they belong in your total amount invested. Tax guidance treats these acquisition costs as part of your basis, which is why leaving them out understates your true cost and can misstate a gain later.

In the example above, the three 5 dollar fees added 15 dollars to a 1,900 dollar base. On a small position that raised the average cost from 38.00 to 38.30 dollars. On larger or more frequent trades the effect grows, especially if you buy in many small lots. Keeping fees in the number now saves you from redoing the math when you sell.

What Averaging Down Does To Your Cost

Averaging down means buying more shares of something you already own after the price has fallen. Because your average cost is a blend of every purchase, adding shares at a lower price pulls the average down. In the worked example, the third buy at 30 dollars is exactly this move, and it dragged the average below the level set by the first two purchases.

Averaging down lowers your break-even point, but it is not automatically a smart move, since you are also putting more money into a position that has already dropped. Whether that fits your plan depends on your goals and risk tolerance, which is a decision for you, and possibly a licensed advisor, not a formula. If you are weighing a steady buying schedule against investing all at once, our sibling guide on dollar-cost averaging versus lump sum investing lays out how each approach behaves.

Buying More At A Lower Price Lowers Your Average Cost Two bars compare an average cost of forty-five dollars before a cheaper purchase and thirty-eight dollars thirty cents after buying more shares at a lower price, with a downward arrow between them. Averaging Down Lowers Your Cost $45 $38 $45.00 $38.30 Before extra buy After buying low lower
Adding shares at a lower price blends into your total and drags the average cost per share down.

How Average Cost Drives Gains And Taxes

Once you know your average cost, tracking performance gets easy. Subtract your average cost from the current price to see the gain or loss per share, then multiply by the shares you hold for the position total. With an average cost of 38.30 dollars, a current price of 45 dollars would show a gain of 6.70 dollars per share, or 335 dollars across 50 shares, before any fees to sell.

Taxes follow the same baseline. When you sell, your taxable capital gain is generally the sale proceeds minus your cost basis, so an accurate average cost keeps that figure honest. How long you held the shares affects the tax rate, and the exact treatment of basis can vary by account type and situation, which is why the tax rules are best confirmed with a qualified professional. If you want to see how a holding might grow before you ever sell, our compound interest calculator helps you project the growth of an investment over time. To turn your average cost and sale price into a clean percentage return, the sibling walkthrough on how to calculate ROI shows the full method.

Common Mistakes When Tracking Cost Basis

A few habits trip people up. The most common is dividing by the wrong share count, usually by forgetting an early purchase or a reinvested dividend that added shares. Every share you own has to be in the denominator. Another is ignoring fees, which quietly understates your true cost. A third is mixing holdings together; average cost is calculated per holding, so keep each ticker separate rather than blending unrelated positions into one number.

Reinvested dividends deserve special attention. Each reinvestment is really a small purchase of more shares, so it adds both dollars and shares to your totals and belongs in the average cost math. Leave those out and your basis will look lower than it should. Keeping a simple running log of shares, price, and fees for each buy makes the whole calculation painless, and it gives you clean records if you ever need them at tax time.

Want to turn your average cost into a return? Plug your cost basis and current price into the ROI calculator to see your gain as a clear percentage, and keep a running log of every buy so your average cost stays accurate. A few minutes of tidy record keeping now makes gains and taxes far simpler later.

FAQs About Average Cost Basis

How Do I Calculate My Average Cost Per Share?

Add up the total amount you invested across every purchase, including any commissions and fees, then divide by the total number of shares you own. The result is your average cost, or cost basis, per share.

Should I Include Fees In My Average Cost?

Yes. Commissions and transaction fees are part of what you paid to own the shares, so they belong in your total amount invested. Leaving them out understates your true cost basis.

What Does Averaging Down Mean?

Averaging down means buying more shares of a holding after its price has fallen. Because your average cost blends every purchase, buying more at a lower price pulls your average cost per share down.

Is Average Cost The Same As Cost Basis?

Average cost is one common way to express cost basis, stated as a per-share figure. Cost basis is the broader term for what you paid for an asset, which the tax rules use to work out your gain.

Do Reinvested Dividends Change My Average Cost?

Yes. Each reinvested dividend buys additional shares, adding both dollars and shares to your totals. Include those purchases in the math or your average cost will look lower than it really is.

Why Does My Average Cost Matter For Taxes?

When you sell, your taxable gain is generally the sale price minus your cost basis. An accurate average cost keeps that figure correct. Tax treatment varies, so consult a tax professional about your situation.

Does A Single New Purchase Reset My Average?

No. A new purchase blends into your existing shares rather than replacing them. Your average moves toward the new price by an amount that depends on how many shares you bought relative to what you already held.

Sources

Authoritative Sources Used in This Article

Last updated September 10, 2026. This article is educational and is not investment or tax advice; average cost methods, account types, and tax rules vary by situation, so confirm your own numbers and any tax questions with a qualified tax professional before acting. The content was reviewed for accuracy by Prof. Dr. Khalil Mudassar, PhD.


Author

shakeel-Muzaffar
Founder & Editor-in-Chief at  ~ Web ~  More Posts

Shakeel Muzaffar is the Founder and Editor-in-Chief of MultiCalculators.com, bringing over 15 years of experience in digital publishing, product strategy, and online tool development. He leads the platform's editorial vision, ensuring every calculator meets strict standards for accuracy, usability, and real-world value. Shakeel personally oversees content quality, formula verification workflows, and the platform's commitment to publishing tools that are genuinely useful for students, professionals, and everyday users worldwide.

Leave a Comment