stock market calculators

Stock Profit/Loss Calculator

Calculates the total profit or loss from a stock trade based on your buy price, sell price, and number of shares. Use it immediately after closing a position to assess your net gain before factoring in taxes and commissions.

About this calculator

When you buy and sell shares of stock, your profit or loss depends on the price change and the size of your position. The formula is: Profit / Loss = (Sell Price − Buy Price) × Number of Shares. A positive result means a gain; a negative result means a loss. This calculation gives you the gross profit before brokerage commissions, taxes, or currency conversion fees. To find the percentage return, divide the profit by the total amount invested (Buy Price × Shares) and multiply by 100. Tracking per-trade results is essential for portfolio accounting, tax reporting, and evaluating your trading strategy over time.

How to use

Say you bought 150 shares of a company at $32.00 each and later sold them at $45.50. Enter $32.00 as the Buy Price, $45.50 as the Sell Price, and 150 as the Number of Shares. The calculator computes: Profit = (45.50 − 32.00) × 150 = 13.50 × 150 = $2,025. Your total investment was $4,800, so the percentage return is (2,025 / 4,800) × 100 ≈ 42.2%. Remember to subtract any commissions paid on both legs of the trade for your true net gain.

Frequently asked questions

How do I calculate the percentage return on a stock trade?

To find the percentage return, first calculate your gross profit using (Sell Price − Buy Price) × Shares. Then divide that figure by your total cost basis — Buy Price × Shares — and multiply by 100. For example, a $500 profit on a $2,000 investment is a 25% return. If you paid commissions, subtract them from the profit before dividing to get your net percentage return. This percentage makes it easy to compare trades of different sizes.

Does the stock profit/loss calculator account for trading commissions?

This basic calculator computes gross profit or loss based solely on price difference and share count. It does not automatically deduct brokerage commissions, platform fees, or SEC transaction fees. To get your net profit, subtract total commissions paid on both the buy and sell legs from the calculated result. Many discount brokers now offer commission-free trading, but options trades, international stocks, and some platforms still charge fees that can meaningfully reduce small gains.

How does short selling change the profit and loss calculation?

In a short sale, you sell shares first and buy them back later, so the profit formula reverses: Profit = (Sell Price − Buy Price) × Shares, where Sell Price is your opening price and Buy Price is your closing (cover) price. If you short 100 shares at $50 and cover at $38, your profit is (50 − 38) × 100 = $1,200. The same formula applies, but gains come from price decreases. Short positions also incur borrowing costs, which reduce your net profit and must be tracked separately.