Stock Profit Calculator
Calculate your stock gain or loss after capital gains tax. Compare short-term vs long-term rates, run what-if scenarios at different sell prices, and analyze your full portfolio.
Try another scenario
How to Use This Calculator
Profit/Loss tab
The default tab. Enter your buy price, number of shares, and sell price. The calculator shows your gross profit or loss, estimated capital gains tax, net profit after tax, and effective return. Expand "More options" to add commissions, set holding period (short-term vs long-term), income, and filing status for accurate tax estimates.
What-If Scenarios tab
See a table of outcomes at different sell prices: -20%, -10%, current, +10%, +20%, +50%, and +100% of your buy price. Each row shows gross profit, estimated tax, and net profit. The calculator also finds your break-even sell price after accounting for capital gains tax.
Portfolio Gain tab
Add up to 5 stock positions with individual buy/sell prices and share counts. The calculator computes per-position and total portfolio gain/loss, nets gains against losses, estimates tax on the net gain, and shows your total effective return.
Share your result
Every input is encoded in the URL. Click Share to send your exact scenario to a friend, financial advisor, or tax professional.
The Formula
Stock profit calculation with capital gains tax:
Proceeds = (Sell Price × Shares) - Sell Commission
Gross Profit/Loss = Proceeds - Cost Basis
If Gain, Short-term: Tax = Gain × Marginal Income Tax Rate
If Gain, Long-term: Tax = Gain × LTCG Rate (0% / 15% / 20%)
+ NIIT (3.8%) if MAGI > $200K single / $250K MFJ
Net Profit = Gross Profit - Estimated Tax
Effective Return = Net Profit ÷ Cost Basis × 100
If Loss: Deduct up to $3,000/yr ($1,500 MFS) against ordinary income
Excess losses carry forward indefinitely
The key difference between short-term and long-term holding periods is the tax rate. Short-term gains (held less than 1 year) are taxed at your ordinary income rate (up to 37%), while long-term gains get preferential rates of 0%, 15%, or 20%.
Example
Alex in Chicago — bought 100 shares of NVDA at $50, selling at $75 after 14 months (long-term)
Alex earns $75,000/yr, files Single. He bought 100 shares at $50 ($5,000 cost basis) and sells at $75 ($7,500 proceeds) after holding for 14 months, qualifying for long-term capital gains rates.
Alex keeps $2,125 of his $2,500 gain — an effective return of 42.5% on his original investment. Because he held for over 1 year, he pays the 15% LTCG rate instead of his 22% marginal income tax rate, saving $175 in taxes.