Stock Profit Calculator

Work out the profit or loss on a stock trade from the number of shares, the buy and sell prices and any commissions. Add the dates to see the annual return and whether the gain is short or long-term for tax. Type a ticker to use today’s price as the sell price. Free, and you can add it to your own website.

Free · no sign-up · updated

How to use the calculator

  1. Enter the number of shares, the buy price and the sell price. Type a ticker to use today’s closing price as the sell price.
  2. Add any commissions you paid on the purchase and the sale.
  3. Open Dates and taxes to see the holding period, the annual return and an estimate of the tax on the gain.

How profit and return are calculated

cost        = shares × buy price + buy commission
proceeds    = shares × sell price − sell commission
profit      = proceeds − cost
return      = profit / cost
break-even  = (cost + sell commission) / shares

Example: 100 shares bought at $50, sold at $65

With a $5 commission on each trade, the cost is $5,005 and the proceeds $6,495, a profit of $1,490 or a 29.77% return. The break-even sell price is $50.10. Held for two years, that is an annual return of about 13.9%; as a long-term gain taxed at 15%, about $1,266.50 is left after tax.

Short-term vs long-term gains

In the US, gains on investments held for one year or less are short-term and taxed as ordinary income. Gains on investments held for more than one year are long-term and taxed at lower rates (0%, 15% or 20% for most people, depending on income). The calculator uses the dates you enter to pick the rate; change the two rates to match your situation. Losses can offset gains, and up to $3,000 a year of net losses can offset other income.

Annual return

A 30% gain is very different over six months and over five years. The annual return, (1 + return)^(365 / days) − 1, puts trades of different lengths on the same footing. For a stock’s return including dividends over a period, use the stock return calculator.

Common mistakes

  • Forgetting commissions and fees, which matter on small trades.
  • Using the wrong cost basis after buying at several prices. Use your average cost; the average down calculator works it out.
  • Ignoring dividends received while holding the stock; they add to your total return.

Frequently asked questions

How do I calculate profit on a stock?

Multiply the shares by the sell price, subtract the sell commission, then subtract what you paid (shares × buy price plus the buy commission). Divide the profit by the cost for the percentage return.

What is the break-even price?

The sell price at which you neither gain nor lose after commissions: (total cost + sell commission) ÷ number of shares.

How is the annual return calculated?

From the return and the days held: (1 + return)^(365 ÷ days) − 1. It shows the yearly rate that would give the same result.

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

In the US, shares held one year or less give short-term gains, taxed like ordinary income; held longer than one year, they give long-term gains, taxed at lower rates. The calculator picks the rate from your dates.

Does the calculator include dividends?

No. It covers the trade itself. Dividends you received while holding the shares add to your total return; see the stock return calculator for that.

Can I use today's price?

Yes. Type the ticker and the latest end-of-day close is filled in as the sell price. You can overwrite it with a live quote.

Can I put this calculator on my website?

Yes. It is free for any site. Use the embed code generator at the bottom of this page, copy the code and paste it into your page. Please keep the credit line with the two links under the calculator.

Related calculators

See all free investing calculators, or add live stock quotes to your site with the free stock widgets.

Add this calculator to your website

The calculator is free to embed on any website, personal or commercial, and works on WordPress, Blogger, Wix, Squarespace, Webflow, Ghost and plain HTML. Choose the options, copy the code and paste it into your page.

Layout
Theme

Preview: this is how the calculator and the credit line will look on your page

Free for personal and commercial websites. Please keep the “by Quotelinks” credit line under the calculator visible and unchanged, and don’t modify the calculator or present it as your own. The <script> line is optional: it sizes the frame to fit the calculator; if your platform removes scripts, the calculator still works at the fixed height. Tax figures are simple estimates. For illustration only, not financial or tax advice.