b2KIT

Stock Profit/Loss Calculator

Calculate stock trading gains or losses with buy/sell prices, share quantity, commissions, and short vs long-term capital gains tax.

Tested tool guide Tested browser tools Checked August 16, 2026

What Stock Profit/Loss Calculator does, with a checked example

A stock's price move is not its profit. Buy 100 shares at $50 and sell at $60 and the price math says $1,000, but commissions trim that and tax takes a cut that depends on how long you held. This calculator runs the whole chain: gross gain or loss from buy and sell prices, the net figure after commissions on both sides, percentage return on what you actually put in, and a short-term versus long-term capital gains tax estimate. The surprise is the holding period: cross the one-year line and the same gain is taxed at a much lower rate.

Worked example

A concrete input and expected output from the current implementation.

Input

Buy price $50.00, sell price $60.00, quantity 100, buy commission $5.00, sell commission $5.00, holding period 8 months (short-term), tax rate 22%

Expected output

Gross profit $1,000.00. Net profit after commissions $990.00 (19.78% return on the $5,005.00 total cost). Estimated capital gains tax at 22%: $217.80. After-tax profit: $772.20.

100 shares x ($60.00 - $50.00) = $1,000.00 gross. Total cost is $5,005.00 (shares plus buy commission) and proceeds are $5,995.00 (sales proceeds minus sell commission), so net profit is $990.00. Tax is 22% of the net gain because the 8-month hold makes the gain short-term.

How the result is produced

1

Profit arithmetic

Gross gain or loss is (sell price minus buy price) times quantity. The buy commission adds to your cost, the sell commission subtracts from your proceeds, and the difference between proceeds and cost is the net result. The percentage return is measured against the total money at risk, so a trade that looks profitable on price alone can show a loss once commissions are included, especially on small positions.

2

Tax split by holding period

The one-year mark decides the rate. A sale one year or less after purchase is a short-term gain, taxed at your ordinary income rate. More than one year makes it long-term, taxed at the lower federal capital gains brackets of 0%, 15%, or 20% depending on your income. The calculator applies the chosen rate to the net gain, so the estimate is only as good as the rate you feed it.

Good uses

  • You have a small position with a small gain and want to know whether the trade still makes money after commissions before deciding to sell.
  • You are a few weeks short of the one-year anniversary and want to see what the same sale costs in tax if you wait for long-term status.
  • You are planning a sale to raise cash and need a rough figure for the tax bill, or checking a losing position to see how much of the loss survives commissions.

Limits and checks

  • The tax number is an estimate. Actual brackets change every year and depend on filing status and total taxable income, and high earners may owe an extra 3.8% net investment income tax. State taxes are separate and also apply to most gains.
  • The tool works from the numbers you enter, not your brokerage history. It cannot see a position built up over multiple buys at different prices, dividend reinvestments, or stock splits, so enter the effective per-share prices carefully.
  • Losses are not taxed, but a loss sale is not automatically usable: the wash-sale rule disallows the loss if you buy the same or substantially identical stock within 30 days before or after the sale. A simple calculator will not apply that rule.

Common questions

Why is my sale short-term when I held the stock for exactly one year?

Because the rule requires more than one year. US tax law treats a gain as long-term only when the stock is held for more than one year, so a sale on the one-year anniversary is still short-term and taxed at ordinary income rates. Selling one day later flips the gain to the lower long-term rates.

Does the calculator's tax figure match what I will actually owe?

No. It is an estimate at an assumed rate. Your actual bill depends on your total income, filing status, other gains and losses that net against this sale, and state taxes. Use it to compare scenarios, then rely on your broker's 1099-B and tax software or an accountant at filing time.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools