Stock Profit Calculator
Computes gross/net profit, percent return, and annualized return on a completed or hypothetical stock trade.
Stock Profit
Live toolrealizedGainLong positions only — this tool assumes you buy first and sell later. Entering short-sale prices in reverse will show the wrong sign.
Dividends here are cash received only. Reinvested dividends change your share count and cost basis — find your true average cost first →
How it works
Enter the shares you bought, your buy price, and your sale price — real or hypothetical. The calculator first finds your total cost basis (shares × buy price, plus any purchase fees) and your net sale proceeds (shares × sale price, minus any sale fees). Gross profit is the raw price move times shares; net profit is what actually hit your account after both sets of fees, plus any cash dividends you collected while holding. Percent return divides net profit by cost basis — the capital you actually put at risk — and, if you enter a holding period in days, the annualized return shows what that total return works out to compounded over a 365-day year.
Most stock profit calculators stop at shares × price difference. That naive answer is wrong for exactly the people who care most: fees and dividends change the honest number, and only an annualized figure lets you compare a 270-day trade against anything else.
The formula
- Cost basis = shares × buy price + buy fees
- Proceeds = shares × sale price − sell fees
- Gross profit = shares × (sale price − buy price)
- Net profit = proceeds − cost basis + cash dividends received
- Return % = (net profit ÷ cost basis) × 100. Cost basis — not proceeds — is the denominator because it is the capital actually put at risk.
- Annualized return % = ((1 + total return as a decimal)365 ÷ holding days − 1) × 100. A fixed 365-day year is used by convention; leap years are not special-cased, and the ~0.3% distortion is immaterial for an educational estimate.
Worked example
An investor buys 100 shares of a stock at $42.50, pays a $4.95 buy commission, collects $32.00 in cash dividends, and sells all 100 shares 270 days later at $51.30 with a $4.95 sell commission.
- Cost basis = 100 × 42.50 + 4.95 = 4,250.00 + 4.95 = $4,254.95
- Proceeds = 100 × 51.30 − 4.95 = 5,130.00 − 4.95 = $5,125.05
- Gross profit = 100 × (51.30 − 42.50) = 100 × 8.80 = $880.00
- Net profit = 5,125.05 − 4,254.95 + 32.00 = 870.10 + 32.00 = $902.10
- Return = (902.10 ÷ 4,254.95) × 100 = 0.212012 × 100 = 21.20%
- Annualized return = ((1.212012)365 ÷ 270 − 1) × 100 = (1.296848 − 1) × 100 = 29.68%
Displayed results: gross profit $880.00 · net profit $902.10 · return 21.20% · annualized return 29.68%. Intermediate math runs at full precision; display rounds to 2 decimal places.
FAQ
How do I calculate profit on a stock?
Multiply shares by the difference between sale price and buy price for gross profit, then subtract buy and sell fees and add any cash dividends received for net profit. Net profit divided by total cost basis (shares × buy price + buy fees) gives your percent return.
Does this calculator include taxes?
No — all results are pre-tax. US capital gains tax depends on your holding period and income bracket, and rules change over time (as of 2026). The linked capital gains tax calculator provides an educational estimate.
What is the difference between gross and net profit?
Gross profit is the raw price move times shares. Net profit also subtracts buy and sell commissions and adds cash dividends collected — it is the number that actually hit your account.
How is annualized return calculated?
The total return is compounded over a 365-day year: (1 + total return)^(365 ÷ holding days) − 1. For holdings under about a month, annualized figures extrapolate heavily and should be read as a convention, not a forecast.
Can I include dividends?
Yes — enter the total cash dividends received while holding. If dividends were reinvested into more shares, your share count and cost basis changed; compute your true average cost first with the average cost calculator.
What if I sold below my buy price?
The calculator shows a negative net profit and percent return, clearly labeled as a loss. Losses may be usable to offset gains for US tax purposes — an educational topic covered by the capital gains tax calculator.
Continue your analysis
Educational disclaimer
StockTools.ai calculators are for education and planning only — nothing on this page is investment, financial, legal, or tax advice. In addition: (1) results are pre-tax estimates — this tool does not compute tax owed and is not tax advice; US rules vary by situation and change over time (as of 2026); (2) annualized return is a mathematical extrapolation, not a projection of future performance; (3) dividends are treated as cash received, not reinvested; (4) annualization treats dividends as received at the sale date — the true money-weighted (IRR) annualized return is slightly higher when dividends arrived earlier in the holding period; (5) long positions only — short-sale economics (borrow fees, margin) are out of scope.