Skip to content
Calcapedia
Money

Stock Profit Calculator

Find how much a stock trade made or lost, and its percentage return, counting fees, dividends and, if you like, a yearly return.

Level: Grade 7

  • Common Core standard 7.RP.A.3Use proportional relationships to solve multistep ratio and percent problems. Examples: simple interest, tax, markups and markdowns, gratuities and commissions, fees, percent increase and decrease, percent error.
  • Common Core standard 7.EE.B.3Solve multi-step real-life and mathematical problems posed with positive and negative rational numbers in any form (whole numbers, fractions, and decimals), using tools strategically. Apply properties of operations to calculate with numbers in any form; convert between forms as appropriate; and assess the reasonableness of answers using mental computation and estimation strategies.
Printable worksheet

Stock Profit Calculator

Know the answer you need? Pick an input to work backward.

Inputs

Fractional shares are fine.

Optional. The total cash dividends on these shares.

Optional. Adds an annualized return. 6 months is 0.5.

Result

Profit

$1,500.00

Selling 100 shares bought at $50.00 for $65.00 makes $1,500.00, a 30% return on $5,000.00.

Return on cost
30%
Cost basis
$5,000.00
Net sale proceeds
$6,500.00
Break-even sell price per share
$50.00
What the trade returns
  • Cost basis returned$5,000.0076.9%
  • Profit$1,500.0023.1%

See the step-by-step solution ↓

Step-by-step solution

  1. Cost basis: what the shares cost, plus any buying fees

    100×$50.00=$5,000.00
  2. Net proceeds: what the sale brings in, minus any selling fees

    100×$65.00=$6,500.00
  3. Profit: net proceeds minus cost basis

    $6,500.00−$5,000.00=$1,500.00
  4. Find the return: the profit as a percentage of what you paid (the cost basis)

    $1,500.00$5,000.00×100=30%

Test yourself

20 quick questions built from this calculator's formula: work out results, predict what happens when an input changes, and work backward from an answer. Every answer comes with the working.

Please note: Results are estimates for planning and comparison. Lenders, banks, and tax authorities may round differently or include fees not modeled here, so confirm figures with your provider before deciding.

What this calculator does

Find out how much money a stock trade really made or lost, after fees and dividends. It looks simple: sell price minus buy price. Then commissions, dividends and how long you held the shares come in.

This calculator puts all of them together. It finds the cost basis, which is everything you paid for the shares. It finds the net amount the sale brings in, and the profit or loss in dollars. And it gives the return as a percentage of what you put in.

Add the dividends (cash payments the company made to shareholders) you collected. Then you'll see your total return for the time you held the shares, not just the price gain. Add how long you held the shares to turn the return into a yearly (annualized) figure. You can compare that with other investments. The break-even sell price tells you what the shares need to sell for so you come out even after costs.

Where it's used

Why this math matters outside the classroom:

  • Personal investing. An investor who bought 100 shares at $50 and sold at $65 finds a $1,500 gain, a 30% return on $5,000.
  • Math class projects. Students track a pretend portfolio and compute each stock's percent gain or loss from its purchase price.
  • Checking a sale price. A seller works out the break-even price that covers both commissions before placing a sell order.
  • Comparing trades. Annualizing a 10% gain over six months gives 21% a year, which can be compared with a full-year return.
  • Investment clubs. Club members total each position's price gain plus dividends to report the year's holding-period returns.

Grade level and standards: Grade 7; Common Core State Standards for Mathematics 7.RP.A.3, 7.EE.B.3. © Copyright 2010. National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.

How to use it

  1. Enter the number of shares and the price per share you paid and sold at.
  2. If you have them, enter the commissions or fees paid on each side of the trade. Add any dividends received while you held the shares.
  3. To get a yearly return, enter how long you held the shares in years (for example, 0.5 for six months).
  4. Read the profit or loss, the return on cost and the break-even sell price. Follow the steps to see how each is found.

What the inputs mean

