Stock Profit Calculator

Use this stock profit calculator to calculate the profit or loss on a stock trade from the number of shares, buy price, sell price, commissions, and dividends. Review net profit, ROI, annualized return, profit per share, and break-even price instantly.

Enter your stock trade information

Start with your goal

What are you calculating?

Results update instantly as you type.

Add position history or dated cash flows

Use this only for multiple purchases, earlier sales, stock splits, or dated dividends and XIRR.

Calculation detail
Net profit/loss$1,980.00
ROI19.78%
Break-even$100.20
Sale status
View a reference market price (optional)

Market information is for reference only and never changes your calculation inputs.

View a reference market price without changing your inputs.

Optional inputs$0.00 dividends · 12 months
Holding period

Calculator basics

What is a stock profit calculator?

A stock profit calculator is an interactive tool for estimating the stock gain or loss from a completed stock transaction or a possible future sale. It uses the number of shares, buy price, sell price, and transaction costs to calculate stock profit, rather than showing only the change in market price.

Stock profit is the money left after the total purchase cost, including the buy commission, is subtracted from net sale proceeds. Net sale proceeds include dividends entered for the position and subtract the sell commission. A positive result is a stock gain; a negative result is a stock loss.

The calculator also converts the dollar result into ROI, or return on investment, so you can compare the efficiency of different stock trades. Add a holding period to estimate an annualized stock return, or use target mode to work backward from a desired investment gain or loss to a required sell price.

How to read your stock profit calculator results

Each result answers a different question about the stock trade. Use the figures together to understand both the amount earned or lost and the efficiency of the investment.

Net profit or loss

This is the money left after subtracting your buy-side costs from your sell-side proceeds. A positive number means the trade made money; a negative number means it lost money.

ROI

Return on investment compares your profit with the total capital committed to the trade. It is useful for comparing two trades of different sizes.

Profit per share

Profit per share divides the net profit or loss by the number of shares sold. It shows how much each sold share contributed after commissions and dividends are included.

Annualized return

For one purchase, annualized return converts the total gain into a yearly rate so trades with different holding periods are easier to compare. For dated purchases and sales, the calculator uses the cash-flow-aware XIRR method.

Break-even sell price

Break-even shows the sale price you would need to fully recover your purchase cost, including the effect of commissions and any dividends already received.

How to calculate stock profit

To calculate stock profit, compare everything received from the stock sale with everything paid to establish the position. The calculation below keeps the purchase, sale, commissions, and dividends visible instead of hiding them inside one total.

Need a field-by-field walkthrough and worked example? Read the complete guide to calculating stock profit.

Net profit or loss=Net proceeds-Total cost basis

Net proceeds
Net proceeds = Gross sale value - Sell commission + Dividends.
Total cost basis
Total cost basis = Purchase value + all Buy commissions.
Gross sale value
Gross sale value = Number of shares x Sell price per share.
Purchase value
Purchase value is the combined value of every entered purchase. For one purchase, it equals Number of shares x Buy price per share.
Total fees
Total fees = all Buy commissions + Sell commission.
ROI = Net profit or loss / Total cost basis x 100

Dividends are included in Net proceeds. For one purchase, a Holding period also produces Annualized return; exact dates use the Actual/365 Fixed day-count convention. For multiple purchases or previous sales, dated cash flows produce XIRR.

A worked stock profit with dividends example shows how a distribution changes profit, ROI, Profit per share, and break-even price together.

For a Partial sale, the same profit formula replaces Total cost basis with Cost basis of shares sold. Shares remaining and Remaining cost basis stay outside the realized result.

Profit per share = Net profit or loss / Shares sold. For a Full position sale, Shares sold equals the full Number of shares.

Stock profit calculator examples

These examples show how the stock profit calculator handles common stock trade scenarios. Each example uses the same calculator fields shown above, so the numbers can be checked directly in the tool.

Example 1: stock profit after commissions

