SmartRates

Stock Profit & Loss Calculator

Calculate gross and net profit or loss on a stock trade including cost basis and commissions.

Buy (Entry)

$
$0.01$5000.00
110,000
$
$0.00$50.00

Sell (Exit)

$
$0.01$5000.00
110,000
$
$0.00$50.00

Trade Result

Net Profit / Loss

$2,300

+51.11% return

Cost Basis$4,500
Total Proceeds$6,800
Gross Profit (before commissions)$2,300
Total Commissions$0
Net Profit / Loss$2,300

What This Calculator Does

The Stock Profit & Loss Calculator computes your exact gain or loss on a trade — accounting for the price you paid, the price you sold at, the number of shares, and any commissions or fees on either side. It shows both the gross profit (before fees) and the net profit (after fees), plus your percentage return on the capital you put in.

This is the calculation you'll want before reporting a sale on your taxes or simply deciding whether a trade was actually profitable once costs are factored in. Even small commissions can meaningfully reduce returns on smaller trades.

Formula

Net Profit = (Sell Price × Shares − Sell Commission) − (Buy Price × Shares + Buy Commission)

Net profit is the difference between what you received when you sold (proceeds, after fees) and what you paid to acquire the shares (cost basis, including fees). Percentage return divides that profit by your original cost basis.

  • BuyPurchase price per share and number of shares bought
  • SellSale price per share and number of shares sold
  • CommCommissions or fees paid on the buy and/or sell side
  • %Return on investment = Net Profit ÷ Cost Basis × 100

Examples

Example 1: A profitable trade with no commissions

Buy 100 shares at $45.00 ($4,500 cost basis), sell 100 shares at $68.00 ($6,800 proceeds), no commissions.

Net profit = $2,300 — a return of about 51.1% on the $4,500 invested.

Example 2: Same trade with commissions on both sides

Same 100-share trade ($45 buy, $68 sell), but with a $5 commission on the buy and a $5 commission on the sell.

Net profit drops to $2,290 (cost basis $4,505, proceeds $6,795) — commissions trimmed $10 off the gain, a small but real difference on larger trades.

Example 3: A losing trade

Buy 50 shares at $120 ($6,000 cost basis), sell 50 shares at $98 ($4,900 proceeds), $0 commissions.

Net loss = −$1,100, a return of about −18.3%. This loss can potentially offset capital gains elsewhere — see the Capital Gains Tax Calculator.

Related Calculators

💰Capital Gains Tax📈Investment Return📊Compare Brokerages

Related Guides

Investing & Brokerage GuideBrokerage account basics, types of investments, and understanding returns and risk.Capital Gains Tax GuideHow profits on stock sales are taxed, short-term vs. long-term.
📐

Methodology

Cost basis = buy price × shares + commissions. Proceeds = sell price × shares − commissions. Net P&L = Proceeds − Cost Basis. Return = Net P&L ÷ Cost Basis × 100.

Frequently Asked Questions

How do I calculate stock profit or loss?+

Profit = (sell price × shares − sell commission) − (buy price × shares + buy commission). If positive, it's a gain. If negative, it's a loss you may be able to use to offset other gains.

What is cost basis?+

Cost basis is the original purchase price plus any fees or commissions paid to acquire the shares. It is the starting point for calculating capital gains and is used on your tax return when you sell.

What is the difference between realized and unrealized gains?+

Realized gains occur when you actually sell shares — you owe tax on these. Unrealized gains exist only on paper while you still hold the shares. You do not owe tax on unrealized gains until you sell.

Disclaimer: Calculations are for informational purposes only and do not constitute professional financial advice. Please consult with a certified professional before making financial decisions.