Tool 17

Stock market calculators · Closed-trade cash accounting and explicit charges

Stock Profit and Loss Calculator

Calculate a closed long-only trade’s net profit, return on upfront purchase outlay and fixed-charge break-even. See gross and net cash components separately.

One homogeneous quantity, one major currency and explicit buy/sell charges. No tax, dividends, partial-sale matching, leverage, FX or personalized investment advice.

Preparing calculator…

Trade values and actions

One closed long-only trade

Use consistent major currency and share units. No tax, dividends, short sales, leverage, partial sales or currency conversion.

Formatting only. GBP means pounds, not GBX/pence. Values are never converted.

Positive quantity, including fractional shares; same security and share units.

Positive major-currency price before the separately entered buy charge.

Zero is allowed; price before the separately entered sell charge.

Total monetary charge, not a percentage or per-share fee. Enter 0 explicitly if none.

Total monetary charge. Do not enter a charge already embedded in the price twice.

Trade cash accounting

Enter all five values and confirm the basis, or load the verified worked example.

Inputs stay in browser memory. Up to 12 fractional places; quantity and purchase price 0.000000000001–1000000000000, other amounts 0–1000000000000. Isolated 120-digit decimal arithmetic; half-even display rounding. Small nonzero amounts remain visible. Educational use, not personalized investment advice.

Understand the trade cash ledger

Charges can turn a price gain into a net loss. Understand the denominator, additional closing payments and the limits of a rounded break-even price.

Read the complete Stock Profit and Loss guide

Formula and methodology

C = q×b + fb; N = q×s − fs.
P = q×(s−b) − fb − fs; return = 100P/C.
Fixed-charge break-even = (C+fs)/q.

B = q×b; C = B+fb; S = q×s; N = S−fs; G = q×(s−b); P = G−fb−fs; return = 100P/C; fixed-charge break-even = (C+fs)/q. C is the positive upfront purchase outlay. Selling charges reduce net proceeds once; they are not also added to C. Profit is computed directly from the price difference and charges, preserving small gains or losses beside large cash totals. The percentage is a simple holding-period accounting return, with no annualisation, dates or reinvestment.

Verified worked examples

Buy 10 shares at 100, pay a buy charge of 2, then sell all 10 at 120 with a sale charge of 3. Purchase consideration is 1000, upfront outlay 1002, gross proceeds 1200 and net proceeds 1197. Gross price gain is 200; net profit is 195. Return is 195/1002×100 = 19.4610778443…%, displayed as 19.461078%. Fixed-charge break-even is (1002+3)/10 = 100.50 per share. If the sale price were 80, net profit would be −205, not −200.

Inputs and interpretation

Choose a display market without changing currency units. Enter the full quantity, purchase price, sale price, and explicit total buy/sell charges; enter 0 for each absent charge. Confirm the consistent closed-trade basis. Calculate, inspect every cash component and the named denominator, and reconcile with your own records. Load the verified example or clear values to start again. Do not double-count a charge already embedded in a supplied price.

Assumptions and limitations

One fully closed, long-only homogeneous quantity in one currency, with separately stated fixed total buy and sell charges. No rate basis, compounding, recurring contribution, beginning/end timing, date convention or leap-year assumption applies. The confirmation is your assertion, not verification of a brokerage record. Market selection changes formatting only: USD, GBP, CAD, AUD or INR; GBP means pounds rather than GBX/pence.

Supported domain and common mistakes

Each input is a trimmed ungrouped decimal string of at most 48 characters and 12 fractional places. Quantity and buy price are 1e-12 through 1e12; other inputs are 0 through 1e12. Monetary outputs have absolute bounds of 2e24, return 2e38%, and break-even 3e24. Unsupported results are rejected. The isolated 120-digit half-even engine is checked against independent exact rational cash ledgers with absolute plus relative 1e-100 tolerances on deterministic vectors; this is not a uniform accuracy certification for every input. Currency rounds half-even to two places with tiny nonzero markers, return to six places, and extra summaries to eight significant figures. Never treat a rounded break-even display as an executable tick or a guarantee.

Do not enter 0.5 to mean a 0.5% commission: convert any percentage or per-share charge into the actual monetary total outside this model first. Do not combine mixed currencies, mismatched share units, partial sales or unmatched tax lots. Do not include a sell fee both in the net price and the fee box. Excluded dividends, taxes, spreads, financing and other costs can change a real economic outcome.

Frequently asked questions

How is stock profit calculated after fees?
Multiply shares by the sale-minus-buy price difference, then subtract the total purchase and sale charges once each. The cash identity is net sale proceeds minus upfront purchase outlay.
Which cost is the percentage return based on?
The positive upfront outlay is shares × purchase price + purchase charge. Sale charges reduce profit; adding them to this denominator as well would change the defined return basis.
Can I enter a sale price of zero?
Yes. Quantity and purchase price must be positive, but sale price may be zero. Explicitly enter zero charges where appropriate; a blank fee is not assumed to be zero.
Why can net sale proceeds be negative and return below −100%?
When sale charges exceed gross proceeds, closing requires an additional cash payment. The accounting loss can exceed the original outlay. This is explicitly shown and is not a short-sale or margin model.
Does break-even include tax or guarantee an execution?
No. It solves for a price covering the entered fixed buy/sell charges only. Taxes, spreads and other costs are excluded. Rounded display and market ticks mean it is not a guaranteed execution price.
Can this handle fractional shares or several purchase lots?
Fractional quantities are supported within the stated bounds. It does not match lots or partial sales. A separately reconciled homogeneous purchase basis may be used only if the full quantity and charges are consistent; purchase averaging is not automatically a tax basis.
Does changing the country convert my trade?
No. The five market choices change number and currency formatting only. Use one actual major currency throughout; GBP prices are pounds, not pence. No taxes or foreign exchange are inferred.

Sources and educational scope

Educational cash-accounting calculator, not personalized investment advice, tax reporting, a trade recommendation or a forecast. No live prices, FX, dividends, corporate-action adjustments, tax-lot matching, partial sales, shorts, leverage, fee schedule or tax calculation. Figures are user supplied; local account rules and qualified advice may be needed.

Reviewed . AI-assisted content under operator editorial responsibility; no independent expert financial review is claimed.

Find a financial tool