Stock Profit & Loss Calculator (2026)

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

Stock Profit Calculator📅 Updated for 2026⚡ Instant results

Formulas and 2026 figures checked & updated: July 2026

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

How to Use the Stock Profit & Loss Calculator

  1. Enter the number of shares you bought and your buy price per share.
  2. Enter any commission or fees paid on the purchase.
  3. Enter the number of shares you sold (or plan to sell) and your sell price per share.
  4. Enter any commission or fees paid on the sale.
  5. Review your cost basis, total proceeds, and gross profit before fees.
  6. Check your net profit or loss and percentage return after fees. Example: 100 shares bought at $40 and sold at $52, with $10 in total commissions, is $1,190 net profit — a 29.75% return.

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.

Six inputs drive the result: your buy price and number of shares purchased, your sell price and number of shares sold, and any commissions paid on the buy and sell sides. Most major US brokerages have offered $0 commissions on online stock and ETF trades since the late 2010s, but fees can still apply to options contracts, mutual funds, over-the-counter stocks, and some smaller or specialty brokerages, so it's worth entering actual costs rather than assuming zero. For trades held over different time periods, pairing this calculator's net profit figure with an annualized return calculation — converting a total gain into an equivalent yearly rate — makes it easier to compare a quick trade against a multi-year holding on equal footing.

Use this calculator right after closing a position to confirm your actual take-home profit once fees are included, before reporting a sale on your tax return, or as a gut-check on whether a trade was genuinely worthwhile once all costs are counted. It's also useful for comparing two potential trades side by side, or for reviewing past trades to see how much commissions and fees have eaten into total returns over time. Because the calculator reports both gross and net figures, it also makes clear how much of a seemingly strong headline gain was actually eroded by trading costs, which matters most on smaller trades or frequent buying and selling.

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.

Key Terms Explained

Cost Basis
What you originally paid for an investment, including fees. Your capital gain is the sale price minus the cost basis.
Capital Gain
The profit when you sell an asset for more than its cost basis. Long-term gains (held over a year) are taxed at lower rates than short-term gains.
Marginal Tax Rate
The tax rate applied to your last dollar of income — your top tax bracket. It's higher than your effective (average) rate.

Continue Your Financial Planning

Learn brokerage account basicsUnderstand taxable accounts, investments, risk, and fees.Understand investment taxesLearn holding periods, capital-gains rates, and cost basis.

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.

How is annualized return calculated for a stock trade?+

Annualized return converts a total gain over any holding period into an equivalent yearly rate, using the formula: Annualized Return = (1 + Total Return)^(1/Years) − 1. For example, a 50% total gain over 3 years annualizes to about 14.5% per year. Annualizing makes it possible to fairly compare a quick trade against a multi-year holding, since a 20% gain in 6 months is a much stronger result than a 20% gain over 5 years.

Do stock trading commissions still exist in 2026?+

Most major US brokerages have offered $0 commissions on online stock and ETF trades since the late 2010s, so many retail investors no longer pay a per-trade fee for standard stock purchases and sales. However, fees can still apply to options contracts, some mutual funds, over-the-counter or foreign stocks, and broker-assisted trades, so it's worth checking your brokerage's fee schedule and entering the actual amount here rather than assuming zero.

How do I calculate return on investment (ROI) for a stock?+

ROI = (Net Profit ÷ Cost Basis) × 100, where net profit is your sale proceeds minus your cost basis (purchase price plus fees). For example, a $2,300 profit on a $4,500 cost basis is a 51.1% ROI. ROI measures your total return over the entire holding period, while annualized return converts that same figure into a yearly rate for comparing trades of different lengths. Both figures are more useful when calculated net of commissions rather than on the raw share-price difference alone.

Can I save my results?+

Yes. Use “Save results” to store a snapshot. Without an account it remains in this browser. If you log in, saved scenarios sync securely to your SmartRates account so they are available on your other devices.

How do I share my calculation?+

Click “Share” in the toolbar to copy a link (or open your device’s share sheet). The link encodes your exact inputs, so whoever opens it sees the calculator pre-filled with the same numbers and the same result.

Can I email my calculator results?+

Yes. Click “Email results” to open your default email application with the current inputs, results, and calculator link already included. Review the message and choose the recipient before sending.

Can I export or print my results as a PDF?+

Yes. Click “Export PDF” to open a clean, printable summary of your inputs and results that you can save as a PDF or print. It includes a timestamp and a link back to the calculator.

How accurate are the calculator results?+

The arithmetic follows the formula and assumptions documented on this page. The result is still an estimate because actual rates, fees, taxes, timing conventions, eligibility rules, and provider calculations can differ. Use figures from your official quote, statement, contract, or tax form before making a financial decision.

Which inputs have the biggest effect on the result?+

Rate, time, starting balance, recurring payments or contributions, and fees usually have the largest effects. Change one input at a time to create a conservative, expected, and optimistic scenario instead of relying on a single forecast.

Are taxes, fees, and inflation included?+

Only when they appear as an input or are explicitly described in the methodology. Do not assume an omitted cost is zero. Review the formula and methodology sections to see exactly what is included before comparing the result with an outside quote.

Can this calculator predict future rates or returns?+

No. A calculator projects the assumptions entered; it cannot predict market returns, inflation, variable interest rates, tax-law changes, or provider decisions. Rerun the calculation with several assumptions to understand the range of possible outcomes.

Why might my lender, bank, broker, or tax software show a different result?+

Professional systems may use daily timing, transaction dates, compounding conventions, rounding rules, account-specific fees, credits, eligibility details, or regulations that a general-purpose calculator cannot know. A small difference can be rounding; a large difference usually means an assumption or included cost is different.

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