If you buy 100 shares at $100, sell them at $120, and pay $10 to buy plus $10 to sell, the stock profit calculator shows $1,980 in Net profit or loss. The same result appears as $19.80 Profit per share and 19.78% ROI.

Example 2: stock loss calculation

If the Sell price per share is below the Buy price per share, the calculator shows the result as a Net loss. Fees make the loss larger because Buy commission and Sell commission are both included in Total fees.

Example 3: multiple purchases

When a position was built through several purchases, the stock profit calculator combines Total shares, Purchase value, Buy commissions, Weighted average buy price, and Total cost basis before calculating Net proceeds and ROI.

Read the multiple-purchase guide

Example 4: partial stock sale

For a partial sale, the calculator measures realized stock profit only on Shares sold. It keeps Shares remaining and Remaining cost basis separate so the unsold part of the position is not mixed into the realized result.

Read the partial-sale guide

Built a position over time?

Calculate stock profit with multiple purchases

Select Multiple purchases to enter each buy separately with its own share quantity, execution price, and flat or percentage commission. The calculator combines the entries into Total shares, Purchase value, Buy commissions, Weighted average buy price, and Total cost basis.

The combined position works in both calculator modes. Enter a possible Sell price per share to estimate Net profit or loss and ROI, or set a target return to find the Required sell price.

The position summary keeps Weighted average buy price separate from fee-inclusive cost basis. See how both are built in the average stock cost basis guide, then use Annualized return and XIRR when every relevant cash flow has a valid date.

If the history crosses a forward or reverse split, first review how to adjust stock profit inputs for a stock split while preserving position value and entered commissions.

See the formulas, annotated calculator examples, and accuracy checks in the How to Calculate Stock Profit with Multiple Purchases guide.

Selling only part of a position?

Calculate profit on a partial stock sale

Select Partial sale to calculate realized profit on the shares being sold while keeping the unsold shares separate. The calculator allocates purchase cost and buy commissions to the sale, then shows Shares remaining and Remaining cost basis.

For multiple purchases, choose FIFO, LIFO, or Specific lots. This lets the calculation use the cost basis of the shares actually selected for sale instead of the cost of the entire position.

The FIFO vs LIFO stock sale profit comparison shows why selected lot basis changes realized profit. If the selling price is known but the quantity is not, continue with the shares-to-sell target guide.

Follow the worked examples and lot-selection steps in How to Calculate Profit on a Partial Stock Sale.

Comparing the result per share?

Calculate profit per share

Profit per share divides Net profit or loss by Shares sold. Unlike the raw difference between Buy price per share and Sell price per share, this result includes allocated Buy commission, Sell commission, and any Dividends entered in the calculator.

For a Partial sale or a position with Multiple purchases, the calculator uses only the shares and cost basis included in that sale. This makes the result useful for comparing trades with different quantities while keeping fees visible.

See the formula, worked examples, and important distinction from company earnings per share in How to Calculate Profit per Share.

What the calculator includes, and what it does not

The assumptions are shown openly so you can understand what the result represents and where your real-world return may differ.

Included

  • Shares, buy price, and sell price
  • Buy-side and sell-side commissions
  • Quick calculation and Position history workflows
  • Full-position and partial-sale calculations
  • Previous sales and remaining position cost basis
  • Flat-fee and percentage-fee inputs
  • Optional total or individually dated dividends
  • Transaction timeline and named scenario comparison
  • Forward and reverse stock split adjustments

Excluded

  • Taxes and after-tax return
  • FX conversion and spread
  • Slippage, margin interest, and borrow fees
  • Mergers, spin-offs, and other basis-changing events

Reference points used for this methodology

Review the full methodology
Best Stock Profit Calculator

About The Author

Stock Profit Calculators Research Team

A research and product team that develops practical financial tools for traders and investors, with a focus on stock returns, trading costs, cost basis, and investment performance. The team builds calculators and educational resources that make investment performance easier to measure, understand, and compare.

Learn about the team

Step-by-step guide