Number of shares
The number of shares bought and later sold. Fractional shares work the same way.
Commission or fees to buy
Commissions, transaction fees or other costs of buying. They're added to the cost basis.
Commission or fees to sell
Commissions and fees on the sale, which reduce what you receive.
Dividends received while held
Cash dividends received on these shares while you held them. They count toward your total return even though they aren't part of the sale.
Holding period
How long you held the shares. It's used only for the annualized return. Leave it blank to skip it.

Formula and method

cost basis = shares × buy price + buying fees
net proceeds = shares × sell price − selling fees
profit = net proceeds − cost basis + dividends
return = profit ÷ cost basis × 100
annualized return = (1 + return)^(1 ÷ years) − 1
break-even sell price = (cost basis + selling fees − dividends) ÷ shares

In the annualized formula, return is written as a decimal (31% is 0.31), and years is how long you held the shares.

The cost basis is everything you paid to own the shares. Net proceeds are what reaches you after the sale. The difference, plus any dividends, is your total gain or loss before tax. Divide it by the cost basis to get the holding-period return, your return for the whole time you held the shares.

The annualized return spreads that total return evenly across the years held. It allows for compounding, where each year's gain builds on the last. That way a 31% gain over 18 months and a 20% gain over one year can be compared fairly. The break-even price is the sell price at which the profit would be exactly zero.

Worked example

You buy 100 shares at $50 with a $4.95 commission, collect $80 in dividends, and sell 18 months later at $65, paying another $4.95.

  1. Cost basis: 100 × $50 + $4.95 = $5,004.95.
  2. Net proceeds: 100 × $65 − $4.95 = $6,495.05.
  3. Profit: $6,495.05 − $5,004.95 + $80 = $1,570.10, of which $1,490.10 came from the price rise.
  4. Return: $1,570.10 ÷ $5,004.95 × 100 = 31.37%.
  5. Annualized over 1.5 years: 1.3137^(1 ÷ 1.5) − 1 ≈ 19.95% a year.
  6. Break-even sell price: ($5,004.95 + $4.95 − $80) ÷ 100 = $49.30.

Result: The trade made $1,570.10, a 31.37% return, or about 19.95% a year.

Understanding the result

A positive result is a gain, and a negative one is a loss, both before tax. The return on cost lets you compare trades of different sizes. The annualized return lets you compare trades held for different lengths of time.

Sometimes the break-even price is below your buy price, as in the example. That means dividends have more than covered your fees. When fees are large compared with the trade, the break-even price can sit well above what you paid.

Assumptions and limitations

  • All shares are bought at one price and sold at one price. For several purchases at different prices, use the dollar-cost averaging calculator to find the average cost first.
  • Dividends are counted as cash received, not used to buy more shares.
  • Results are before any tax on gains or dividends.
  • Taxes aren't included. Use the capital gains tax calculator to estimate tax on the gain.
  • Short sales, options, margin interest, stock splits and currency conversion aren't modeled.
  • This is an educational calculation, not investment advice.

Frequently asked questions

Should I include dividends in my profit?

Yes, if you want your total return. Dividends are part of what the investment paid you. Leaving them out shows only the price gain. That makes the return on dividend-paying stocks look smaller than it really is.

What is a holding-period return?

It's the total return over the whole time you owned an investment: price change plus income, divided by what you paid. It doesn't take into account how long you held it. That's why the annualized return is useful for comparisons.

Why does my broker show a different gain?

Brokers may report only the price gain, leave dividends out, or use an average cost across several purchases. Some also show unrealized gains, meaning gains on paper for shares you still hold. Match the inputs to what your broker includes, so you compare like with like.

How do I enter a trade I held for a few months?

Enter the holding period as a fraction of a year: 3 months is 0.25, and 9 months is 0.75. Annualizing a short holding can give a large figure. That's because it assumes the same pace keeps going for a full year.

How this calculator is checked

Method: Standard definitions of cost basis, net proceeds, holding-period return (price change plus income over cost) and compound annualization. The calculation is covered by automated tests with known reference values and edge cases. Last updated 2026-10-18. Found a problem? Tell us.

Embed this calculator

Put this Stock Profit Calculator on your own website or blog for free. Paste this code where you want it to appear: