Skip to content
Calc.

Stock Profit/Loss Calculator

Work out the profit or loss on a stock trade from the buy price, sell price, number of shares and any commissions or fees.

Last updated: October 2026

Profit or loss after fees

$700.00

This calculator gives an estimate for general information only. It is not financial, tax or investment advice. Check the figures with a qualified professional before making decisions, and follow the rules that apply where you live.

Formula below · 2 sources (IRS, finra.org) · Updated Oct 2026

Compare with similar

About this calculator

This calculator works out what a stock trade made or lost: the change in price times the number of shares, minus what you paid in commissions and fees.

The formula

Profit or loss = (sell price − buy price) × shares − fees. A positive number is a gain and a negative number is a loss. Return on the trade = profit ÷ (buy price × shares) × 100. Buying 100 shares at $45 and selling at $52 makes (52 − 45) × 100 = $700, a 15.6% return on the $4,500 invested.

How the IRS sees the same trade

For taxes, your gain is the amount you realized from the sale minus your adjusted basis. The IRS says the basis of stock is generally the purchase price plus costs of purchase such as commissions, and selling costs reduce the amount realized, so including fees here matches how a gain is reported on Form 8949 and Schedule D. Stock splits, reinvested dividends and spin-offs change the basis per share; your broker's cost-basis report tracks those.

Short-term or long-term

A stock held for one year or less gives a short-term gain, taxed at your ordinary income rate. Held for more than one year, the gain is long-term and usually taxed at a lower capital gains rate. Losses first offset gains; up to $3,000 of net capital loss a year ($1,500 if married filing separately) can be deducted from other income and the rest carried forward.

Limits

The result is before tax and ignores dividends received while you held the shares. Short sales, options and trades in foreign currencies need different math. This is an estimate, not tax or investment advice.

How the IRS treats a gain by holding period

Scroll sideways to see all columns →

Held forType of gainHow it is taxed
One year or lessShort-termAt your ordinary income tax rate
More than one yearLong-termAt capital gains rates (0%, 15% or 20% for most taxpayers)
Net loss for the yearCapital lossUp to $3,000 a year deductible ($1,500 married filing separately); the rest carries forward
Source: IRS — Topic no. 409, Capital gains and losses

How to use

Enter the price you paid per share, the price you sold at (or a target price), the number of shares and the total commissions and fees for both sides of the trade. The defaults, 100 shares bought at $45 and sold at $52 with no fees, show a $700 profit. Add $10 of fees and the profit drops to $690. The return tile under the result divides the profit after fees by the amount invested (buy price × shares): $700 on $4,500 is a 15.56% return.

Frequently asked questions

How do I calculate the percentage return on a stock?

Divide the profit by the amount you invested (buy price × shares) and multiply by 100. A $700 profit on a $4,500 purchase is a 15.6% return. Percentages let you compare trades of different sizes.

Should I include commissions and fees?

Yes, if you paid any. The IRS adds purchase commissions to your cost basis and subtracts selling costs from the sale amount, so your taxable gain is the price gain minus those costs. Enter the total for both trades in the fees box.

How long do I have to hold a stock for a long-term gain?

More than one year. Shares held for one year or less produce a short-term gain, taxed as ordinary income; shares held longer qualify for long-term capital gains rates, which are lower for most people.

Can a loss on a stock reduce my taxes?

Capital losses offset capital gains, and if losses are larger you can deduct up to $3,000 a year ($1,500 if married filing separately) against other income. Unused losses carry forward to later years.

Related calculators

Sources & references

How we check our calculators

Think a result is wrong? Report a problem with this calculator.