Stock Profit/Loss Calculator
Buy price, sell price, share count, commissions. Put those four numbers in and the calculator returns your profit or loss in dollars, the percentage gain or loss, and the net proceeds after costs.
Updated
Educational purposes only.
This calculator is for educational purposes only. It does not account for taxes, dividends, or stock splits. Actual trading results may differ.
Educational purposes only. These calculators illustrate concepts and do not constitute investment advice. Read our disclaimer
StockCram is not a broker-dealer, investment adviser, or financial institution. All content is for educational and informational purposes only and should not be construed as personalized investment advice. Consult a qualified financial professional before making investment decisions. Past performance does not guarantee future results.Embed this calculator on your site
Free to use on any site, including in a classroom. Please keep the attribution link.
<iframe
src="https://www.stockcram.com/embed/calculators/stock-profit-calculator"
title="Stock Profit/Loss Calculator"
width="100%"
height="720"
style="border:1px solid #e5e7eb;border-radius:12px;max-width:100%"
loading="lazy"
></iframe>
<p style="font-size:12px">
<a href="https://www.stockcram.com/tools/calculators/stock-profit-calculator" target="_blank" rel="noopener">Stock Profit/Loss Calculator</a>
by <a href="https://www.stockcram.com" target="_blank" rel="noopener">StockCram</a>
</p>What is Stock Profit/Loss?
Stock profit is the difference between sale proceeds and total cost, after commissions on both sides. Expressing it as a percentage of the amount invested rather than as a dollar figure is what makes trades of different sizes comparable.
The formula
Profit = (sell price × shares − sell costs) − (buy price × shares + buy costs)- shares = number of shares transacted
- buy costs / sell costs = commissions and fees on each side
- Return % = profit ÷ total cost basis × 100
100 shares bought at $50 cost $5,000. Sold at $65 they bring in $6,500, so the profit is $1,500 and the return is 1,500 ÷ 5,000 = 30%. Add $5 commissions on each side and the basis becomes $5,005 against $6,495 of net proceeds: $1,490 profit, a 29.8% return. Commissions matter far more on small positions than large ones.
What trading actually costs now
Commission structures changed sharply in October 2019. Schwab announced $0 online US stock and ETF trades on October 1, effective October 7; TD Ameritrade followed on the 3rd, E*TRADE on the 7th and Fidelity on the 10th. For ordinary share transactions the commission term in the formula is now usually zero.
Other costs did not disappear. Options are still charged per contract: $0.65 at Schwab, Fidelity and E*TRADE on their published 2026 schedules, with lower tiers at some brokers for high-volume accounts. Regulatory fees apply on sales. And the bid-ask spread is a real cost on every trade that never appears on a statement: buying at the ask and selling at the bid means a position starts slightly underwater even when the quoted price has not moved.
Cost basis and which shares you sold
Cost basis is the purchase price plus any commissions, and it determines the taxable gain. When shares of the same stock were bought at different prices, the basis depends on which of them are treated as sold.
The default at most US brokers is first-in, first-out: the oldest shares go first. Specific identification lets the seller nominate particular lots instead, which changes both the reported gain and its holding period. The method has to be chosen at or before the sale, not afterwards.
| Method | Shares sold | Basis | Gain |
|---|---|---|---|
| FIFO | 100 from the $40 lot | $4,000 | $2,000 |
| Specific ID | 100 from the $55 lot | $5,500 | $500 |
Hypothetical lots. The proceeds are identical; only the basis, and therefore the taxable gain, differ.
Holding period changes the tax treatment
A position held for more than one year before sale is treated as long-term; one year or less is short-term, measured from the day after purchase to the day of sale. Short-term gains are taxed as ordinary income, while long-term gains fall under a separate and generally lower rate schedule. A pre-tax profit figure does not reflect that boundary at all, so the same dollar gain can be worth noticeably different amounts after tax.
Price return is not total return
What this page produces is a price return. Dividends received while the shares were held sit outside the calculation entirely, so for a dividend-paying stock the result understates what the position actually returned. Total return adds distributions to the price change, and the two measures drift further apart the longer a position is held. Reinvested dividends complicate the other side of the ledger too, since each reinvestment buys shares at its own price and adds to the cost basis, which changes the taxable gain on a later sale.
What this calculator does not account for
- StockCram is not affiliated with, endorsed by, or sponsored by any brokerage mentioned on this page. Fee figures are the brokers' own published schedules and change without notice.
- All shares are treated as one lot bought at a single price. Multiple purchases at different prices need a blended basis.
- Taxes are not deducted. The result is a pre-tax figure, and short-term and long-term gains are taxed differently.
- The bid-ask spread is excluded, which understates the cost of entering and exiting.
- Dividends received while holding are not included in the return.
- Wash sale adjustments, currency effects and margin interest are all outside the calculation.
Once the pre-tax number here is settled, the capital gains tax calculator picks it up and applies the holding-period rules to estimate what is left of it. Capital Gains Tax Calculator
How It Works
Enter your buy price
The price per share when you purchased the stock.
Enter your sell price
The price per share when you sold (or plan to sell) the stock.
Enter the number of shares
How many shares were involved in the trade.
Add commissions (optional)
Include any buy or sell commissions to see net proceeds.
See your profit or loss
View total P/L, percentage return, and full cost breakdown.
Frequently Asked Questions
Stock profit or loss is calculated by subtracting your total cost (buy price × shares + buy commission) from your total proceeds (sell price × shares - sell commission). If the result is positive, you made a profit. If negative, you incurred a loss. The percentage return is your profit or loss divided by your total cost, multiplied by 100.
Gross proceeds are the total amount you receive from selling shares (sell price × shares) before any deductions. Net proceeds subtract commissions and fees from the gross proceeds. Your actual profit or loss is based on net proceeds minus your total cost, so commissions reduce your real return.
Many major brokers now offer commission-free trading for stocks and ETFs, making commissions less of a factor for typical trades. However, commissions still apply for options, bonds, and certain brokers. For frequent traders or large positions, even small per-trade fees can add up significantly over time.
Returns vary widely depending on the holding period, risk level, and market conditions. The S&P 500 has historically returned roughly 10% per year on average. Individual stock trades can produce much higher or lower returns. Short-term trades carry more risk and variability than long-term investments.
Your cost basis is typically the purchase price per share plus any commissions or fees paid to acquire the stock. If you bought shares at different times, you may use specific identification, FIFO (first in, first out), or average cost methods. Cost basis determines your taxable capital gain or loss when you sell.
Realized gains or losses occur when you actually sell a stock. The profit or loss becomes "real" and may be subject to taxes. Unrealized gains or losses are paper gains — the value of your holdings has changed but you have not yet sold, so no taxable event has occurred.
This calculator shows your gross profit or loss and factors in trading commissions, but does not calculate taxes. Capital gains taxes depend on your holding period (short-term vs long-term), tax bracket, and filing status. Use our Capital Gains Tax Calculator for tax estimation.