acalculator

What is my stock profit?

Enter the number of shares, the price you paid and the price you sold at. Add commissions, dividends and dates if you have them.

Your numbers

Commissions, dividends and dates
Profit or loss
$1,500.00

Buying 100 shares at $50.00 and selling at $65.00 gives a profit or loss of $1,500.00.

Return
30%
Total cost
$5,000.00
Net sale proceeds
$6,500.00
Break-even sell price
$50.00
Share price change
30%

Profit or loss: $1,500.00. Buying 100 shares at $50.00 and selling at $65.00 gives a profit or loss of $1,500.00.

The results are estimates for information only. They are not financial, tax, or legal advice. Check the numbers with your lender or a qualified professional before you decide. Terms of use

How to calculate

Computes the profit or loss and the return on shares bought and sold at prices you type, after commissions and with dividends, and the annualized return and holding period when you add the dates.

Example with the default inputs (Number of shares 100, Buy price per share $50.00, Sell price per share $65.00, Commission to buy $0.00, Commission to sell $0.00, Dividends received $0.00): Buying 100 shares at $50.00 and selling at $65.00 gives a profit or loss of $1,500.00.

Method: Profit = (shares × sell price − commission to sell) + dividends − (shares × buy price + commission to buy); return = profit ÷ total cost × 100.

  • Prices are what you type; nothing is looked up.
  • Commissions are dollar amounts for the whole trade.
  • Taxes are not taken out. Long-term and short-term follow the one-year rule of IRS Publication 550.
  • This is an estimate, not tax or investment advice.

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. Number of shares 100, Buy price per share $50.00, Sell price per share $65.00, Commission to buy $10.00, Commission to sell $10.00 gives Profit or loss $1,480.00, Total cost $5,010.00, Net sale proceeds $6,490.00, Return 29.540918%, Break-even sell price $50.20, Share price change 30%.Source: IRS Publication 550: basis includes the purchase commission and the amount realized is the sale price minus selling expenses (https://www.irs.gov/publications/p550)
  2. Number of shares 40, Buy price per share $120.35, Sell price per share $98.10, Commission to buy $4.95, Commission to sell $4.95, Dividends received $18.40 gives Profit or loss -$881.50, Total cost $4,818.95, Net sale proceeds $3,919.05, Return -18.292367%, Break-even sell price $120.14.Source: IRS Publication 550, basis and amount realized (https://www.irs.gov/publications/p550)
  3. Number of shares 10, Buy price per share $100.00, Sell price per share $121.00, Date bought 2024-03-01, Date sold 2026-03-01 gives Profit or loss $210.00, Return 21%, Days held 730, Annualized return 10%, Holding period Long-term.Source: IRS Publication 550, holding period: more than 1 year is long-term (https://www.irs.gov/publications/p550)
  4. Number of shares 10, Buy price per share $100.00, Sell price per share $110.00, Date bought 2025-01-15, Date sold 2026-01-15 gives Days held 365, Annualized return 10%, Holding period Short-term.Source: IRS Publication 550, holding period: count from the day after you bought through the day you sold (https://www.irs.gov/publications/p550)

How the stock profit is worked out

All money is worked out in exact decimal arithmetic from the numbers as typed, and each result is shown to the cent, rounded half up. An empty commission or dividend counts as $0.

  • Total cost = shares × buy price + commission to buy.
  • Net sale proceeds = shares × sell price − commission to sell.
  • Profit or loss = net sale proceeds + dividends − total cost. It is negative for a loss.
  • Return = profit ÷ total cost × 100. It is left out when the total cost is $0.
  • Break-even sell price = (total cost + commission to sell − dividends) ÷ shares. It is left out when the dividends alone are more than the cost and the commission to sell (any price makes a profit).
  • Share price change = (sell price − buy price) ÷ buy price × 100. It is left out when the buy price is $0.

With both dates:

  • Days held = calendar days from the date bought to the date sold. A sell date before the buy date has no answer.
  • Annualized return = ((1 + return ÷ 100)^(365 ÷ days held) − 1) × 100, in floating point. It is left out when the days held are 0, when there is no return, when 1 + return ÷ 100 is 0 or less (a total loss), or when it is too large to show (not a finite 64-bit number, for example a large gain over one day). Being floating point, an annualized return that is exactly a half in its last shown decimal can land just below it and show rounded down.
  • Holding period is Long-term when the shares were held more than one year and Short-term otherwise. The holding period starts the day after the purchase and includes the day of the sale (IRS Publication 550), so it is long-term exactly when the date sold is after the one-year anniversary of the date bought. The anniversary of February 29 is February 28.

Limits. Shares above 0 and at most 1 billion; prices from $0 to $10 million a share; commissions from $0 to $1 billion; dividends from $0 to $1 trillion.

Display. Money to the cent, rounded half up from the exact value; percents at most 2 decimals, rounded half up.

Assumptions

  • Every price is one you type; nothing is looked up.
  • Commissions are dollar amounts for the whole trade, not per share.
  • Taxes are not taken out. This is an estimate, not tax or investment advice.

Worked examples by hand

A gain with commissions. 100 shares bought at $50 and sold at $65, $10 commission each way. Total cost = 100 × 50 + 10 = $5,010. Net sale proceeds = 100 × 65 − 10 = $6,490. Profit = 6,490 − 5,010 = $1,480. Return = 1,480 ÷ 5,010 = 29.54%. Break-even = (5,010 + 10) ÷ 100 = $50.20. The share price changed by 15 ÷ 50 = 30%.

A loss with dividends. 40 shares at $120.35, sold at $98.10, $4.95 each way, $18.40 of dividends. Total cost = 4,814 + 4.95 = $4,818.95. Net sale proceeds = 3,924 − 4.95 = $3,919.05. Profit = 3,919.05 + 18.40 − 4,818.95 = −$881.50, a return of −18.29%. Break-even = (4,818.95 + 4.95 − 18.40) ÷ 40 = $120.1375, shown as $120.14.

Held two years. 10 shares at $100 sold at $121, bought March 1, 2024 and sold March 1, 2026. Profit $210, return 21%. Days held = 365 + 365 = 730 (February 29, 2024 is before March 1). Annualized = 1.21^(365 ÷ 730) − 1 = 1.1 − 1 = 10%. Held more than a year: Long-term.

Sold on the anniversary. Bought January 15, 2025 and sold January 15, 2026: 365 days, exactly one year, so Short-term. A 10% return over 365 days is 10% a year.

Other questions people ask

How do I calculate the profit on a stock?

Multiply the shares by the sell price and take off the commission to sell: that is what you got. Multiply the shares by the buy price and add the commission to buy: that is what you paid. The profit is the first minus the second, plus any dividends. 100 shares bought at $50 and sold at $65, with $10 each way, give $6,490 − $5,010 = $1,480.

How is the return worked out?

The return is the profit as a percent of what you paid, including the commission to buy. $1,480 on a cost of $5,010 is a 29.54% return. The share price change (30% from $50 to $65) is higher, because it ignores the commissions.

What is the break-even price?

It is the sell price per share at which you make exactly $0: (total cost + commission to sell − dividends) ÷ shares. For 100 shares that cost $5,010 with a $10 commission to sell, the break-even price is $50.20.

What is the difference between short-term and long-term?

Under the IRS rule, shares held more than one year give a long-term gain or loss; shares held one year or less give a short-term one. The holding period starts the day after you buy and includes the day you sell, so shares sold on the one-year anniversary of the purchase are still short-term. Long-term gains usually have lower tax rates. Add both dates to see which one applies.

What is the annualized return?

It is the yearly rate that gives the same return over the time you held the shares: (1 + return)^(365 ÷ days held) − 1. A 21% return over 730 days is 10% a year, because 1.1 × 1.1 = 1.21. Over a short time a small return can annualize to a large number, so read it with the days held.

Does the calculator look up the stock price?

No. Every price is one you type, so the page works offline and never sends your numbers anywhere. Use the price from your trade confirmation, or the price you expect to sell at.

Does it include taxes?

No. It shows the gain before tax. The total cost is your cost basis for tax purposes (the price plus the commission to buy), and the net sale proceeds are the amount realized (the price minus the commission to sell), as IRS Publication 550 describes.