Finance

Stock Gain or Loss Calculator

Calculate gain or loss from buying and selling shares, including fees.

—

The result shows the gain or loss in dollars and the return as a percentage before tax, so a positive gain means the sale covered the purchase cost and fees, while a negative figure means a loss.

Formula

Gain equals shares times sell price minus shares times buy price minus fees.

How it works

This is a pre-tax gain. Short-term and long-term tax treatment differ by country, so the after-tax result will be lower where capital gains tax applies.

Worked example

For example, 100 shares bought at $20 and sold at $28 with $10 in fees give a gain of $790.00, since 100 × $28 − 100 × $20 − $10 = $790.00, a return of 39.50% before tax.

FAQs

Does it include dividends?
No — add dividends received to the gain separately.

What if the result is negative?
That is a loss, which may offset gains elsewhere under local tax rules.

Why include fees?
Broker fees reduce the real gain, sometimes significantly on small trades.

Are these figures financial advice?
No — they are estimates for planning only, not financial advice. Check with a qualified adviser for decisions involving large sums.

Estimates only, not financial advice. Figures are approximate and do not include all fees, taxes, or changing rates unless stated.

Related calculators

Annuity Payment Calculator

APR Estimate Calculator

Biweekly Mortgage Savings Calculator

Fast results

Instant result, no sign-up.

Free to use

All tools are free.

Formula shown on the page

Each page shows the formula it uses, so you can check the result yourself.

Works on mobile

Built for phone browsers.

Start with a free calculator

Search, pick a calculator, and get an instant result. No sign-up, no download.

Browse categories Read the blog