This calculator works out the dollar gain or loss on a stock trade after commissions and other fees. Enter the number of shares, the buy and sell prices, and total fees to see what the trade actually earned.
How to use the Stock Profit calculator
- Enter the number of Shares. Fractional shares are accepted.
- Enter the Buy price per share and the Sell price per share, or a target sell price to test a scenario.
- Enter Total buy/sell fees: commissions, regulatory fees and any other charges for both sides of the trade.
- Read the profit; a negative result is a loss.
How the stock profit calculation works
What the result covers
Profit = shares × (sell price − buy price) − total fees. That is the realized gain or loss on the trade itself. It does not add dividends you received while holding the stock, adjust for stock splits, or convert foreign currency.
If the stock split while you held it, use split-adjusted prices so the share count and prices match. For a position bought in several lots at different prices, use the average cost per share as the buy price, which the Dollar-Cost Averaging Calculator can calculate.
Profit, percentage return and tax
To turn the dollar profit into a percentage, divide it by your total cost: shares × buy price plus the buying fees. A 775 profit on a 2,105 position is roughly a 37% return before tax.
Profit is not the same as taxable gain. The IRS treats a gain on an asset held more than one year as long-term and one held a year or less as short-term, and the two are taxed differently. The Capital Gains Calculator works from your adjusted cost basis, which is the figure used for tax reporting. For your actual tax, consult a tax professional.
Worked example
Shares: 50 · Buy price per share: 42.1 · Sell price per share: 57.8 · Total buy/sell fees: 9.98
- Price gain per share = 57.80 − 42.10 = 15.70.
- Gross gain = 50 × 15.70 = 785.00.
- Subtract fees: 785.00 − 9.98 = 775.02.
Result: $775.02
Assumptions and limits
Manual scenario inputs; no market data, tax rules, fees or guarantees. Currency is display only. Fractional shares accepted. No dividends, splits, currency conversion or capital-gains tax.
Formula and worked examples last checked November 20, 2026. Spotted a problem? Report an error.
Frequently asked questions
How do I calculate profit on a stock?
Multiply the number of shares by the difference between the sell and buy prices, then subtract all fees. For 50 shares bought at 42.10 and sold at 57.80 with 9.98 in fees, the profit is 775.02.
What sell price do I need to break even?
Add total fees to your total purchase cost and divide by the number of shares. With 50 shares at 42.10 and 9.98 in fees, break-even is (2,105 + 9.98) ÷ 50 ≈ 42.30 per share. Entering that as the sell price returns about zero.
Should I include dividends in stock profit?
This calculator does not, because it measures the trade only. To see total return, add the dividends you received during the holding period to the result. The Dividend Yield Calculator helps you estimate annual dividend income.
Do I pay tax on the whole profit?
Tax is based on the gain calculated from your cost basis, and the rate depends on how long you held the shares and your income. The IRS taxes short-term gains as ordinary income. Use the Capital Gains Calculator for the gain figure and a tax professional for the tax.