Stock Profit/Loss Calculator

Calculate stock profit or loss with commissions and tax estimates. Supports long and short positions with break-even price and ROI.

This stock profit calculator works out exactly how much you made or lost on a trade, factoring in per-trade commissions and an optional capital gains tax estimate. Enter your buy price, sell price, number of shares, and any broker commission to see your net profit, ROI percentage, break-even price, and estimated tax liability for both long and short positions.

Ad

For informational purposes only. Not financial advice. Calculations are estimates and may not reflect your exact situation. Consult a qualified financial adviser for personalised guidance.

Ad

About Stock Profit/Loss Calculator

How the Calculation Works

The calculator follows a straightforward sequence: work out gross profit from the price difference, subtract commissions from both sides of the trade, then optionally apply a capital gains tax rate to the profit.

StepLong PositionShort Position
Cost basisBuy price x Shares + CommissionShort price x Shares + Commission
RevenueSell price x Shares - CommissionCover price x Shares - Commission
Gross profitRevenue - Cost basisRevenue - Cost basis
Tax estimateGross profit x Tax rate (if profitable)Same
Net profitGross profit - TaxGross profit - Tax
ROINet profit / Cost basis x 100Net profit / Cost basis x 100

Long position formula: Net Profit = (Sell Price - Buy Price) x Shares - (2 x Commission)

Short position formula: Net Profit = (Short Price - Cover Price) x Shares - (2 x Commission)

ROI is calculated against the cost basis (total cost plus one side of commission), which gives a realistic picture of the return on the money you actually put into the trade.

Worked Examples

Here are four sample trades showing how the numbers work. The "Net Profit" column accounts for commissions on both the buy and sell side.

TradeEntryExitSharesCommissionNet ProfitROI
AAPL long$150$185100$0$3,50023.3%
TSLA long$250$22050$5-$1,510-12.1%
MSFT long$300$37520$10$1,48024.6%
GME short$100$80200$10$3,98019.9%

AAPL walkthrough: You buy 100 shares at $150 ($15,000 total) and sell at $185 ($18,500 total). With zero commission, gross profit is $18,500 - $15,000 = $3,500. Cost basis is $15,000, so ROI = $3,500 / $15,000 x 100 = 23.3%.

GME short walkthrough: You short 200 shares at $100 ($20,000 proceeds) and cover at $80 ($16,000 cost). Gross profit is $4,000, minus $20 in round-trip commissions = $3,980 net. Cost basis is $20,010, so ROI = $3,980 / $20,010 x 100 = 19.9%.

How Commissions Affect Returns

Even small per-trade commissions eat into returns, and the effect is proportionally larger on smaller positions. A $5 commission on a $1,000 trade costs 1% round-trip, but the same fee on a $50,000 trade is just 0.02%.

Trade SizeCommission (per side)Total CommissionsCommission as % of Trade
$1,000$5$101.0%
$5,000$5$100.2%
$10,000$5$100.1%
$50,000$5$100.02%
$1,000$0$00% (commission-free)

Most major US brokers now offer commission-free stock and ETF trades. Fidelity, Charles Schwab, and Robinhood all charge $0 per trade for listed stocks as of 2026 (source: NerdWallet broker comparison). UK brokers like Trading 212 and Freetrade also offer zero-commission equity trades. If your broker charges nothing, leave the commission field at $0.

Capital Gains Tax Rates (2026)

The calculator defaults to 15%, which matches the US long-term capital gains rate for most income levels. You can adjust this to match your country and tax situation. Here are the rates as of the 2026 tax year:

Country / SituationRateDetails
US long-term (12+ months)0%, 15%, or 20%0% up to $49,450 single / $98,900 MFJ; 15% up to $545,500 single; 20% above
US short-term (under 12 months)10-37%Taxed as ordinary income at your marginal rate
US NIIT surcharge+3.8%Net investment income tax applies above $200K single / $250K MFJ
UK CGT (2026/27)18% or 24%18% for basic-rate taxpayers, 24% for higher/additional rate. £3,000 annual exempt amount
ISA / Roth IRA / TFSA0%Tax-sheltered accounts pay no capital gains tax

US long-term thresholds are from the IRS inflation-adjusted brackets for 2026 (source: Tax Foundation). UK rates are from HMRC for the 2026/27 tax year starting April 2026 (source: gov.uk). The £3,000 UK annual exempt amount is the lowest it has been in over two decades, reduced from £12,300 in 2022/23.

This calculator gives a rough estimate only. Actual tax depends on your total income, other gains and losses, holding period, and jurisdiction. For a detailed UK capital gains breakdown, try the Capital Gains Tax Calculator.

What Is the Break-Even Price?

The break-even price is the exit price at which your trade produces exactly zero profit after commissions. For a long position:

Break-even = Buy Price + (Total Commissions / Shares)

For a short position:

Break-even = Short Price - (Total Commissions / Shares)

If you buy 100 shares at $50 with a $5 commission per trade ($10 total), your break-even sell price is $50 + ($10 / 100) = $50.10. You need the stock to move at least $0.10 above your buy price just to cover costs. With commission-free brokers, break-even is simply your entry price.

Long vs Short Positions

A long position means buying shares first and selling later. You profit when the price goes up. A short position means borrowing and selling shares first, then buying them back (covering) at a lower price. Short sellers profit when prices fall.

