The Quick Answer
Stock profit is the difference between the selling price and the buying price of shares, minus any transaction costs such as commissions and fees.
The core formulas:
- Dollar Profit = (Sell Price - Buy Price) x Shares - Total Fees
- Percentage Return = ((Sell Price - Buy Price) / Buy Price) x 100
- Total Cost Basis = (Buy Price x Shares) + Buy Commission
- Break-Even Price = Total Cost Basis / Shares
A positive result means a gain. A negative result means a loss. Percentage return allows comparison across investments of different sizes.
Important: This is educational content, not investment or tax advice. Investment decisions and tax matters should be discussed with qualified professionals.
The Basic Profit Formula
Dollar Profit = (Sell Price - Buy Price) x Number of Shares - Total Fees
This formula captures the three components of stock profit:
- Price change -- the difference between what you sold for and what you paid
- Scale -- multiplied by the number of shares
- Costs -- minus any commissions, fees, or transaction costs on both the buy and sell sides
Worked Example 1: Profitable Trade
You buy 50 shares at $42.00 per share with a $5 commission. Later, you sell all 50 shares at $56.50 per share with a $5 commission.
Cost basis:
Cost basis = (50 x $42.00) + $5 = $2,105
Sale proceeds:
Proceeds = (50 x $56.50) - $5 = $2,820
Dollar profit:
Profit = $2,820 - $2,105 = $715
Or equivalently:
Profit = ($56.50 - $42.00) x 50 - $10 = $725 - $10 = $715
Percentage return (on investment):
Return = ($715 / $2,105) x 100 = 34.0%
Percentage return (price only, excluding fees):
Return = (($56.50 - $42.00) / $42.00) x 100 = 34.5%
The stock price rose 34.5%, but your actual return after commissions was 34.0%. With today's zero-commission brokers, the difference may be negligible, but for larger fee structures it matters.
Break-even price (what you need to sell at to not lose money):
Break-even = $2,105 / 50 = $42.10
The $5 buying commission pushed your break-even above the $42.00 purchase price.
Worked Example 2: Unrealized Loss
You buy 100 shares at $85.00 per share. The current price is $68.00. You have not sold.
Unrealized loss = ($68.00 - $85.00) x 100 = -$1,700
Percentage loss = (($68.00 - $85.00) / $85.00) x 100 = -20%
You are down $1,700, or 20%, on paper. This is an unrealized loss -- it becomes realized only when you sell. The stock could recover or decline further.
Here is where the math gets important: to break even, the stock needs to rise from $68 back to $85. That is an increase of $17 on a $68 base:
Recovery needed = ($85 - $68) / $68 x 100 = 25%
A 20% loss requires a 25% gain to recover. This asymmetry is a fundamental property of percentage changes.
The Break-Even Asymmetry
Losses and the gains needed to recover from them are not symmetric. The table below shows this relationship:
| Loss | Gain Needed to Break Even |
|---|---|
| -5% | 5.3% |
| -10% | 11.1% |
| -15% | 17.6% |
| -20% | 25.0% |
| -25% | 33.3% |
| -30% | 42.9% |
| -40% | 66.7% |
| -50% | 100.0% |
| -60% | 150.0% |
| -75% | 300.0% |
| -90% | 900.0% |
The formula for the required recovery gain is:
Recovery Gain = Loss Percentage / (1 - Loss Percentage)
Or equivalently: Recovery Gain = 1 / (1 - Loss Fraction) - 1
For a 30% loss: 0.30 / (1 - 0.30) = 0.30 / 0.70 = 42.9%.
This is why risk management matters. A 50% loss is not twice as bad as a 25% loss in recovery terms -- it requires 100% gain (a full doubling) instead of 33.3%. The deeper the loss, the disproportionately harder it becomes to recover.
Source: This mathematical relationship is documented in SEC investor education materials and standard finance textbooks.
Cost Basis with Multiple Purchases
When you buy shares at different times and prices, you need to calculate an average cost basis.
Example: Three Separate Purchases
| Purchase | Shares | Price | Cost |
|---|---|---|---|
| January | 30 | $40.00 | $1,200 |
| March | 20 | $45.00 | $900 |
| June | 25 | $38.00 | $950 |
| Total | 75 | $3,050 |
Average cost per share:
Average cost = $3,050 / 75 = $40.67
If you sell all 75 shares at $52.00:
Profit = ($52.00 x 75) - $3,050 = $3,900 - $3,050 = $850
Percentage return = ($850 / $3,050) x 100 = 27.9%
Note: For tax purposes, you may use specific identification (choosing which specific shares to sell) rather than average cost. FIFO (first in, first out) is also common. The method affects your tax liability but not your actual economic profit. Consult a tax professional for guidance.
Dollar-Cost Averaging
Dollar-cost averaging (DCA) means investing a fixed dollar amount at regular intervals, regardless of the stock price. This naturally results in buying more shares when prices are low and fewer when prices are high.
Example: $500 Monthly Investment
| Month | Price | Shares Bought |
|---|---|---|
| January | $50.00 | 10.00 |
| February | $45.00 | 11.11 |
| March | $40.00 | 12.50 |
| April | $48.00 | 10.42 |
| May | $55.00 | 9.09 |
| June | $52.00 | 9.62 |
| Total | 62.74 |
Total invested: $3,000. Total shares: 62.74. Average cost per share: $3,000 / 62.74 = $47.82.
The simple average of the six prices is $48.33. Dollar-cost averaging produced a lower average cost ($47.82) because more shares were purchased during the lower-price months.
If the price is $52.00 at the end:
Value = 62.74 x $52.00 = $3,262.48
Profit = $3,262.48 - $3,000 = $262.48
Return = 8.7%
Short Selling: Profit from Falling Prices
In a short sale, you borrow shares and sell them first, then buy them back later (hopefully at a lower price). The profit formula is reversed:
Short Profit = (Sell Price - Buy-to-Cover Price) x Shares - Fees - Borrowing Costs
Example
You short sell 100 shares at $75.00. Later, you buy to cover at $60.00. Borrowing cost was $45.
Profit = ($75.00 - $60.00) x 100 - $45 = $1,500 - $45 = $1,455
Key difference: in a regular long position, your maximum loss is 100% (the stock goes to zero). In a short position, losses are theoretically unlimited because the stock price can rise indefinitely.
Capital Gains Tax Considerations
Stock profits in the United States are subject to capital gains tax. The two categories:
| Holding Period | Tax Type | Federal Rate Range |
|---|---|---|
| One year or less | Short-term capital gains | 10% to 37% (ordinary income rates) |
| More than one year | Long-term capital gains | 0%, 15%, or 20% |
Source: IRS Topic No. 409 -- Capital Gains and Losses
Tax Impact Example
You make a $715 profit on shares held for 8 months. At a 24% marginal tax bracket:
Short-term tax = $715 x 0.24 = $171.60
After-tax profit = $715 - $171.60 = $543.40
If you had held the same shares for over one year and qualified for the 15% long-term rate:
Long-term tax = $715 x 0.15 = $107.25
After-tax profit = $715 - $107.25 = $607.75
Holding for more than one year would save $64.35 in taxes on this trade. For larger gains, the difference is proportionally larger. Tax-loss harvesting -- selling losing positions to offset gains -- is another strategy investors use, but it has rules (like the wash sale rule) that require careful attention.
This is general educational information. Tax situations are individual. Consult a qualified tax professional.
Total Return: Including Dividends
The basic profit formula only captures price changes. For a complete picture, include dividends received:
Total Return = ((Sell Price x Shares) + Dividends - (Buy Price x Shares) - Fees) / ((Buy Price x Shares) + Buy Fees) x 100
Example
You buy 100 shares at $40 and sell at $46 after one year. During that year, you received $1.50 per share in dividends.
Price gain = ($46 - $40) x 100 = $600
Dividends = $1.50 x 100 = $150
Total gain = $600 + $150 = $750
Total return = $750 / $4,000 = 18.75%
Without dividends, the return would be $600 / $4,000 = 15%. Dividends added 3.75 percentage points. Over long holding periods, dividends can represent a substantial portion of total stock market returns. According to S&P Dow Jones Indices, dividends have historically contributed approximately 30-40% of the S&P 500's total return.
Frequently Asked Questions
How do I calculate profit on stocks?
Stock profit = (Sell Price - Buy Price) x Number of Shares - Total Fees. For 100 shares bought at $50 and sold at $65 with $10 in fees: ($65 - $50) x 100 - $10 = $1,490.
Why do I need a bigger percentage gain to recover from a loss?
Because the loss reduces your base. A $100 stock that drops 50% to $50 must double (100% gain) to return to $100. The percentage loss is calculated on the larger original amount, but the recovery is calculated on the smaller post-loss amount.
Are stock profits taxed?
Yes. In the US, shares held one year or less are taxed at short-term rates (10-37%, same as ordinary income). Shares held more than one year qualify for long-term rates (0%, 15%, or 20%). Consult a tax professional for your specific situation.
Does the profit calculation include dividends?
No. The basic formula captures only price appreciation. To include dividends, add them to your total proceeds. Total return = price gain + dividends received - costs.
What is cost basis?
Cost basis is the total amount paid to acquire shares, including the purchase price plus any commissions or fees. It is used to calculate gain or loss when shares are sold.
How do I calculate stock profit with multiple purchases?
Add up the total cost of all purchases and divide by total shares to get average cost per share. Profit = (Sell Price - Average Cost) x Total Shares - Fees. For tax purposes, you may also use FIFO or specific identification methods.
What is the break-even price after buying stock?
Break-even = Total Cost Basis / Number of Shares. If you spent $2,105 (including commission) on 50 shares, break-even is $42.10 per share. The stock must trade above this price for you to profit.
How do stock splits affect profit calculation?
Splits change shares and price proportionally but do not change total value. In a 2-for-1 split, your share count doubles and cost per share halves. Total profit remains: total sale proceeds minus total cost basis.
What is the difference between realized and unrealized profit?
Realized profit is locked in when you sell. Unrealized profit is the paper gain on shares you still hold. Only realized profits are taxable. Unrealized gains can increase or decrease with the market.
How does dollar-cost averaging affect profit?
DCA typically lowers your average cost per share by buying more shares when prices are low and fewer when prices are high. Profit is still calculated as total proceeds minus total cost basis.
Related Tools
- Stock Profit Calculator -- Calculate dollar profit, percentage return, and break-even price for any stock trade
- ROI Calculator -- Calculate return on investment for any type of investment
- Investment Return Calculator -- Calculate ROI, CAGR, and total return including dividends
- Percentage Change Calculator -- Calculate percentage increase or decrease between two values