Skip to content
CalculatorAtlas

Stock Profit Calculator

Tested

Profit or loss on a stock trade after fees.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

$
$
$

Results

Enter your values and press Calculate. Results appear here.

  • • Result

Quick answer

Profit = shares × (sell price − buy price) − fees, and return = profit ÷ (shares × buy price). 100 shares bought at $25 and sold at $32 with $20 of fees profits $680, a return of 27.2%.

Enter shares, buy and sell prices and fees. The calculator returns profit and return. Use this stock profit calculator to check your own figures.

Related tools: Stock Average Calculator: Average cost per share across several purchases. House Flipping Profit Calculator: Profit and return on cost of a renovate-and-sell project. Investment Calculator: Project investment growth from a rate of return you choose.

How to use the Stock Profit Calculator

  1. Enter shares (above 0).
  2. Enter buy price per share ($) (above 0).
  3. Enter sell price per share ($) (0 or more).
  4. Optionally, enter total fees and commissions ($) (0 or more).
  5. Press Calculate to see the result, and use Reset to start again.
Inputs of the Stock Profit Calculator
InputWhat to enterAllowed values
SharesA number> 0
Buy price per shareA number, in $> 0
Sell price per shareA number, in $≥ 0
Total fees and commissions (optional)A number, in $≥ 0

Formula and method

Formula

profit = shares × (sell − buy) − fees; return = profit ÷ (shares × buy)

IEEE-754 double precision; money shown to cents, rates to 4 decimals. Results are estimates, not financial advice.

Pre-tax. The return is relative to the purchase cost without fees.

Worked examples

These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.

Example 1

Inputs: Shares = 100; Buy price per share = 25; Sell price per share = 32; Total fees and commissions = 20.

Results of example 1
ResultValue
Profit$680.00
Return27.2%

Example 2

Inputs: Shares = 50; Buy price per share = 40; Sell price per share = 35.

Results of example 2
ResultValue
Profit-$250.00
Return-12.5%

The first line is the headline result (profit). Below it the stock Profit Calculator lists return, which describe the same case from other angles. IEEE-754 double precision; money shown to cents, rates to 4 decimals. Results are estimates, not financial advice.

The arithmetic

Gain per share is $7; for 100 shares that is $700, minus $20 of fees is $680. The investment was $2,500, so 680 ÷ 2,500 = 27.2%. Taxes are not included.

Real-world factors

Capital gains tax, dividends and the holding period change the net result. Fees are optional. Losses appear as negative profit. This is a calculation tool, not advice.

How the result changes with shares

Holding every other input at the first worked example, this table changes only shares. It shows how sensitive the answer is to that one value; each row was produced by running this calculator.

How the result changes with shares
SharesProfitReturn
50$330.0026.4%
100$680.0027.2%
200$1,380.0027.6%
400$2,780.0027.8%

What happens with invalid input

These messages are produced by the calculator itself, so you know what to fix.

  • Shares: entering "0" shows "Shares must be greater than 0." beside that field and no result.
  • Buy price per share: entering "0" shows "Buy price per share must be greater than 0." beside that field and no result.

Choosing between the Stock Profit Calculator and similar calculators

Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.

Choosing between the Stock Profit Calculator and similar calculators
CalculatorYou enterIt returns
[Stock Average Calculator](/finance/stock-average/)shares per purchase and price per share for each purchaseAverage cost per share
[House Flipping Profit Calculator](/real-estate/house-flipping-profit-calculator/)purchase price, renovation cost and holding costsProfit
[Investment Calculator](/finance/investment-calculator/)initial amount, annual interest rate and yearsProjected value
[Financial Calculator](/finance/financial-calculator/)solve for, periods per year and paymentsFuture value (FV)
[IRR Calculator](/finance/irr-calculator/)initial investment and cash flowsIRR

Background: interest, saving and investing

A nominal rate (APR) does not include the effect of compounding; the annual percentage yield (APY) does: APY = (1 + r/n)^n − 1. A 5% nominal rate compounded annually is 5.000%, semi-annually about 5.063%, quarterly about 5.095% and monthly about 5.116%, so more frequent compounding helps, but with diminishing returns.

The rate you enter in a projection is an assumption, not a promise: real returns vary and can be negative. Fees and taxes are not modelled unless the page says so.

Assumptions and limitations

  • Fees are optional

Results are estimates for planning, not financial advice. Lender terms, fees, taxes and rounding rules can change real figures, so confirm important numbers with your lender or a licensed adviser.

If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for shares and buy price per share to confirm this.

Frequently asked questions

Does it include dividends?

No, add them to profit.

What about taxes?

Taxes are not included, so subtract capital gains tax separately; the $680 profit is before tax.

How do I annualize the return?

Use the CAGR calculator.

What does the Stock Profit Calculator calculate?

Profit or loss on a stock trade after fees. It returns Profit and Return.

What formula does the Stock Profit Calculator use?

profit = shares × (sell − buy) − fees; return = profit ÷ (shares × buy). Pre-tax.

What do I need to enter in the stock Profit Calculator?

You enter Shares, Buy price per share ($) and Sell price per share ($). Optional: Total fees and commissions ($).

How is the result rounded or limited?

IEEE-754 double precision; money shown to cents, rates to 4 decimals. Results are estimates, not financial advice. Fees are optional.

What is an example of a stock Profit result?

With shares 100, buy price per share 25, sell price per share 32 and total fees and commissions 20, the profit is $680.00.

Can I rely on this calculator for a decision?

Results are estimates for planning, not financial advice. Lender terms, fees, taxes and rounding rules can change real figures, so confirm important numbers with your lender or a licensed adviser. For this calculator in particular: Fees are optional.

Sources

  • Standard time-value-of-money relations (e.g. Brealey, Myers & Allen, Principles of Corporate Finance)

Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.