Stock profit calculator

Enter your shares, prices and fees. You get your profit and return, an estimate of the 2026 federal capital gains tax, and what the tax would be at the short-term and the long-term rate.

Total dollars for each trade, not per share. Enter 0 if your broker charges nothing.
How long you held the shares
Wages and other taxable income, not counting this sale. Add your spouse's income if you file jointly. The standard deduction is taken off for you.
Stock profit estimateTax year 2026
Profit after fees and federal tax
$1,320

Held one year or less, this gain is taxed like wages. Held for more than a year, it would all fall in the 0% band, which is $180 less tax.

$180fees and estimated federal tax$1,320profit you keep
Sale proceeds
$5,500.00
Purchase cost
−$4,000.00
Gross profit
$1,500.00
Buy and sell fees
$0.00
Net profit after fees
$1,500.00
Return on what you paid
37.5%
Estimated federal tax, short-term
$180
Tax if held more than one year
$0

Not included: state income tax. Share prices can fall as well as rise.

Estimate using the 2026 federal brackets, the standard deduction and the 2026 long-term capital gain thresholds. It assumes this is your only sale this year, with no other gains, losses or credits.

Short answer: stock profit is the sell price minus the buy price, times your shares, minus fees. 100 shares bought at $40 and sold at $55 with $10 of fees make $1,490. Held one year or less, the gain is taxed like wages. Held longer, it is taxed at 0%, 15% or 20%, depending on your taxable income.

How stock profit and the tax are calculated

  1. Gross profit. The price change times the number of shares.
    Gross profit = (sell price − buy price) × shares
  2. Net profit. Take off the commission and fees on both trades.
    Net profit = gross profit − buy fees − sell fees
  3. Return. The net profit as a percent of what you paid, including the buy fee. This is your stock return for the trade.
    Return = net profit ÷ (purchase cost + buy fees) × 100
  4. Federal tax on a short-term gain. A gain on shares held one year or less is added to your other income. The calculator works out 2026 income tax on your income with the gain, then without it. The difference is the tax on the gain.
  5. Federal tax on a long-term gain. A gain on shares held more than one year sits on top of your other taxable income. The part that fits under the 0% line is not taxed. The part between the 0% line and the 15% line is taxed at 15%, and anything above is taxed at 20%.

Taxable income here means your other income minus the 2026 standard deduction ($16,100 single, $32,200 joint). The calculator always shows the tax both ways, so you can see what the one-year line is worth on your trade.

Worked examples

Each example is a single filer with $60,000 of other income, which is $43,900 of taxable income.

100 shares bought at $40, sold at $55 within a year

$5 of fees on each trade. The gain stays inside the 12% bracket, so the short-term tax is 12% of $1,490.

  • Sale proceeds$5,500
  • Purchase cost$4,000
  • Gross profit$1,500
  • Fees$10
  • Net profit after fees$1,490
  • Return on what was paid37.2%
  • Federal tax if short-term$178.80
  • Federal tax if long-term$0.00
  • Profit after short-term tax$1,311.20

400 shares bought at $25, sold at $50 after two years

No fees. The 0% band for a single filer ends at $49,450, so $5,550 of the gain is taxed at 0% and the other $4,450 at 15%.

  • Sale proceeds$20,000
  • Purchase cost$10,000
  • Gross profit$10,000
  • Fees$0
  • Net profit after fees$10,000
  • Return on what was paid100%
  • Federal tax if short-term$1,550.00
  • Federal tax if long-term$667.50
  • Profit after long-term tax$9,332.50

300 shares bought at $50, sold at $32

$5 of fees on each trade. The loss is bigger than the $3,000 yearly limit, so part of it carries forward. This assumes no other gains or losses this year.

  • Sale proceeds$9,600
  • Purchase cost$15,000
  • Gross loss−$5,400
  • Fees$10
  • Net loss after fees−$5,410
  • Return on what was paid−36.1%
  • Capital gains tax$0
  • Loss deductible this year$3,000
  • Tax that deduction could save$360
  • Loss carried forward to later years$2,410

Federal tax on a $10,000 gain, short-term and long-term

The same $10,000 gain is taxed very differently depending on your other income and on which side of the one-year line you sell.

Single filer, standard deduction, no other gains or losses. Tax year 2026. Federal income tax only: the 3.8% Net Investment Income Tax and state tax are not included.
Other income before taxTax if held one year or lessTax if held more than one yearDifference
$25,000$1,130$0$1,130
$40,000$1,200$0$1,200
$50,000$1,200$0$1,200
$70,000$2,200$1,500$700
$100,000$2,200$1,500$700
$150,000$2,400$1,500$900
$250,000$3,200$1,500$1,700
$400,000$3,500$1,500$2,000
$600,000$3,500$2,000$1,500

