Education
7 min

How to Calculate Profit and Loss on Any Investment

A complete guide to calculating profit and loss for stocks, crypto, and other investments. Learn the formulas, understand percentages, and factor in fees.

Knowing your exact profit or loss on an investment is fundamental to making good financial decisions. Yet many investors rely on rough mental math or ignore fees entirely. This guide covers the precise formulas and practical considerations for calculating P&L correctly.

The Basic P&L Formula

The core formula is straightforward:

Profit/Loss = (Selling Price - Purchase Price) × Number of Units

As a percentage: P&L % = ((Selling Price - Purchase Price) / Purchase Price) × 100

For example, if you bought 50 shares at $120 and sell at $150: Profit = ($150 - $120) × 50 = $1,500, or a 25% gain.

Factoring In Fees and Commissions

Real-world P&L must account for trading costs. Most brokers charge commissions, spreads, or both. Some platforms charge withdrawal fees or currency conversion fees.

Adjusted P&L = (Sell Price × Units - Sell Fees) - (Buy Price × Units + Buy Fees)

Ignoring fees can make a profitable trade appear better than it is, or even turn a small profit into a loss.

Realized vs Unrealized P&L

Unrealized P&L (paper gains/losses) is the profit or loss on positions you still hold. It changes with every price tick. Realized P&L is locked in when you close a position.

  • Unrealized: You bought BTC at $40,000, it's now $55,000 — you have $15,000 unrealized profit
  • Realized: You sell that BTC at $55,000 — the $15,000 becomes realized profit (and potentially taxable)

Tax Implications

In most jurisdictions, realized gains are taxable. The tax rate often depends on how long you held the asset:

  • Short-term gains (held less than 1 year): Taxed as ordinary income in many countries
  • Long-term gains (held more than 1 year): Often taxed at a lower rate
  • Losses can offset gains: Capital losses can reduce your tax bill by offsetting capital gains

Always consult a tax professional for advice specific to your jurisdiction. Tax laws vary significantly between countries.

Tracking P&L Across Multiple Positions

When you have multiple buy orders at different prices, you need to decide which cost basis method to use:

  • FIFO (First In, First Out): The shares you bought first are sold first
  • LIFO (Last In, First Out): The most recently purchased shares are sold first
  • Average Cost: All shares are treated at the average purchase price

Common P&L Mistakes to Avoid

Even experienced investors make these errors:

  • Ignoring fees and slippage in calculations
  • Using the wrong cost basis method for tax reporting
  • Confusing unrealized and realized gains when assessing performance
  • Not accounting for currency conversion when trading international assets
  • Measuring P&L in percentage only — a 50% gain on $100 is very different from a 50% gain on $100,000

Want to try it yourself?

Go to calculator