A stock trade has a simple result — money in, money out — but the details matter: commissions and fees raise your cost basis and cut your proceeds, dividends add to your return, and how long you held the shares changes both the annualized return and the tax rate. This calculator puts all of it in one place.
How to use the stock profit calculator
- Enter the number of shares, the buy price and the sell price (or a target price you are considering).
- Add any commissions or fees on the purchase and the sale. Many brokers charge nothing for US stocks, but options, foreign shares and some accounts still carry fees.
- Enter the total dividends received while you held the shares, if you want total return.
- Optionally enter the purchase and sale dates to get the annualized return and see whether the sale is long-term or short-term.
Stock profit formulas
The break-even price is the sell price at which profit is exactly zero: (Cost basis + Sell fees − Dividends) ÷ Shares.
Worked example
You buy 100 shares at $50 and sell them 540 days later at $65, with no commissions. Along the way you collect $120 in dividends.
Cost basis = 100 × 50 = $5,000
Net proceeds = 100 × 65 = $6,500 → capital gain $1,500
Profit = 1,500 + 120 = $1,620, a return of 32.4%
Annualized = 1.324365/540 − 1 = 20.89% a year
Because the dividends cover part of the cost, you would have broken even selling at $48.80. And because you held for more than a year, the $1,500 gain is a long-term capital gain.
Why the holding period matters
The IRS taxes gains on assets held one year or less at ordinary income rates, which run up to 37% in 2026. Gains on assets held more than one year get the long-term rates of 0%, 15% or 20%, depending on taxable income, and high earners may also owe the 3.8% net investment income tax. The difference on a large gain can be thousands of dollars, which is why the calculator flags the holding period. Estimate the actual bill with the capital gains tax calculator.
Common mistakes when measuring a trade
- Ignoring fees on small trades. A $10 fee each way on a $500 position costs 4% before the stock moves.
- Comparing returns over different periods. A 20% gain over five years is far weaker than 20% in one year; annualized return makes them comparable.
- Forgetting earlier purchases. If you bought the same stock at several prices, your cost basis is the total of all lots. The average cost calculator combines them.
- Overlooking reinvested dividends. Dividends reinvested automatically buy new shares that add to your basis; leaving them out overstates the taxable gain.
To compare the trade with other investments, the ROI calculator and CAGR calculator express returns in the same terms.
Results are estimates before taxes and are not investment advice. Your broker's trade confirmations and Form 1099-B are the official records.
Frequently asked questions
How do I calculate profit on a stock?
Multiply the shares by the sell price and subtract selling fees to get net proceeds. Subtract your cost basis — shares times the buy price plus buying fees. Add any dividends you received while holding the shares to get your total profit.
What is the difference between return and annualized return?
Return is the total gain as a percentage of what you invested, regardless of time. Annualized return converts it to a yearly compound rate, so a 32.4% gain over 540 days is about 20.9% a year. Annualizing very short holding periods exaggerates results, so treat those figures with caution.
When is a stock gain long-term for taxes?
Under IRS rules a gain is long-term when you held the shares for more than one year, counting from the day after you bought them. Selling on the one-year anniversary is still short-term. Long-term gains qualify for the 0%, 15% or 20% rates; short-term gains are taxed as ordinary income.
Should I include dividends in my profit?
For total return, yes — dividends are part of what the investment paid you. For taxes, dividends are reported separately from the capital gain, which is only the difference between net sale proceeds and cost basis.