The difference is a result of the tax rules, not a reason to hold or sell. A share price can fall by more than the tax you would save while you wait.

Short-term and long-term rates for 2026

The IRS sorts each sale by how long you held the shares. One year or less is short-term. More than one year is long-term. Selling on the one-year anniversary is still short-term.

  • Short-term gains are taxed as ordinary income, at your normal rate of 10% to 37%.
  • Long-term gains are taxed at 0%, 15% or 20%. The rate depends on your taxable income, including the gain.
Long-term capital gain rates by taxable income, tax year 2026. Source: IRS Rev. Proc. 2025-32, section 4.03.
Filing status0% up to15% up to20% above
Single$49,450$545,500$545,500
Married filing jointly$98,900$613,700$613,700
Head of household$66,200$579,600$579,600
Married filing separately$49,450$306,850$306,850

These lines are not cliffs. Crossing one does not change the tax on the whole gain. Only the part of the gain above the line moves to the higher rate, as in the second example.

Losses, the yearly limit and wash sales

A loss on a stock is not taxed, and it can lower your tax bill. Capital losses first cancel out capital gains from your other sales in the same year. If your losses are still larger, the rest is a net capital loss.

  • The yearly limit. You can deduct up to $3,000 of a net capital loss against other income such as wages each year, or $1,500 if you are married and file separately.
  • Carry-forward. Any loss above the limit carries forward to later years. In the third example, $3,000 is used this year and $2,410 moves to next year.
  • Wash sales. If you sell at a loss and buy substantially identical shares within 30 days before or after the sale, the IRS does not let you deduct the loss. It is added to the cost of the new shares, so it counts when you sell those. The calculator cannot see your other trades, so it does not check for this.

What the result leaves out

  • State income tax. States set their own rules for taxing gains. Nothing here covers state or local tax.
  • Net Investment Income Tax. A separate 3.8% federal tax can apply to investment income when your modified adjusted gross income is over $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). The calculator flags it but does not add it.
  • Your other sales. Gains and losses from all your sales in a year are netted together. This looks at one trade alone.
  • Itemized deductions and credits. The estimate uses the standard deduction and nothing else.
  • Shares bought at different prices. Enter one buy price. If you bought in several lots, work out each lot on its own.
  • Dividends. Any dividends you were paid while you held the shares are extra income and are taxed separately.

The estimate is for shares held in an ordinary taxable brokerage account. Shares can lose value, and a past gain says nothing about the next trade.

Common mistakes

  • Applying one rate to the whole gain. A gain that crosses a line is taxed in parts.
  • Selling a day early. Sold on the one-year anniversary or before, the gain is short-term.
  • Leaving out fees. Fees lower both your profit and your taxable gain.
  • Deducting a wash sale loss. Buying the same shares back within 30 days blocks the deduction for now.
  • Expecting a big loss to wipe out wages. Only $3,000 a year can come off other income.
  • Forgetting state tax. The federal figure is often not the whole bill.

Questions people ask

How do I calculate profit on a stock?

Take the buy price from the sell price, multiply by the number of shares, then take off your fees. 100 shares bought at $40 and sold at $55 with $10 of fees make $1,490.

How do I calculate the return on a stock?

Divide the net profit by what you paid, including the buy fee. In the example above, $1,490 on a cost of $4,005 is a return of 37.2%. Dividends you received are extra and are not counted here.

What is the difference between short-term and long-term capital gains?

A gain on shares held one year or less is short-term and is taxed like wages, at 10% to 37%. A gain on shares held more than one year is long-term and is taxed at 0%, 15% or 20%.

What are the long-term capital gains tax rates for 2026?

For a single filer, 0% applies up to $49,450 of taxable income, 15% up to $545,500, and 20% above that. For married couples filing jointly the lines are $98,900 and $613,700.

Is exactly one year long-term?

No. The IRS treats a holding period of one year or less as short-term. You need to hold the shares for more than one year to get long-term rates.

Do I pay tax if I lose money on a stock?

No. A loss is not taxed, and it can reduce your tax. Losses first offset your capital gains. If losses are larger, up to $3,000 of the extra ($1,500 if married filing separately) can come off your other income each year.

What happens to a stock loss above the yearly limit?

It carries forward. You can use the unused part of a net capital loss in later years, under the same yearly limit.

What is a wash sale?

It is selling shares at a loss and buying substantially identical shares within 30 days before or after the sale. The IRS does not let you deduct that loss. The disallowed loss is added to the cost of the new shares.

Do trading fees reduce my taxable gain?

Yes. The IRS counts commissions paid to buy a stock as part of its cost, and selling expenses such as broker fees come off the sale proceeds. That is why the tax here is worked out on the profit after fees.

Sources

Figures last checked against these sources on October 10, 2026. This page gives general information and estimates, not tax, legal or financial advice.