Skip to content
Finance

Stock Profit and Loss Calculator

Enter the number of shares, your buy price, and sell price to instantly see your profit or loss, return on investment, break-even share price, and after-tax gain. You can also include buy and sell commissions and a capital gains tax rate. Toggle short selling to flip the direction for a short trade.

Your details

Long: you buy first and profit when the price rises. Short: you sell first and profit when the price falls.
Fractional shares are supported.
The price per share when you bought (or covered for a short).
The price per share when you sold (or shorted for a short position).
Brokerage fee when buying. Enter a dollar amount or a percentage depending on the type selected.
Brokerage fee when selling. Enter a dollar amount or a percentage.
Apply your short-term or long-term capital gains rate. Leave at 0 to skip tax. Tax only applies when the trade is profitable.
%
Currency
Net profit / lossProfitable trade
$1,500.00

Profit or loss after commissions and tax

Gross profit / loss$1,500.00
Total buy cost$5,000.00
Total sell proceeds$6,500.00
Total commissions$0.00
Capital gains tax$0.00
Return on investment (ROI)30%
Break-even price$50.0000
Total cost$5,000.00
Net proceeds$6,500.00
Net profit / loss$1,500.00
-$4k$750$5k1558100
Sell price per share
  • Net P&L
  • Break-even

This trade returns a net profit of +1500.00 (+30.00% ROI).

  • Gross profit (before fees and tax) is +1500.00.
  • Your break-even price is 50.0000, so the current sell price gives you 15.0000 of cushion above break-even.

Next stepAt this ROI, consider whether reinvesting gains in a diversified position aligns with your portfolio targets.

How to calculate stock profit and loss

The basic formula is: Net Profit = (Sell Price x Shares - Sell Commission) - (Buy Price x Shares + Buy Commission). For a long trade, profit comes from selling above your cost basis. For a short trade, you sell first at a higher price and profit when you buy back at a lower price. Subtracting buy and sell commissions gives your net gain before tax. If the net gain is positive, apply your capital gains tax rate to find the after-tax profit. The break-even price is the sell price at which your profit is exactly zero after commissions, calculated as Buy Price + (Total Commissions / Shares).

Return on investment (ROI) and break-even price

ROI expresses your net profit as a percentage of your total buy cost (including the buy commission). A 15% ROI means you got back $1.15 for every $1.00 invested. The break-even price is more practical: it is the minimum sell price you need to cover all costs and walk away with nothing lost. High commissions raise your break-even price, which is one reason many active traders use flat-fee or commission-free brokers. Even a $5 round-trip commission on a 10-share trade adds $0.50 per share to your break-even, which can easily erase a thin trading edge.

Short selling: how the math is different

In a short trade you borrow shares and sell them first, then buy them back later. Profit comes when the repurchase price is lower than the original sell price. The gross profit is (Sell Price - Buy Price) x Shares, and the break-even price shifts downward: Break-Even = Sell Price - (Total Commissions / Shares). Short selling carries theoretically unlimited risk because a stock price has no ceiling, so losses grow as the price rises above your entry. This calculator handles both directions so you can compare scenarios.

Capital gains tax on stock trades

In the United States, profits from stocks held for one year or less are taxed at your ordinary income rate (up to 37%). Stocks held longer than one year qualify for the preferential long-term capital gains rate of 0%, 15%, or 20% depending on your income. High-income earners may also owe the 3.8% Net Investment Income Tax. If you sell at a loss, capital losses can offset capital gains elsewhere in your portfolio, and excess losses up to $3,000 per year can offset ordinary income. Always consult a tax professional for your specific situation.

Common US capital gains tax rates (2025)

Holding periodTax rate rangeWho it applies to
Short-term (under 1 year) 10% to 37% Taxed as ordinary income
Long-term - 0% 0% Single filers with taxable income up to ~$47,025
Long-term - 15% 15% Most middle-income filers
Long-term - 20% 20% High-income filers (single income over ~$518,900)
Net Investment Income Tax +3.8% MAGI over $200,000 (single) or $250,000 (joint)

Short-term rates apply to assets held 1 year or less. Long-term rates apply to assets held more than 1 year. Rates depend on taxable income and filing status.

Frequently asked questions

How do I calculate stock profit?

Subtract your total buy cost (shares x buy price + buy commission) from your total sell proceeds (shares x sell price - sell commission). The result is your net profit or loss before tax. If a capital gains tax rate applies, multiply your net profit by that rate and deduct the result to get your after-tax gain.

What is the break-even price for a stock?

The break-even price is the exact sell price at which your net profit is zero after all commissions. For a long trade it is: Buy Price + (Total Commissions / Number of Shares). If you sell above this price you profit; below it you take a loss. Knowing your break-even before entering a trade helps you set a realistic minimum price target.

How is ROI calculated for stocks?

ROI = (Net Profit / Total Buy Cost) x 100. Total buy cost includes the purchase price of all shares plus any buy commission. For example, if you spent $5,050 to buy shares (including a $50 commission) and netted $500 profit after selling costs, your ROI is 500 / 5,050 x 100 = 9.9%.

Do commissions really matter if they are small?

Yes, especially for short-term or small trades. A $10 round-trip commission on a $500 trade is already 2% of your capital, meaning the stock must rise 2% just to break even. Over many trades those costs compound. This is why zero-commission brokers have become popular for retail investors, though they may still profit through payment for order flow.

What is the difference between short-term and long-term capital gains?

In the US, profits on stocks held 12 months or less are short-term gains taxed at your ordinary income rate (10% to 37%). Profits on stocks held more than 12 months are long-term gains taxed at 0%, 15%, or 20% depending on your taxable income. The difference can be significant: a high-income investor paying 37% short-term vs 20% long-term keeps 17 cents more per dollar of profit simply by waiting.

Can I use this calculator for short selling?

Yes. Switch the trade type to "Short". In a short trade you sell first and buy back later. The calculator reverses the profit formula so that you profit when the sell price exceeds the buy-back price, and it also recalculates the break-even price accordingly.

Sources

Written by Sarah Klein, CFP Certified Financial Planner · Chicago, USA

Fifteen years translating mortgage tables and amortization schedules into decisions that actually help real borrowers.

How we build & check our calculators

This tool provides general information and education, not professional advice. For decisions about your health or finances, consult a qualified professional.

Search 3,500+ calculators

Loading search…