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.

How many shares you bought and sold. A fraction is fine, up to 6 decimals, for a broker that sells slices of a share.
$
What one share cost you, before any fee, up to 4 decimals.
$
What one share fetched, before any fee. Type 0 if the shares became worthless.

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.

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

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.

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.