Enter the stock profit ($) and the stock purchase price ($) into the Stock Margin Calculator. The calculator will evaluate and display the Stock Margin. 

Stock Margin Calculator

Enter any 2 values to calculate the missing variable


Related Calculators

How to Calculate Stock Margin

This calculator expresses your stock profit or loss as a percentage of the original purchase price. On this page, “stock margin” is the return relative to cost basis, which makes it useful for comparing trades of different sizes on the same scale.

Stock Margin Formula

STM = \frac{SP}{PP} \times 100
Variable Meaning
STM Stock margin as a percentage
SP Stock profit in dollars
PP Original stock purchase price in dollars

If you are solving for a different missing value, these rearranged forms are helpful:

SP = \frac{STM \times PP}{100}
PP = \frac{SP \times 100}{STM}

Using the Calculator

  1. Enter the stock profit in dollars. Use a negative value if the position is at a loss.
  2. Enter the stock purchase price in dollars.
  3. Read the result as the percentage gain or loss on your original cost.

If you know the buy and sell values but not the profit, calculate profit first:

SP = SV + D - PP - C

SV is the sale value, D is dividends received, and C is commissions or fees. If you want a cleaner net-performance figure, include all trading costs in the profit calculation before using the calculator.

How to Interpret the Result

Stock Margin What It Means
-20% You lost $0.20 for every $1.00 originally invested.
0% You broke even before any taxes not already included in profit.
15% You earned $0.15 for every $1.00 originally invested.
100% Your profit equaled your full original purchase price.
Above 100% Your profit exceeded the original amount invested.

Quick Reference Examples

Profit Purchase Price Stock Margin Interpretation
$150 $1,000 15% Positive return on the position
-$80 $400 -20% Capital loss relative to cost basis
$500 $375 133.33% Profit is larger than the original amount invested

Common Mistakes to Avoid

  • Using the sale price as the denominator instead of the purchase price.
  • Mixing per-share values with total position values. Keep both inputs on the same basis.
  • Forgetting to enter losses as negative profit.
  • Ignoring fees, commissions, or dividends when estimating true net performance.
  • Confusing this metric with brokerage margin borrowing; this calculator measures return on cost, not leverage requirements.

When This Metric Is Most Useful

  • Comparing multiple stock trades with different dollar sizes
  • Checking whether a position met a target return
  • Reviewing realized gains after a sale
  • Estimating unrealized performance on a current holding

Tip: A purchase price of zero makes the percentage undefined, so the calculator should only be used when the original cost basis is greater than zero.