🇺🇸 United States

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.

$
$
$
Most brokers: $0 (commission-free)
$
Most brokers: $0 (commission-free)
Long-term = lower tax rate
$
---

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:

Cost Basis = (Buy Price × Shares) + Buy Commission
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.

Cost basis$5,000
Proceeds$7,500
Gross profit$2,500
LTCG rate (15%)$375 tax
Net profit after tax$2,125
Effective return42.5%

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.

FAQ

Stock profits (capital gains) are taxed when you sell. Short-term gains (held less than 1 year) are taxed as ordinary income at your marginal rate (10%–37% in 2026). Long-term gains (held 1 year or more) get preferential rates: 0%, 15%, or 20% depending on your taxable income. High earners may also owe the 3.8% Net Investment Income Tax (NIIT).
The holding period determines your tax rate. If you hold a stock for less than 1 year before selling, the gain is short-term and taxed at your ordinary income rate (up to 37%). If you hold for 1 year or more, the gain is long-term and taxed at 0%, 15%, or 20%. For 2026, the 0% LTCG rate applies up to $48,350 (single) or $96,700 (MFJ) in taxable income.
The wash sale rule (IRC §1091) prevents you from claiming a tax loss if you buy the same or “substantially identical” security within 30 days before or after the sale. The disallowed loss is added to the cost basis of the replacement shares. This applies to stocks, ETFs, and mutual funds but not to cryptocurrency under current law (as of 2026).
If your capital losses exceed your capital gains in a tax year, you can deduct up to $3,000 ($1,500 if married filing separately) of the excess loss against your ordinary income. Any remaining losses carry forward to future tax years indefinitely. For example, if you have $10,000 in losses and $0 in gains, you deduct $3,000 this year and carry $7,000 forward.
The NIIT is an additional 3.8% tax on the lesser of your net investment income or your modified adjusted gross income (MAGI) above the threshold: $200,000 for single filers, $250,000 for married filing jointly, and $125,000 for married filing separately. It applies to capital gains, dividends, interest, rental income, and other investment income (IRC §1411).

Related Calculators

Add This Calculator to Your Website

Embed the sum.money Stock Profit Calculator on your site. Free, responsive, always up-to-date.

<iframe src="https://sum.money/embed/us/stock-profit-calculator" width="100%" height="600"></iframe>