Categories
Stock Profit & Loss Basics

How to Calculate Stock Profit and Loss Like a Pro (With Real Examples)

Every investor wants to know one thing before anything else: am I actually making money? It sounds like a simple question, but calculating true stock profit and loss is more nuanced than most beginners realize. The price you bought at and the price you sold at are just the starting point. Broker commissions, transaction fees, and taxes all chip away at your returns, and ignoring them gives you a dangerously optimistic view of how well your investments are performing.

This guide walks you through exactly how to calculate stock profit and loss the right way — with clear formulas, step-by-step examples, and the mistakes most beginners make that silently cost them money. By the end of this article, you will be able to calculate your real net return on any stock position in under two minutes.

The Basic Stock Profit Formula

At its most fundamental level, stock profit or loss is calculated as follows:

Gross Profit / Loss = (Selling Price − Buying Price) × Number of Shares

For example, if you bought 100 shares of a company at $25 per share and sold them at $35 per share:

  • Gross Profit = ($35 − $25) × 100 = $1,000

Simple enough. But this is your gross profit — the number before fees and taxes enter the picture. Your actual net return is always lower than this figure, and sometimes significantly so.

Factoring In Broker Commissions: The Real Net Profit Formula

Broker commissions are deducted twice in every trade — once when you buy and once when you sell. This means your actual cost of buying is higher than the share price alone, and your actual proceeds from selling are lower than the sale price alone.

Total Buy Cost = (Buying Price × Shares) + Buying Commission
Total Sell Proceeds = (Selling Price × Shares) − Selling Commission
Net Profit / Loss = Total Sell Proceeds − Total Buy Cost

Let’s apply this to a real example. You buy 100 shares at $25 with a $10 buying commission, and sell at $35 with a $10 selling commission:

  • Total Buy Cost = (100 × $25) + $10 = $2,510
  • Total Sell Proceeds = (100 × $35) − $10 = $3,490
  • Net Profit = $3,490 − $2,510 = $980

Your gross profit was $1,000 but your net profit after commissions is $980. In this case the difference is modest. But when you are trading smaller amounts or stocks with tight margins, commissions can eat a much larger percentage of your returns. This is exactly why understanding how broker fees affect your profits matters so much — something we cover in depth in our guide on Buying Commission vs Selling Commission: How Broker Fees Eat Your Stock Profits.

Calculating Percentage Return: The Number That Actually Matters

Dollar profit is informative but percentage return is what lets you compare investments meaningfully. A $500 profit on a $1,000 investment is dramatically different from a $500 profit on a $50,000 investment.

Return Percentage = (Net Profit / Total Buy Cost) × 100

Using our example above:

  • Return % = ($980 / $2,510) × 100 = 39.04%

This percentage is what you should compare across investments to evaluate performance fairly. Two investments that both generated $500 in profit are not equally good if one required twice the capital to achieve that result. For a full explanation of how to use percentage return to evaluate your investments, see our article on What Is ROI in Stocks and How to Use It to Compare Investments.

Calculating a Stock Loss: The Same Formula, Negative Result

The formula works identically for losses. If you bought 100 shares at $40 with a $10 commission and sold at $28 with a $10 commission:

  • Total Buy Cost = (100 × $40) + $10 = $4,010
  • Total Sell Proceeds = (100 × $28) − $10 = $2,790
  • Net Loss = $2,790 − $4,010 = −$1,220
  • Return % = (−$1,220 / $4,010) × 100 = −30.42%

A 30.42% loss on this position. Understanding your exact loss percentage is critical because it tells you how much you need to gain just to break even on your remaining capital. A 30% loss requires a 43% gain to recover — which is why managing losses carefully is so important in stock investing.

What Is Break-Even and Why Does It Matter in Profit Calculations?

Your break-even price is the exact selling price at which your profit and loss is exactly zero — after all commissions are accounted for. Knowing your break-even point before you sell is essential for setting realistic price targets.

Break-Even Price = (Total Buy Cost + Selling Commission) / Number of Shares

