Skip to content
Calculator Collection

Stock Profit/Loss Calculator

Calculate the dollar profit or loss from a stock trade given buy price, sell price, and share count. Use it immediately after closing a position to confirm the gross gain before factoring in taxes, commissions, and currency conversion.

Last updated: May 2026

Fill in the required fields to see your result.

Compare with similar

About this calculator

The calculator computes the gross profit or loss from a single round-trip stock trade. The formula is: Profit/Loss = (Sell Price − Buy Price) × Shares. A positive result means a gain; a negative result means a loss. Variables: Buy Price is the per-share purchase price (use the actual fill price, not the order price); Sell Price is the per-share execution price at closing; Shares is the number of shares in the position. Edge cases: a Buy Price of zero gives a profit equal to total sell proceeds (rare — happens with stock grants or rights issues); a Sell Price below Buy Price gives a negative number — your loss. The calculator returns GROSS profit before commissions, taxes, SEC fees, exchange fees, and currency-conversion losses (for foreign stocks). To get net profit, subtract all costs from the gross figure. To get the percentage return, divide profit by total cost basis (Buy Price × Shares) and multiply by 100 — a $2,000 profit on a $10,000 position is a 20% return. The percentage matters more than the dollar amount for comparing trades of different sizes. For tax purposes, the difference between short-term gains (held ≤1 year, taxed at ordinary income rates up to 37%) and long-term gains (held >1 year, taxed at 0/15/20% in the US) can be enormous — always note the holding period when reviewing your year-end results.

How to use

Example 1 — Modest gain on a tech name. Buy 150 shares at $32.00 each, sell at $45.50. Step 1: profit per share = 45.50 − 32.00 = $13.50. Step 2: total = 13.50 × 150 = $2,025. Verify ✓. Percentage return = 2,025 / (32 × 150) × 100 = 42.2%. After commission-free trading (now standard at most brokers), the net is close to gross; if held under a year, taxes will take 22–37% of the gain at federal rates. Example 2 — Loss on a speculative position. Buy 500 shares at $18, sell at $12.50 after the stock disappointed. Step 1: per-share loss = 12.50 − 18.00 = −$5.50. Step 2: total = −5.50 × 500 = −$2,750. Verify ✓. Percentage return = −2,750 / 9,000 × 100 ≈ −30.6%. This loss can offset other capital gains for tax purposes — losing trades have a silver lining at tax time. Up to $3,000 per year of net capital loss can also offset ordinary income, with the remainder carried forward indefinitely.

Frequently asked questions

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

Divide the profit (or loss) by the cost basis and multiply by 100. Cost basis = Buy Price × Shares + commissions and fees. For example, a $1,500 profit on a $10,000 position (with $0 commission) is 15%. If you paid commissions, subtract them from the profit first to get net percentage return. Percentage return is essential for comparing trades of different sizes — a $5,000 profit on $50k invested is a 10% return; the same $5,000 profit on $10k invested is 50%. For tax-aware analysis, also compute the after-tax percentage: $5,000 profit at 25% effective tax leaves $3,750 net, which is a 7.5% after-tax return on $50k (or 37.5% on $10k). Always pair dollar profit with percentage return when reviewing trades.

Does this calculator account for commissions, taxes, and fees?

No — it computes only the gross profit from the price change times share count. To get net profit, subtract: (1) Buy commission (typically $0 at major US brokers like Fidelity, Schwab, Robinhood; $5–10 at some specialty brokers); (2) Sell commission (same); (3) SEC fee (~$22.10 per $1,000,000 of sell value); (4) FINRA Trading Activity Fee (small per-share fee, $0.000166 per share, max $8.30 per trade); (5) Foreign tax withholding for ADRs (varies by country); (6) Federal capital gains tax (15–37% depending on holding period and income); (7) State income tax on gains (5–13% in high-tax states). For a typical retail US stock trade, items 1–5 are now negligible (~$1–10 total per trade), so gross ≈ net before tax. Tax is the big one — short-term gains can lose 30%+ to tax, long-term gains lose 15–24% (federal + state).

What are the most common mistakes in tracking stock profit/loss?

The biggest is forgetting to account for cost basis adjustments — dividends reinvested (DRIP) create new lots that change average cost; stock splits multiply share count and divide per-share price; spin-offs allocate basis between the parent and the new company. Modern brokers handle these automatically in the cost-basis report, but problems arise when assets are transferred between brokers. The second is failing to identify the right lot when selling partial positions — FIFO (first-in-first-out) is the default, but specific-lot identification can dramatically improve after-tax outcomes by selling the highest-cost shares first. The third is ignoring wash-sale rules: if you sell at a loss and buy back the same security within 30 days (before or after), the loss is disallowed and added to the new cost basis. The fourth is calculating profit/loss based on order prices rather than actual fill prices, which can differ by significant amounts on illiquid securities. Finally, many investors confuse paper losses (unrealized) with actual losses (realized) for tax purposes — only realized losses count.

When should I NOT use this calculator?

Skip it for trades involving fractional shares — fractional shares (now common at modern brokers) require precise decimal calculations the calculator does not handle elegantly. Avoid it for options trades, which need a separate options P/L calculator that accounts for strike price, premium paid/received, and assignment risk. Do not use it for short sales — the math is inverted (you profit when price falls), and the calculator does not flag this. Skip it for crypto, FX, or futures where contract specifications differ materially. Do not use it for dividend-reinvested positions held long-term, where average cost basis across many DRIP lots requires a much more detailed calculation than a single buy/sell price pair. And do not use it as a substitute for your broker's official tax-reporting (1099-B) which is what the IRS sees; the calculator is for quick sanity checks, not tax preparation.

How does holding period affect the after-tax profit on a stock trade?

Massively. In the US, holding periods determine tax rates. Short-term capital gains (held ≤1 year) are taxed at ordinary income rates up to 37% federal, plus state tax (0–13%). Long-term capital gains (held >1 year and one day) are taxed at preferential rates of 0% (low income), 15% (most middle-class), or 20% (high income), plus the 3.8% Net Investment Income Tax for high earners. The same $10,000 gain held 364 days might cost $3,700 in federal tax (37% short-term rate for a high earner) — versus only $1,500 (15% long-term rate) if held 366 days. That is a $2,200 difference for waiting two extra days. Tax-loss harvesting (selling losers to offset gains) and tax-lot management (selling specific lots to minimize tax) can save thousands per year for active investors. For retirement accounts (IRA, 401k, Roth), holding period does not matter for tax — everything is either tax-deferred or tax-free, which is why frequent trading is much more tax-efficient inside these accounts.

Sources & references