Stock gain and loss calculator
Stock Calculator
This stock calculator works out your profit or loss on a stock, your % return, your annualized return and the sell price that breaks even after commissions. Type your own numbers, or enter a ticker and a buy date to fill in real closing prices and dividends.
Free to use. No account or sign-up needed.
Your numbers
What you paid for each share.
Optional. Needed for the yearly rate and the fill.
Use today's price to see what the stock is worth now.
Optional. A later date works for a price you have in mind.
Use 0 for none.
Use 0 for none.
Everything you collected per share between the two dates.
Results
After commissions, buying 100 shares at $50.00 costs $5,005 and selling at $80.00 brings in $7,995, a gain of $2,990, or a 59.74% return. From Jan 4, 2021 to Jan 5, 2026 that is 9.82% a year. Dividends of $6.00 a share add $600, for a total return of 71.73%.
How it works
Profit on a stock is what the sale brings in minus what the shares cost. This stock profit calculator starts with your cost basis: shares x buy price, plus the buy commission. Your proceeds are shares x sell price, minus the sell commission. The gain or loss is proceeds minus cost basis.
Your % return divides the gain by the cost basis, so the example's $2,990 gain on $5,005 is a 59.74% return. It is the same number a stock ROI calculator gives, since ROI is also the gain over the money you put in.
Annualized return, also called CAGR, turns that total into a steady yearly rate. Divide what you ended with by your cost basis, raise the result to the power of 1 divided by the years held, then subtract 1. It lets you compare a 3-year holding with a 10-year one. A holding under about a year shows no yearly rate, because stretching a few months into a full year overstates it.
A worked example
Say you buy 100 shares at $50 on Jan 4, 2021 and pay a $5 commission. 100 x $50 is $5,000, so your cost basis is $5,005 with the commission.
On Jan 5, 2026 you sell at $80 and pay another $5. 100 x $80 is $8,000, so your proceeds are $7,995. That is a gain of $2,990, a 59.74% return on your cost basis, or 9.82% a year over about 5 years.
The stock also paid $6 a share while you held it, which is $600 in cash. Your gain with dividends is $3,590, a total return of 71.73%, or 11.42% a year.
Commissions and break-even
Commissions come out of your result on both sides of a trade. The buy commission raises your cost basis and the sell commission lowers your proceeds. Many US brokers now charge $0 on stock trades, so enter 0 in both boxes if you paid nothing.
The break-even sell price is where the trade comes out even. Add the sell commission to your cost basis and divide by your shares.
On the example, ($5,005 + $5) / 100 shares is $50.10, so the stock has to rise $0.10 above the $50 buy price to cover both commissions.
Dividends stay out of the break-even price, so it shows what the sale alone has to bring in.
Dividends and splits
Price is only part of what a stock pays you. Pick Include dividends and enter what you collected per share between the two dates, and the calculator adds that cash to your gain for the total return with dividends. The dividends count as cash, so they are never reinvested here.
A stock split changes your share count and leaves your money the same. A 4-for-1 split turns 10 shares into 40 at about a quarter of the price, so a buy price from before the split cannot be compared with a price from after it. When the ticker fill finds a recorded split between your dates, it puts everything on the share basis of the sell date: your shares go up, the buy close and the older dividends go down by the same factor, and your cost basis stays the same.
A recorded change too small to count as a stock split, such as a spin-off, is different. You keep the same shares, so your shares, the buy price and the dividends stay as paid, and the value of any shares you got in a new company is not counted here. If it was a stock dividend or a small split, enter your own share count, the buy price per share after it and the dividends per share on that count.
To see the same stock with its dividends reinvested, next to the S&P 500, use the total return calculator. That calculator keeps the value of a spin-off in the stock, so its share count can differ from this page.
Your stock's value
How much is my stock worth? Multiply your shares by the current price. 100 shares at $80 are worth $8,000 before any sell commission.
Enter today's price as the sell price and this works as a stock gain calculator for shares you still hold. To use it as a stock price calculator, change the sell price to any price you have in mind and read the gain, the return and the yearly rate that price would give you. A later sell date works too.
Start from a stock does the lookup for you. With a ticker and a buy date it fills the buy price from the first close on or after that date, the sell price from the latest close, or from the last close on or before a sell date you picked, and the dividends per share paid in between. Every filled box stays editable.
With no buy date it fills only the sell side: the stock's most recent close in the last 21 days and that close's date, or the last close in the 21 days up to a sell date you typed, which stays as you typed it.
For the return on any other investment, use the ROI calculator.
What the calculator assumes
- You buy all the shares in one trade and sell them all in one trade.
- Commissions are flat amounts for each trade, and there are no other fees.
- Dividends are cash you keep. They earn nothing after you collect them.
- The ticker fill uses daily closing prices, so the price you really paid can differ. A dividend counts when its ex-dividend date falls after the buy day and on or before the sell day, and that includes any special dividend.
- Recorded splits put your shares, prices and dividends on the sell date's share basis. A change too small to count as a stock split, such as a spin-off, leaves them as paid, and the value of any shares you got in a new company is not counted. A one-day rise of 2x or more, or a drop of 50% or more, after counting recorded splits and dividends, counts as a real move only when GNG's split-adjusted prices show the same move and no split is recorded that day. Any other such day looks like a stock split GNG cannot confirm for that day, so the fill leaves your numbers alone and names the day.
- There are no taxes or inflation adjustments.
Stock calculator FAQ
How do you calculate stock profit?
Multiply your shares by the sell price and subtract the sell commission, then subtract your cost basis: shares x buy price plus the buy commission. 100 shares bought at $50 and sold at $80, with a $5 commission each way, is a $2,990 profit.
How do you calculate the % return on a stock?
Divide the gain by the cost basis and multiply by 100. A $2,990 gain on a $5,005 cost basis is a 59.74% return, which is the stock's ROI before dividends. A stock ROI calculator and this page give the same number.
How do I annualize my stock's return?
Divide what you ended with by your cost basis, raise that to the power of 1 divided by the years held, then subtract 1. That steady yearly rate is also called CAGR. A 59.74% return over 5 years is about 9.82% a year, less than 59.74% divided by 5, because gains compound.
Does the stock calculator include dividends?
Yes, when you pick Include dividends. Enter the dividends per share you collected, or fill them from a ticker. They count as cash on top of your gain and are not reinvested. The total return calculator shows dividends reinvested.
How do you calculate the break-even price of a stock?
Add the sell commission to your cost basis and divide by your shares. With a $5,005 cost basis, a $5 sell commission and 100 shares, the break-even sell price is $50.10. Below that price the trade loses money.
How much is my stock worth?
Multiply your shares by the current share price. 100 shares at $80 are worth $8,000 before any sell commission. Leave the buy date empty, enter a ticker and pick Fill to use its most recent close, with its date, as the sell price.
What if the stock split after I bought it?
When the fill finds a recorded split between your dates, it moves your shares, buy price and dividends to the sell date's basis, so a 4-for-1 split turns 10 shares at $400 into 40 shares at $100. A change too small to count as a split, such as a spin-off, leaves them as paid.
Is this stock calculator free?
Yes. It runs in your browser with no account and no sign-up. A free GNG account adds the Portfolio Tracker, which follows your own holdings, and the Backtester, which tests a portfolio on real prices.
Track your own holdings and backtest a portfolio on real prices with a free GNG account.
Sign Up FreeThis calculator is for education and is not investment advice. Results depend on the numbers you enter, and past prices do not predict future returns. Read our disclosures.