Stock Profit Calculator
Calculate stock profit with detailed breakdown of inputs, totals, and reference data.
How to Calculate Profit or Loss on a Stock Trade?
Subtract the total purchase cost (shares x buy price + commission) from the total sale revenue (shares x sell price - commission). The calculator above computes your total invested amount, total revenue, dollar profit or loss, and percentage ROI from the share count, buy price, sell price, and any trading fees. Use it to evaluate closed positions, model hypothetical trades, or determine what sell price you need to reach a target profit level.
A Complete Trade Example with All Costs
Buy 100 shares of a stock at $45.00 per share. Commission: $0 (most major brokers). Total invested: $4,500. Sell 100 shares at $58.50. Commission: $0. Total revenue: $5,850. Gross profit: $1,350 (30% return). But taxes reduce the net gain. If held over 12 months (long-term capital gains): 15% federal tax = $202.50. Net profit: $1,147.50. If held under 12 months (short-term, taxed as ordinary income at 22% bracket): $297 tax. Net profit: $1,053. The holding period affects your after-tax return by $94.50 on this trade alone.
Understanding Capital Gains Tax on Stock Profits
Short-term capital gains (assets held under 1 year) are taxed at your ordinary income tax rate: 10-37% depending on income. Long-term gains (held over 1 year) receive preferential rates: 0% for taxable income up to $47,025 (single) or $94,050 (married filing jointly), 15% up to $518,900 (single), and 20% above that threshold. High earners also pay a 3.8% Net Investment Income Tax. State taxes add another 0-13.3% depending on your state. The tax difference between short and long-term creates a strong incentive to hold profitable positions for at least 12 months and one day before selling.
Break-Even Price After Buying
Your break-even price must cover the purchase cost plus any fees, divided by the number of shares. With $0 commission brokers, break-even equals the purchase price exactly. With a $10 commission each way: buy 100 shares at $45 ($4,510 total), break-even sell price = $4,520 / 100 = $45.20. The impact of commissions is proportionally larger on small trades and nearly invisible on large ones. A $10 commission on a $500 trade is 2% (requiring a 4% round-trip gain just to break even), while on a $50,000 trade it is 0.02%. This math explains why frequent small trades with legacy brokers eroded returns for retail investors before commission-free trading became standard.
Dollar Cost Averaging and Multiple Purchase Lots
When you buy the same stock at different prices over time, your cost basis is the weighted average. Buying 50 shares at $40 and 50 shares at $50 gives an average cost of $45.00 per share, not $45. But buying 30 shares at $40 and 70 shares at $50 gives a weighted average of $47.00. The formula: total dollars spent / total shares owned. $1,200 + $3,500 = $4,700 / 100 shares = $47.00. When selling partial positions, you can choose which lots to sell (specific identification) to optimize the tax outcome - selling the highest-cost lot first minimizes the taxable gain.
Dividends and Their Effect on Total Return
Stock profit calculations often focus solely on price appreciation, but dividends contribute significantly to total return. A stock purchased at $50 that pays $2 per year in dividends and is sold at $55 after 3 years: price appreciation = $5 (10%), dividends = $6 (12%), total return = $11 (22%). Historically, dividends have contributed 30-50% of the S&P 500 total return over long periods. Reinvested dividends compound the effect further. Ignoring dividends when calculating investment performance significantly understates the actual return, especially for dividend-focused stocks and index funds.
Tax-Loss Harvesting Strategy
Selling a losing position crystallizes a capital loss that can offset capital gains from winning trades. If you have $5,000 in realized gains and $3,000 in realized losses, you pay tax on only $2,000 net gain. If losses exceed gains, you can deduct up to $3,000 against ordinary income per year, carrying excess losses forward indefinitely. This strategy does not require abandoning the investment permanently - you can repurchase a similar (but not "substantially identical") investment 31 days after the sale to avoid the wash sale rule, maintaining your market exposure while capturing the tax benefit.
Position Sizing and Risk Management
Professional traders typically risk 1-2% of their total portfolio on any single trade. On a $50,000 portfolio, the maximum acceptable loss per trade is $500-$1,000. If buying a stock at $45 with a stop-loss at $42 (a $3 risk per share), position size = $1,000 / $3 = 333 shares maximum ($14,985). This disciplined approach prevents any single losing trade from significantly damaging the portfolio. Retail investors who concentrate too heavily in one position - buying $25,000 of a single stock in a $50,000 portfolio - face catastrophic risk if that company encounters unexpected problems.
Frequently asked questions
How do I calculate stock profit?
What is the capital gains tax rate?
What is cost basis for multiple purchases?
Should I include dividends in profit calculations?
What is the wash sale rule?
How much should I risk per trade?
Rate This Calculator
Your feedback helps us improve our tools