Stock Calculator

Estimate stock trade profit or loss after commissions.

About the Stock Calculator

Work out what a share position actually made or lost once you account for what you paid, not just the headline price move.

How to use it

  1. Enter the number of shares and your purchase price.
  2. Enter the current or sale price.
  3. The result shows gain or loss in dollars and percent.

The formula

A stock position has two sources of return and one number that combines them honestly. Most people track only the first.

Gain = (Sale price − Purchase price) × Shares − Fees
Return % = Gain ÷ (Purchase price × Shares) × 100
Annualised = [(1 + Return)1/years − 1] × 100

The annualised line is the one that makes comparisons fair. A 40% gain is excellent in one year and mediocre across ten, and until you divide by time you cannot tell which you are looking at. The exponent rather than simple division is deliberate: returns compound, so a 40% gain over ten years is 3.4% a year, not 4%.

Worked examples

BoughtSoldSharesHeldGainTotal returnAnnualised
$50.00$70.001001 year$2,00040.0%40.0%
$50.00$70.0010010 years$2,00040.0%3.4%
$50.00$45.001002 years−$500−10.0%−5.1%
$120.00$150.00403 years$1,20025.0%7.7%

The first two rows are the same trade and not remotely the same outcome. Identical dollars, identical percentage — and one beat the market comfortably while the other lost to a savings account. Any time someone quotes a return without a holding period, this is the ambiguity they are leaving in.

Common mistakes

Terms explained

Cost basis
What you paid, including fees. The figure gains are measured from, and the one tax authorities care about.
Capital gain
The profit from selling above your basis. Unrealised until you sell; realised, and taxable, once you do.
Dividend
A cash payment from company profits. Total return counts these; price charts usually do not.
Total return
Price change plus dividends. The honest measure of how an investment performed.
Annualised return
The equivalent steady yearly rate. The only fair way to compare holdings of different lengths.
Realised vs unrealised
A gain on paper is unrealised and can evaporate. It becomes real, and taxable, when you sell.

Common questions

Does this include dividends?
No — it compares purchase and sale price. For a dividend-paying holding, add the dividends received to the gain to get total return, which can be a substantially different number over long periods.
What is a good annual return?
The broad market has averaged roughly 10% nominal and 7% after inflation over long periods, with severe variation year to year. Beating that consistently is rare enough to be newsworthy.
Why annualise at all?
Because time is half the story. A 40% gain is 40% annualised over one year and 3.4% over ten. Without annualising you cannot compare two positions or judge either.
How do I account for fees?
Add purchase commission to your cost and subtract sale commission from proceeds. On small positions with flat fees, this can consume a meaningful share of a modest gain.
What about taxes?
In the US, holdings sold within a year are generally taxed at ordinary income rates, and longer holdings at lower long-term capital gains rates. The distinction can be worth more than a few points of performance.
Should I sell a losing position?
That depends on what you now think the company is worth, not on your purchase price. Holding a stock only until it returns to what you paid is a decision rule based on a number the market has never heard of.
What if I bought at several different prices?
Compute a weighted average cost: total spent divided by total shares. That average becomes your basis, though some tax regimes let you identify specific lots when selling.
Is a percentage return or a dollar gain more useful?
Percentage lets you compare positions of different sizes and is the right measure of performance. Dollars are what you actually spend, and the right measure of whether a position is large enough to matter.

Related calculators

← All 51 calculators