Stock Profit Calculator
Calculate a stock trade’s net profit or loss after flat purchase and sale fees, its return on total purchase cost, and its break-even sale price. Fractional shares are supported, and a zero-cost purchase is reported honestly without inventing a percentage return.
By Dr. Hassan Khames EliwaLast updated
Result
- Return on purchase cost
- 24.31%
- Total purchase cost
- $4,010.00
- Net sale proceeds
- $4,985.00
- Break-even sale price per share
- $40.2500
How it works
Build the purchase cost and sale proceeds
Enter purchase and sale prices per share in the same currency, along with the number of shares traded. Total purchase cost = purchase price × shares + purchase fee. Net sale proceeds = sale price × shares − sale fee. Net profit = net sale proceeds − total purchase cost. Fees are totals for each side of the trade, not per-share amounts or percentages.
Return on purchase cost = net profit ÷ total purchase cost × 100. That denominator includes the purchase fee because the fee is part of the money committed to acquiring the position. The sale fee reduces proceeds rather than increasing the initial investment. Negative profit means a loss; a negative sale proceed is possible if the sale fee exceeds gross proceeds.
Find the sale price that covers both fees
Break-even sale price = [purchase price × shares + purchase fee + sale fee] ÷ shares. At that price, gross sale proceeds exactly cover original purchase cost and the assumed sale fee. The displayed threshold uses four decimal places, while money totals use two. An exchange's tick size can require rounding the threshold upward before submitting an order; the calculator does not know the venue's permitted increments.
Shares must be greater than zero, but need not be whole numbers because many brokers offer fractional trading. Prices and flat fees may be zero. All entered numeric amounts are capped at one trillion and must be finite. A zero purchase price with a positive purchase fee still produces a valid return on that fee-inclusive cost. If both purchase price and purchase fee are zero, the absolute gain is meaningful but the return percentage is undefined.
Keep the scope to one matched position
This tool treats the stated shares as one position bought and sold at the stated average prices. It does not select tax lots, calculate wash-sale adjustments, apply capital-gains tax, or reconcile broker statements. Multiple fills can be summarized using quantity-weighted average prices and actual total fees when the same share quantity is matched on both sides.
Dividends, withholding, financing costs, currency conversion, slippage, and corporate actions are outside the formula unless deliberately incorporated into suitably adjusted inputs. That adjustment requires care: a stock split changes price and share count together, while dividends are separate cash flows. For a broader investment comparison, use the ROI calculator after assembling the full cash-flow picture. This trade return is not annualized because no holding period is requested.
Worked example
Example 1: profitable sale with two fees
Buy 100 shares at $40 and pay a $10 purchase fee. Purchase cost is $4,010. Sell at $50 with a $15 sale fee, producing $4,985 net proceeds. Net profit is $975 and return is 24.31%, rounded from $975 ÷ $4,010 × 100. The break-even sale price is ($4,010 + $15) ÷ 100 = $40.2500 per share.
Example 2: fractional position with a loss
Buy 2.5 shares at $100, pay a $2 purchase fee, then sell at $90 with a $3 sale fee. Cost is $252 and net proceeds are $222. Profit is −$30, so return is −11.90%. Break-even price is ($252 + $3) ÷ 2.5 = $102.0000. Both examples exclude taxes, dividends, and currency movements.
Expert tips
Common mistakes
- Entering a per-share commission as the total fee understates costs whenever more than one share is traded.
- Using gross sale proceeds as profit forgets the original purchase cost and makes every sale look profitable.
- Comparing this holding-period return directly with an annual yield ignores how long the capital was invested.
For education, not financial advice. Results are estimates based on the inputs you give. Lenders, tax authorities and advisers may use different rules, fees and rounding. Check the numbers with a qualified professional before you commit to anything.
Frequently asked questions
Can fractional shares be used?
Yes. Any positive finite share quantity within the input limit is accepted, including quantities below one. Zero or negative shares are rejected because this model is not a short-sale calculator.
Are dividends included?
No. The result covers only the stated purchase and sale. Add dividend cash flows in a broader total-return analysis, with appropriate treatment of reinvested shares and taxes.
Is the return annualized?
No. It is the percentage gain or loss over the entire trade. Annualization requires dates or a holding period and a separate convention for converting that period into years.
Why is return undefined for free shares?
When purchase price and purchase fee are both zero, the denominator is zero. The calculator can still show proceeds and profit, but no finite percentage expresses return on zero purchase cost.
Does break-even include taxes?
No. It covers only the entered prices, shares, and flat fees. Taxes depend on jurisdiction, gains elsewhere, holding periods, allowances, and individual circumstances.
Can net proceeds be negative?
Yes, if the sale fee exceeds gross sale value. This preserves the stated cash-flow arithmetic rather than silently flooring proceeds at zero; confirm unusual charges against the broker statement.
Related calculators
Related guides
FinancialCompound interest: three real savings scenariosThree practical savings examples show what comes from your deposits, what comes from growth, and which assumptions deserve scrutiny.14 November 2026 · 7 min read
MathPercentages people get wrong: change, difference and pointsThe denominator determines the answer. Learn to distinguish percentage change, symmetric difference and percentage-point movements.14 November 2026 · 7 min readSources and standards
About the author
Dr. Hassan Khames Eliwa holds a PhD in Construction & Built Environment and has more than 20 years of international project controls experience. He is Director of Eliwa Project Controls Limited in Auckland and founder of PMMilestone.org and PMMilestone.com.
Buy me a coffee