๐ Stock Profit & Loss Calculator
Calculate net profit, ROI, and break-even price for any stock position.
Proceeds = (Sell ร Shares) โ Sell Fees
P&L = Proceeds โ Cost
Profit and loss calculations include commissions in cost basis and proceeds. For tax treatment of capital gains, see IRS Topic 409: Capital Gains and Losses. This calculator does not account for taxes, wash-sale rules, or currency conversion. For educational purposes only โ results do not constitute financial advice. About our methodology.
What This Calculator Does
The Stock Profit & Loss Calculator measures the financial outcome of a single stock trade. Enter your buy price, sell price, number of shares, and any commissions paid to buy or sell. The calculator returns your net profit or loss in dollars, your return on investment as a percentage, your total cost basis, and the breakeven price per share.
It is useful in three situations: evaluating a completed trade to understand exactly what you made or lost, planning an exit target before you sell to know what price you need to hit a specific return, and understanding how commissions affect your actual profit when you pay them.
The chart below the results shows your net P&L across a range of exit prices, from half your buy price to double it, so you can see how the outcome changes at different sell prices.
How the Calculation Works
The calculator uses three steps.
Cost basis: Multiply your buy price by the number of shares, then add the buy commission. This is the total amount you paid to acquire the position.
Net proceeds: Multiply your sell price by the number of shares, then subtract the sell commission. This is the total amount you received from the sale.
Net P&L: Subtract cost basis from net proceeds. If the result is positive, the trade was profitable. If negative, you took a loss.
Return % = (Net P&L / Cost Basis) × 100
Breakeven price per share = Cost Basis / Number of Shares
Worked example using the default values: You buy 100 shares at $150.00. Cost basis = $150 × 100 = $15,000. You sell at $185.00. Net proceeds = $185 × 100 = $18,500. Gross profit = $18,500 - $15,000 = $3,500. Return = $3,500 / $15,000 = 23.33%. With no commissions, the breakeven price is simply $150.00 per share.
Cost Basis and Trading Fees
Cost basis is the total amount you paid to acquire your shares, including commissions. It matters for tax purposes because capital gains are calculated as sale proceeds minus cost basis. A higher cost basis means a smaller taxable gain or a larger deductible loss.
Buy commissions are added to cost basis, which raises your breakeven price. Sell commissions reduce your net proceeds, which lowers your realized profit. Both effects are included in this calculator.
As a concrete example: if you pay a $9.99 commission to buy 100 shares at $150, your cost basis becomes $15,009.99 instead of $15,000. Your breakeven price rises from $150.00 to $150.10 per share. That $0.10 difference seems small, but on a smaller position or with larger commissions it can meaningfully change the math.
For most trades today, commissions are $0. Robinhood launched commission-free trading in 2013. In October 2019, Fidelity, Schwab, and TD Ameritrade each eliminated commissions on U.S. stock and ETF trades within days of one another. The default buy and sell fees in this calculator are both $0.00 to reflect that reality, but the fields are available if you use a broker that still charges, or if you want to model the effect of a per-trade fee on your returns.
How Stock Profits Are Taxed
The IRS distinguishes between short-term and long-term capital gains based on how long you held the asset before selling.
Short-term capital gains apply to assets held for one year or less. These gains are taxed as ordinary income at your marginal rate, which can reach 37% for high earners under current law.
Long-term capital gains apply to assets held for more than one year. These qualify for preferential tax rates: 0%, 15%, or 20%, depending on your taxable income and filing status. Most middle-income investors pay 15%.
One important rule to keep in mind is the wash-sale rule. If you sell a security at a loss and then buy the same or a substantially identical security within 30 days before or after the sale, you cannot claim that loss for tax purposes. The disallowed loss is instead added to the cost basis of the replacement shares. This rule is designed to prevent investors from harvesting losses while maintaining their market position.
For full details on capital gains rates and rules, see IRS Topic 409: Capital Gains and Losses.
This calculator shows gross profit and loss before tax. It does not compute your tax liability, account for the wash-sale rule, or factor in state income taxes. Use the results here as a starting point and consult a tax professional for guidance specific to your situation.
Frequently Asked Questions
How do I calculate profit or loss on a stock trade?
Subtract your total cost (buy price × shares + buy commission) from your net proceeds (sell price × shares - sell commission). A positive result is a profit; a negative result is a loss. For example, buying 100 shares at $150 and selling at $185 with no fees produces a $3,500 profit.
What is cost basis and why does it matter?
Cost basis is the total amount you paid to acquire your shares, including any commissions paid at purchase. It is the reference point used to calculate your capital gain or loss for tax purposes. A higher cost basis means a smaller taxable gain when you sell.
How do trading fees affect my actual profit?
Buy commissions increase your cost basis, raising your breakeven price. Sell commissions reduce your net proceeds. Both effects reduce your net profit. If you pay $9.99 to buy and $9.99 to sell, your net profit is reduced by $19.98. At $0 commissions your gross and net profit are the same.
What is the breakeven price on a stock position?
The breakeven price is the sell price at which your trade produces exactly $0 profit. It equals your cost basis divided by the number of shares. With no commission on 100 shares bought at $150, the breakeven is $150.00. If you paid a $9.99 buy commission, the breakeven rises to $150.10.
How are stock profits taxed?
Profits on shares held one year or less are taxed as ordinary income (up to 37%). Profits on shares held more than one year qualify for long-term capital gains rates of 0%, 15%, or 20% depending on your income. Losses can offset gains, subject to wash-sale rules. See IRS Topic 409 for current rates.