Position TypeProfits WhenMax LossCommon Use
LongPrice goes upLimited to investment (stock goes to $0)Standard stock ownership, bullish outlook
ShortPrice goes downTheoretically unlimited (price can rise indefinitely)Bearish bets, hedging a long portfolio

Short selling carries higher risk because a stock's price can rise without limit, meaning losses on a short position are theoretically uncapped. Most brokers require a margin account for short selling and charge stock borrow fees that can range from under 1% annually for liquid large-caps to over 50% for hard-to-borrow stocks. A short interest ratio above 10% of a stock's float is generally considered high (source: FINRA).

What Is a Good Return on a Stock Trade?

Context matters. The S&P 500 has returned an average of about 10% per year over the past century, including dividends reinvested (source: Macrotrends historical data through February 2026). Over the most recent 10-year period, that average was closer to 15.6% annually due to a strong bull market in US tech stocks.

A single trade that returns 5-10% in a few weeks is strong by any benchmark. Day traders often target smaller moves of 1-3% per trade but aim to repeat them frequently. Long-term investors holding for years generally measure against the S&P 500 or their local index as a baseline. If your stock trades consistently beat the index average, you are doing well. If not, a low-cost index fund would have delivered better results with less effort.

To measure the annualised growth rate of a position held over months or years rather than a single trade's flat return, use the CAGR Calculator.

Common Mistakes When Calculating Stock Profit

Forgetting commissions on both sides. A commission applies when you buy and again when you sell. If your broker charges $5 per trade, the round-trip cost is $10, not $5. This calculator applies the commission to both legs automatically.

Confusing gross and net profit. Gross profit is just the price difference times shares. Net profit subtracts commissions (and tax if applicable). Always use net profit when evaluating how a trade actually performed.

Ignoring the spread. The bid-ask spread is an invisible cost that this calculator does not model. If a stock has a bid of $49.95 and an ask of $50.05, you lose $0.10 per share the moment you enter. Illiquid stocks with wide spreads can significantly reduce real returns.

Using the wrong tax rate. In the US, holding a stock for over 12 months qualifies for long-term capital gains rates (0-20%), while selling before that triggers short-term rates (10-37%). The difference can be substantial. A trader in the 32% income bracket who sells after 11 months pays nearly double the tax compared to waiting one more month.

Not accounting for dividends. This calculator covers buy/sell price profit only. If the stock paid dividends while you held it, your total return is higher than what the calculator shows. For dividend-paying stocks, add any dividends received to your net profit for the full picture. Dividend income is taxed separately at its own rates - use the Dividend Yield Calculator to estimate that component.

Wash Sale Rules (US) and Bed and Breakfasting (UK)

If you sell a stock at a loss, you might plan to use that loss to offset gains and reduce your tax bill. But there are rules against repurchasing the same stock too quickly.

In the US, the IRS wash sale rule disallows a capital loss deduction if you buy the same or a "substantially identical" security within 30 days before or after the sale (source: IRS Publication 550). The loss is not permanently lost - it gets added to the cost basis of the replacement shares - but you cannot claim it in the current tax year.

In the UK, the "bed and breakfasting" rule under HMRC's share matching rules means that if you sell shares and repurchase the same shares within 30 days, the sale is matched against the repurchase for CGT purposes. The effect is similar: you cannot crystallise a loss while maintaining your position.

If you are selling at a loss specifically to harvest the tax benefit, wait at least 31 days before repurchasing, or buy a similar but not identical investment in the meantime. Many investors use this strategy at year-end to offset realised gains from other trades, reducing their overall tax bill for the year.

For crypto trades with exchange fee percentages instead of flat commissions, use the Crypto Profit Calculator. To compare the risk-to-reward ratio before entering a trade, the Risk-Reward Calculator helps set profit targets and stop losses. Everything runs in your browser with no data sent anywhere.

Sources

Frequently Asked Questions

How is stock profit calculated?

For a long position, profit equals (sell price minus buy price) times the number of shares, minus total commissions. For a short position, profit equals (short price minus cover price) times shares, minus commissions. The calculator handles both automatically.

What is the difference between long and short?

A long position means you buy shares expecting the price to rise, then sell at a higher price for profit. A short position means you borrow and sell shares expecting the price to fall, then buy them back at a lower price. Short sellers profit when prices drop.

How is the break-even price calculated?

The break-even price is the price at which your trade produces zero profit after accounting for commissions. For long positions it is the buy price plus total commissions divided by shares. For short positions it is the short price minus total commissions divided by shares.

Is the tax estimate accurate?

The tax estimate is a rough calculation based on the capital gains rate you enter. Actual taxes depend on your income, how long you held the position, your country's tax laws, and other factors. Use it as a quick approximation, not tax advice.

Why include commissions in the calculation?

Even small per-trade commissions add up over time and directly reduce your returns. The calculator applies the commission to both the buy and sell side, giving you a realistic view of your actual profit. Many brokers now offer zero-commission trades, in which case just leave it at 0.

Link to this tool

Copy this HTML to link to this tool from your website or blog.

<a href="https://toolboxkit.io/tools/stock-profit-calculator/" title="Stock Profit/Loss Calculator - Free Online Tool">Try Stock Profit/Loss Calculator on ToolboxKit.io</a>