How to use the stock profit calculator

Start with the question you need to answer. If you already know a possible selling price, the stock profit calculator can estimate the net profit or loss on that stock transaction. If you have a return goal instead, it can work backward and find the sell price required to reach that target. If you know the price but need a cash or profit target, it can also find the number of shares to sell. Results update as you change an input, so it is easy to compare several stock trade scenarios without starting over.

For annotated screenshots of every input and result, continue with the How to Calculate Stock Profit step-by-step guide.

Calculate profit when you know the sell price

Choose Calculate profit when you want to evaluate a completed stock trade or test a possible exit price.

  1. Choose Quick calculation for one purchase and one sale, or Position history for multiple purchases, previous sales, dated dividends, and partial-sale lot selection.
  2. Choose One purchase or Multiple purchases. For multiple purchases, add each buy as a separate entry. Fractional shares are accepted.
  3. Add the Number of shares and Buy price per share. The calculator finds the total shares and weighted average buy price automatically when several purchases are entered.
  4. Enter the actual or hypothetical Sell price per share.
  5. Choose Completed sale only for an executed transaction. Choose Planned salewhen the price or outcome is still an estimate; the result panel keeps that status visible.
  6. Select a flat fee or percentage for both the Buy commission on each purchase and the Sell commission. Enter zero when no commission applies.
  7. Open Optional inputs to include a total dividend in Quick calculation or add each dividend amount and payment date in Position history. Exact dates let the calculator estimate XIRR from purchases, sales, and dividend cash flows.
  8. Add completed transactions under Previous sales when the current calculation should use only the shares and cost basis still remaining in the position. A new sale stays a draft until you select Include sale, so an unfinished entry does not change the current result.
  9. Read the result panel. Start with Net profit or loss and ROI, then review the Profit per share, cost, proceeds, and fees below.
  10. Use the profit-by-price chart to inspect nearby exits, or save up to five named scenarios for a side-by-side comparison.

Find the sell price needed for a target return

Choose Find required sell price when you know the outcome you want but not the exit price needed to reach it.

  1. Enter one or multiple purchases exactly as you would for a profit calculation. Each purchase can use a different buy price and commission.
  2. Select Net profit or loss to set a dollar target, or Return on investment to set a percentage target.
  3. Enter the target. A positive number represents a desired profit or positive ROI; a negative number can be used to model a planned loss limit.
  4. Add the expected sell commission. The stock profit calculator includes that fee when solving for the required price.
  5. Include dividends if they are part of the return you want to measure. Dividends reduce the sell price needed to reach the same net outcome.
  6. Review Required sell price and the change from your buy price or weighted average buy price. The result panel also confirms the Net profit or loss and ROI produced at that price.

For formulas, annotated examples, and both target types, continue with How to Calculate a Target Sell Price.

Find how many shares to sell

Choose Find shares to sell when you know the sell price and want to reach a target amount or keep a target number of shares. Choose an exact fractional result or a whole-share policy, then compare FIFO and LIFO without rebuilding your position.

  1. Enter the expected Sell price per share and your Sell commission.
  2. Select either Net proceeds or Net profit or loss, then enter the dollar target.
  3. Review the minimum exact number of shares needed and the resulting proceeds, profit, and remaining basis.
  4. For multiple purchases, choose FIFO or LIFO. For Specific lots, enter explicit per-lot limits because the calculator cannot infer which particular lots you want to sell.

See exact fractional examples, whole-share policies, and unreachable targets in How Many Shares to Sell for a Profit Target.

What each stock trade input means

Use values from the same position and the same currency. The calculator displays results in US dollars and does not convert between currencies.