If your total buy cost is $2,510 (including buying commission) and your selling commission will be $10 on 100 shares:

  • Break-Even Price = ($2,510 + $10) / 100 = $25.20

So even though you bought the shares at $25, you need to sell at $25.20 just to break even after paying both commissions. For a detailed walkthrough of break-even calculations and how to use them strategically, read our complete guide: What Is Break-Even Price in Stocks and How to Calculate It Instantly.

Real Example 1: A Profitable Trade Fully Calculated

Let us walk through a complete real-world example from start to finish.

Scenario: You buy 200 shares of XYZ Corp at $18.50 per share. Your broker charges a flat $7.99 commission per trade. Three months later, XYZ rises to $24.00 and you sell all 200 shares.

  • Total Buy Cost = (200 × $18.50) + $7.99 = $3,707.99
  • Total Sell Proceeds = (200 × $24.00) − $7.99 = $4,792.01
  • Net Profit = $4,792.01 − $3,707.99 = $1,084.02
  • Return % = ($1,084.02 / $3,707.99) × 100 = 29.23%
  • Break-Even Price = ($3,707.99 + $7.99) / 200 = $18.58

A clean 29.23% net return in three months. Not every trade looks this good, but the calculation process is always the same.

Real Example 2: A Trade That Looks Profitable But Is Not

Scenario: You buy 50 shares of ABC Inc at $10.00 per share. Your broker charges a flat $15 commission per trade. You sell at $11.20.

  • Total Buy Cost = (50 × $10.00) + $15 = $515
  • Total Sell Proceeds = (50 × $11.20) − $15 = $545
  • Net Profit = $545 − $515 = $30
  • Return % = ($30 / $515) × 100 = 5.83%

The stock rose 12% but your net return was only 5.83% after commissions. This is why commission impact matters most when trading small positions or stocks with low percentage gains. A higher broker fee on a small trade can cut your real return in half or more.

The Mistake Most Beginners Make: Ignoring Cost Basis

Many beginner investors calculate profit based on price difference alone and forget to include commissions in their total cost basis. This leads to an inflated view of performance that causes poor decisions — holding losing positions too long because the math seems more favorable than it really is, or celebrating gains that are largely eaten up by fees.

Cost basis is your true all-in cost per share: Cost Basis Per Share = Total Buy Cost / Number of Shares. This is especially important when you have bought the same stock at multiple prices — a situation called averaging. For a complete explanation of how to handle multi-price purchases and calculate your correct cost basis, see our article: How to Calculate Average Stock Price When You Buy at Different Prices.

Using a Stock Profit Calculator to Do This Instantly

The formulas above are straightforward, but manually calculating them for every trade is tedious and error-prone. A dedicated stock profit calculator handles all of this automatically — you input your buy price, sell price, number of shares, and commissions, and it instantly outputs your gross profit, net profit, percentage return, and break-even price.

StockCalculator.us offers free tools designed exactly for this purpose. For a guide to the full range of calculator tools available and how to use each one effectively, see our article: Top 5 Free Stock Calculators Every Trader Needs in 2025.

How Profit and Loss Calculations Connect to Position Sizing

Understanding your profit and loss calculation is also essential for deciding how many shares to buy in the first place. If you know your maximum acceptable loss on any trade is 2% of your portfolio, you can work backwards from that limit to calculate the maximum number of shares you should buy at a given price with a given stop-loss level.

This approach — called position sizing — is one of the most important risk management concepts for any investor at any experience level. We cover it in complete detail in our guide: How Many Shares Should You Buy? A Simple Guide to Position Sizing for Beginners.

Tax Implications: What Happens After You Calculate Your Profit

Once you have calculated your net profit, there is one more step before you know what you actually keep: capital gains tax. Depending on how long you held the stock, you will owe either short-term or long-term capital gains tax on your profit. The holding period and your total income level both affect the tax rate you pay.

For a complete step-by-step guide to calculating what you owe on your stock profits, read our dedicated article: How to Calculate Capital Gains Tax on Stock Profits — A Simple Step-by-Step Guide.