Stock profit calculator with fees and dividends
Type how many shares you traded, the price at which you bought and the price at which you sold, then the commission paid each way and any dividends received. The page gives the cost, what the sale brought in, the profit or loss, the return in percent and the lowest price at which selling would not lose money.
Result
Summary
Profit or loss
$690.10
- Profit with dividends
- $786.10
- Return on the cost
- 16.44%
- Return with dividends
- 18.73%
- Total cost
- $4,196.95
- Proceeds after fees
- $4,887.05
- Dividends received
- $96.00
- Break-even sell price
- $52.5238 per share
One purchase and one sale of the same shares. It does not match several lots, follow a position still open or work out tax, and it recommends nothing to buy or sell.
How this was calculated
Step by step, with the figures above.
- Costnumber of shares × buy price + buying fees. number of shares: 80 · buy price: $52.40 · buying fees: $4.95. Rounded to 2 decimal places, halves away from zero.
- Proceedsnumber of shares × sell price − selling fees. number of shares: 80 · sell price: $61.15 · selling fees: $4.95. Rounded to 2 decimal places, halves away from zero.
- Profit or lossproceeds − cost. proceeds: $4,887.05 · cost: $4,196.95
- Profit with dividendsprofit or loss + dividends received. profit or loss: $690.10 · dividends received: $96.00
- Return on the costprofit or loss × 100 ÷ cost. profit or loss: $690.10 · cost: $4,196.95. Rounded to 2 decimal places, halves away from zero.
- Return with dividendsprofit with dividends × 100 ÷ cost. profit with dividends: $786.10 · cost: $4,196.95. Rounded to 2 decimal places, halves away from zero.
- Break-even sell price(cost + selling fees) ÷ number of shares. cost: $4,196.95 · selling fees: $4.95 · number of shares: 80. Rounded up to 4 decimal places, away from zero.
IRS Publication 550, Investment Income and Expenses. The basis of stock as the purchase price plus the costs of purchase such as commissions, the amount realized as what you receive minus the expenses of the sale, and the Fund A example of 100 shares at $10 with a $50 commission; the 2025 edition, read on 2026-11-26.
Instructions for Form 8949, Sales and Other Dispositions of Capital Assets. The net proceeds as the gross proceeds minus selling expenses such as broker’s fees and commissions, and the basis as the cost including commissions; the 2025 edition, read on 2026-11-26.
IRS Topic no. 409, Capital gains and losses. A gain when an asset is sold for more than its adjusted basis and a loss when it is sold for less; read on 2026-11-26.
80 shares bought at $52.40 and sold at $61.15
Buying 80 shares at $52.40 costs $4,192.00 before any fee; adding a $4.95 commission makes the cost $4,196.95. Selling them at $61.15 brings in $4,892.00, and after a $4.95 commission the proceeds are $4,887.05. The profit is $690.10, which is 16.44% of the cost. The $96.00 of dividends lifts the total to $786.10, or 18.73%.
Without any fee the same trade would show $700.00 and 16.70%, so the two commissions took $9.90 of the result. They also move the finish line: the shares must sell for at least $52.5238 each to leave nothing lost, a little above the $52.40 paid. Sell them at $52.40 and the loss is $9.90, the fees alone.
Part of a share counts the same way. 2.5 shares bought at $187.20 and sold at $201.80, with no fees, cost $468.00 and fetch $504.50: a gain of $36.50, or 7.80%.
A loss shows a minus sign. 300 shares bought at $14.80 and sold at $11.35, with $9.95 of commission each way, cost $4,449.95 and brought in $3,395.05: -$1,054.90, or -23.71%.
From the prices to the profit
The cost is the number of shares times the price paid, plus the fees of the purchase. The proceeds are the number of shares times the price received, minus the fees of the sale. The profit is the proceeds less the cost, and the return is that profit divided by the cost, in percent. Dividends are added to the profit in a second line, so the trade and the income stay apart.
The break-even price comes from the same sums turned around: the cost plus the selling fees, divided by the number of shares. It is the price per share at which the sale pays back what you spent and the commission to sell, with nothing left over.
The American tax agency counts fees the same way. In its Publication 550, the basis of stock is generally the purchase price plus the costs of purchase, such as commissions, and the amount realized on a sale is what you receive minus the expenses of the sale. The instructions for Form 8949 call the result the net proceeds. This page applies that arithmetic and stops there: it does not say what, if anything, you owe.
Rounding and the break-even price
Shares may have up to 6 decimals and prices up to 4; fees and dividends are typed in whole cents. The products are worked out exactly, then the cost and the proceeds are each rounded just once, to the cent nearest in value, and a tie at half a cent resolves upward. The profit is the difference of those two cent amounts, so every line on the page agrees with the others. The return divides once and is rounded to two decimals, a half going away from zero. The tax agency prints no rule for these roundings, so they are this page’s own choice, and the figures on your brokerage confirmation could be a cent apart.
The break-even price is rounded up, never down, to the 4 decimals a price may have, so selling at the figure shown or above it cannot leave a loss. It is worked from the cost as rounded to the cent, so it can sit a little above the quotient of the exact cost.
Taxes, other costs and what the page leaves out
Gains on shares may be taxed, and how depends on the country you live in, how long you held the shares and your other income. Your own tax rules decide, and this page works out none of it. Stamp duties and transaction taxes, currency conversion, interest on money borrowed to buy and the effect of inflation are all left out, unless you type them into a fee field.
A trade that took place in several lots, at several prices, needs each lot matched to its sale first; here one price stands for the whole holding. The figures describe what happened to these shares, not what any other will do.
Sources
- IRS Publication 550, Investment Income and Expenses. The basis of stock as the purchase price plus the costs of purchase such as commissions, the amount realized as what you receive minus the expenses of the sale, and the Fund A example of 100 shares at $10 with a $50 commission; the 2025 edition, read on 2026-11-26.
- Instructions for Form 8949, Sales and Other Dispositions of Capital Assets. The net proceeds as the gross proceeds minus selling expenses such as broker’s fees and commissions, and the basis as the cost including commissions; the 2025 edition, read on 2026-11-26.
- IRS Topic no. 409, Capital gains and losses. A gain when an asset is sold for more than its adjusted basis and a loss when it is sold for less; read on 2026-11-26.
Questions
How do I work out the profit on shares I sold?
Multiply the shares by the buying price and add the fees to get the cost, multiply them by the selling price and subtract the fees to get the proceeds, then take the cost from the proceeds. For 80 shares that cost $4,196.95 and brought in $4,887.05, the profit is $690.10.
Do commissions count in the profit?
Yes. A commission paid to buy adds to what the shares cost, and a commission paid to sell reduces what the sale brought in, so both lower the profit. The American rule this page cites counts them in the same two places; in another country, check the rule of your own tax authority.
What does the break-even sell price tell me?
The lowest price per share at which selling leaves you no worse off than before, once the fee to sell is paid. In the first example it is $52.5238, above the $52.40 paid, because the two commissions have to be earned back.
Can I enter part of a share?
Yes, up to 6 decimals, such as 2.5 or 0.125. The cost and the proceeds are worked out exactly and then rounded to the cent.
Are dividends part of the profit?
They are shown beside it. The profit of the trade is only the price movement net of fees, $690.10 in the first example, and the dividends make the total $786.10. The page keeps the two apart instead of merging them into the first figure.
Does the page tell me what tax I owe?
No. It shows the pre-tax result only. Whether a gain is taxed, at what rate and in what year are matters for your own country’s rules and your own situation, which the page cannot see.
Related calculators
- Discount calculator: stacked percent off and price before
- Tip and bill split calculator with round-up shares
- Unit price comparison: cost per kilo, litre, pound or piece
- Net worth calculator: assets, debts and home equity
- Price per square foot and square meter: compare two homes
- Basis points to percent: new rate and yearly interest
- Return on investment calculator: ROI and annualized return
- CAGR calculator: compound annual growth rate
- Average share cost calculator for several purchases
- Return on equity calculator with DuPont breakdown
- Loan to value calculator: LTV, CLTV and HCLTV
- Net effective rent calculator with free months and credits
- Prorated rent calculator by day for a partial month
- Loan payment calculator with amortization schedule
- Loan payoff calculator: extra payments and interest saved
- Credit card payoff calculator: minimum or fixed payment
- Time value of money calculator: PV, FV, payment and rate
- Annuity payout calculator: income from savings
- Compound interest calculator with monthly deposits
- Effective annual rate calculator (APR to APY)
- CD calculator: interest, APY and a ladder for term deposits
- Simple interest calculator by days, months or years
- Rule of 72 calculator: years to double or the rate needed
- Net present value calculator: NPV and discounted cash flow
- IRR calculator: internal rate of return on yearly flows
- Payback period calculator: simple and discounted
- WACC calculator: weighted average cost of capital
- Price elasticity calculator: demand, supply, cross-price
- Rent affordability calculator: what rent a standard allows
- Debt to income ratio calculator: your DTI against a limit
- Real estate commission calculator: fee, VAT and split
- Sales tax calculator: add tax or find the price before it
- Loan APR calculator: the true yearly cost with fees
- Bond price and yield to maturity calculator
- Student loan repayment calculator for US federal loans
- Depreciation calculator: MACRS, straight line, declining
- Rental property depreciation calculator by country
- Adjusted gross income (AGI) and MAGI calculator
- Cash rounding calculator: the cash total by country
- Coin counter: the value and weight of your coins
- PTO accrual calculator: leave earned per pay period
- PayPal fee calculator: what you keep from a payment
Reviewed by the DirectCalculators team. The formula is tested against its source’s worked examples, where the source gives any, and cases worked by hand; see how we calculate.