Number of shares
The quantity in one purchase. In multiple-purchase mode, the calculator adds the shares from every entry.
Buy price per share
The execution price for one purchase. Multiple-purchase mode calculates a weighted average buy price from all entries.
Sell price per share
The execution price received, or a hypothetical market price you want to test.
Buy and sell commission
Transaction fees charged by the broker. Each purchase can have its own flat or percentage fee, and each recorded sale can use its own sell commission.
Total dividends received
Cash dividends attributable to the shares in this calculation during the selected holding period.
Holding period
The time between purchase and sale. Use months for a quick estimate or exact dates for an Actual/365 Fixed calculation. For multiple purchases or previous sales, add every relevant date so the calculator can estimate XIRR from the cash flows.

Worked example

How to calculate stock profit after commissions

Consider a stock trade in which you buy 100 shares at $100 each and later sell them at $120. Your broker charges a $10 commission on the purchase and another $10 on the sale. No dividends are included, and the holding period is 12 months.

Total cost basis$10,000 + $10 = $10,010

Net proceeds$12,000 - $10 = $11,990

Net profit$11,990 - $10,010 = $1,980

ROI$1,980 / $10,010 = 19.78%

The $20 difference between the share prices creates a $2,000 stock gain before fees. After $20 in total commissions, the net profit on the stock transaction is $1,980. Because the position was held for 12 months, the annualized stock return is also 19.78% in this example.

Loss scenario

Example: calculating a stock loss

Suppose the same 100 shares were bought at $100 but sold at $92, with a $10 commission on each side and no dividends. The Total cost basis would still be $10,010, while Net proceeds would fall to $9,190. The result is an $820 stock loss and an ROI of -8.19%.

A stock gain or loss calculation should remain negative when the sale proceeds do not recover the purchase cost and fees. In this case, the Break-even sell price is $100.20 per share. You can also enter a negative target in target mode to find the sell price associated with a planned loss limit.

Position details

Multiple purchases and partial stock sales

Calculate stock profit with multiple purchases

Select Multiple purchases and add the shares, buy price, and commission from each transaction. If you bought 40 shares at $80 and 60 shares at $100, the calculator combines 100 shares with a $9,200 Purchase value and a $92 weighted average buy price before commissions.

How the combined cost basis is used

Buy commissions are calculated for each purchase and added to the combined Purchase value. The resulting Total cost basis is used for Net profit or loss, ROI, Break-even sell price, and target sell price. Add purchase and sale dates to calculate a cash-flow-aware annualized return using XIRR.

For a complete worked example, read How to Calculate Stock Profit with Multiple Purchases.

Calculate realized profit on part of a position

Choose Partial sale, enter Shares to sell, and select FIFO, LIFO, or Specific lots when the position contains multiple purchases. Results use only the Cost basis of shares sold and keep the Remaining cost basis separate.

See a step-by-step example in How to Calculate Profit on a Partial Stock Sale.

Continue a position after previous sales

Add completed sales from oldest to newest. Each sale removes shares and their allocated basis before the current scenario is calculated. Position sale history keeps cumulative realized profit separate from the result for the current modeled sale. Draft entries stay outside the calculation until included.

Review cash flows in one timeline

Position history places dated purchases, included sales, dividend payments, and the modeled sale in chronological order. This makes missing dates and the cash flows used for XIRR easier to verify before relying on the result.

Normalize prices after a stock split

Use Adjust for a stock split to scale all entered share quantities and per-share prices by one forward or reverse split ratio. Position value and entered fee amounts remain unchanged.

Before relying on the result

Use the actual fill price. A displayed stock quote is a useful reference, but an order may execute at a different price. Choosing a ticker shows market information but the stock profit calculator does not replace any input automatically.

Match the fee type to your broker. A flat $5 fee and a 5% commission produce very different results. Check the selector before entering the amount.

Keep taxes separate. This is a pre-tax stock profit calculator. Capital gains tax, withholding tax, and account-specific tax treatment are not included.

Test more than one price. For a possible trade, use Profit at different sell prices to compare the entered price with results 10% and 20% above and below it. A range is often more useful than a single forecast.

Know where the draft is stored. Inputs are restored from this browser on this device. They are not synced to an account; use a share link when another browser needs the same scenario.