Stock Calculator
Test cases replayed : 2 of 2 match · Methodology · Sources
Enter the number of shares, the price you paid, the price you sold at (or a target price) and any trading fees.
Result
Profit or loss
Total cost (cost basis)
Reading the result
At a glance
What moves the result
Method and sources: How this calculator works, Sources
- Net sale proceeds
- Return on investment
- Annualized return
Estimate for planning only, not tax, legal, financial or medical advice. Check important figures with the official source listed on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- Number of shares: enter 0 or more.
- Buy price per share, in dollars: enter 0.0001 or more.
- Sell price per share, in dollars: enter 0 or more.
- Commission and fees on the purchase, in dollars: enter 0 or more.
- Commission and fees on the sale, in dollars: enter 0 or more.
- Years held: enter a number from 0.01 to 100.
- Read the result: Profit or loss; the panel also shows Total cost (cost basis), Net sale proceeds, Return on investment and Annualized return.
Sources
- Publication 550, Investment Income and Expenses Internal Revenue Service (IRS) checked on 2026-11-02
- Topic no. 409, Capital gains and losses Internal Revenue Service (IRS) checked on 2026-10-28
How this calculator works
Cost basis = shares × buy price + purchase fees. Net proceeds = shares × sell price − sale fees. Profit = proceeds − cost basis, and return = profit ÷ cost basis × 100.
Annualized return = (proceeds ÷ cost)^(1 ÷ years) − 1, the compound annual growth rate over the holding period. Dividends and taxes are not included.
The formula
| Symbol | Meaning | Unit |
|---|---|---|
| Number of shares | ||
| Buy price per share | $ | |
| Sell price per share | $ | |
| Commission and fees on the purchase | $ | |
| Commission and fees on the sale | $ | |
| Total cost (cost basis) | $ | |
| Net sale proceeds | $ | |
| Profit or loss | $ |
Worked example
| Number of shares | 100 |
|---|---|
| Buy price per share | $50 |
| Sell price per share | $65 |
| Commission and fees on the purchase | $0 |
| Commission and fees on the sale | $0 |
| Years held | 2 |
| Total cost (cost basis) | $5,000.00 |
|---|---|
| Net sale proceeds | $6,500.00 |
| Return on investment | 30% |
| Annualized return | 14.02% |
Profit or loss $1,500.00
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
How much do I make if I buy 100 shares at $50 and sell at $65?
$1,500 before fees and taxes, a 30% return. Held two years, that is about 14.02% a year.
Are stock profits taxed?
Gains are taxed when you sell in a taxable account. The IRS taxes gains on shares held more than a year at long-term capital gains rates, and shorter holdings as ordinary income.