๐Ÿ“ˆStock Profit Calculator

Calculate profit or loss on a stock investment, including commissions, annualized return, and estimated capital gains tax on your gains.

Prefer to skip the form? Scroll down and Ask AI Instead. Just describe your situation and let AI handle the math for you in seconds.

Profit / Loss

$2,700.00

You earned $2700.00 (60.0% ROI, 26.5% annualized). After estimated 15% long-term capital gains tax: $2295.00.

Gross Profit / Loss$2,700.00
Total ROI60
Annualized Return (CAGR)26.491106406735177
Total Cost Basis$4,500.00
Total Sale Proceeds$7,200.00
Capital Gains Tax Rate (est.)15
Estimated Capital Gains Tax$405.00
After-Tax Profit$2,295.00
Gain TypeLong-term

Investment Breakdown

Advertisement

728 ร— 90

โœฆ Ask AI Instead

Stock Profit Calculator: How to Calculate Stock Gains and Losses

A stock profit calculator does more than subtract your buy price from your sell price. To know your true investment return, you need to account for the number of shares you own, any trading commissions, your holding period, and the capital gains taxes that apply when you sell. This tool helps you calculate stock gains and losses accurately so you can measure portfolio performance and plan for tax time without surprises.

Stock Profit and Loss Calculator with Buy and Sell Price

The foundation of any stock gain or loss calculation is your cost basis and your net sale proceeds.

  • Total cost basis = (Buy price x number of shares) + buy commission
  • Net sale proceeds = (Sell price x number of shares) - sell commission
  • Profit or loss = Net sale proceeds - Total cost basis

For example: you buy 100 shares at a buy price of $45 with a $5 trading commission. Your total cost basis is (100 x $45) + $5 = $4,505. You sell those 100 shares at a sell price of $72 with no commission. Your net sale proceeds are 100 x $72 = $7,200. Your gross profit is $7,200 - $4,505 = $2,695.

Trading commission costs were significant before most major US brokerages moved to zero-commission stock trades. Even at $0 per trade, commission fields remain relevant for investors using full-service advisors, trading on international platforms, or dealing with options contracts that still carry per-contract fees. Including buy and sell commissions in your cost basis is also an IRS requirement, not just a convenience.

The total invested figure (your cost basis) is the number you compare against your net proceeds to determine whether the trade was profitable. A positive result is a realized gain; a negative result is a realized loss. Both have tax implications worth understanding before you sell.

How to Calculate Return on a Stock Investment

A raw dollar profit figure is useful, but it does not tell you how efficiently your capital was deployed. Two return metrics give you a more complete picture.

Total ROI (Return on Investment)

Profit percentage = (Gross profit / Total cost basis) x 100. Using the example above, $2,695 / $4,505 = 59.8% total ROI. This tells you how much you made relative to what you put in, regardless of how long it took.

Annualized Return (CAGR)

The annualized return, or compound annual growth rate (CAGR), adjusts for time. It tells you the equivalent annual return your investment achieved, which is the standard for comparing stocks held for different periods against each other or against benchmarks like the S&P 500. The formula is: Annualized return = (Net proceeds / Cost basis)^(1 / years) - 1. A 59.8% total ROI over 2 years corresponds to an annualized return of about 26.5%, which means the investment doubled the cost basis in less than 3 years on an annualized basis. A 59.8% return over 10 years, by contrast, is only about 4.8% annualized, well below market average.

Always use annualized return when comparing any two investments held for different time periods. Raw profit percentage misleads when holding periods differ.

Stock Profit Calculator with Shares and Fees: Capital Gains Tax

Your profit percentage before tax and after tax can differ significantly depending on how long you held the stock. The IRS treats short-term and long-term capital gains at very different rates.

Short-Term Capital Gains (Held One Year or Less)

Stocks sold after a holding period of one year or less generate short-term capital gains, which are taxed as ordinary income at the same rates as your W-2 wages. Depending on your total taxable income, this can mean rates from 10% to 37%. A $2,695 gain taxed at 22% leaves you with $2,103 after tax.

Long-Term Capital Gains (Held More Than One Year)

Stocks held for more than one year qualify for preferential long-term capital gains rates of 0%, 15%, or 20%, depending on your taxable income. Most investors in the middle-income range pay 15%. That same $2,695 gain taxed at 15% leaves you with $2,291 after tax, which is $188 more than the short-term scenario, simply by holding the position a few extra months beyond the one-year mark.

The after-tax profit is your true realized gain, and it is what you can actually redeploy into your portfolio. Factor the capital gains tax rate into every sell decision, particularly when you are close to the one-year holding period threshold.

Realized Gain vs Unrealized Gain: Why It Matters

A realized gain occurs when you sell a stock and lock in the profit. At that point, the capital gains tax is triggered and must be reported. An unrealized gain exists on paper while you still hold the stock. Unrealized gains are not taxed in the current US tax system. This distinction matters for portfolio planning because you can defer capital gains taxes indefinitely by continuing to hold appreciating stocks, allowing your total invested capital to compound without an annual tax drag.

When you eventually sell, the entire gain since your original buy price is taxed at once. Some investors use charitable giving strategies (donating appreciated stock to avoid the capital gains event entirely) or estate planning strategies to manage large unrealized gains. For most investors, simply holding for more than one year to shift from short-term to long-term rates is the most accessible way to reduce the tax cost of a profitable trade.

How to Use This Calculator

Enter your buy price per share, sell price per share, and number of shares. Add any buy or sell commissions. Enter the holding period in years to determine whether short-term or long-term capital gains rates apply, and enter your annual taxable income to estimate the correct tax rate. The calculator returns your gross profit, total ROI, annualized return, estimated capital gains tax, and after-tax profit in one view, giving you a complete picture of the investment's real performance.

Frequently Asked Questions

How do I calculate my profit or loss on a stock?

Profit or loss = (Sell price x shares - sell commission) - (Buy price x shares + buy commission). This gives you the gross profit. To find the profit percentage, divide gross profit by your total cost basis and multiply by 100. For a more meaningful comparison across different holding periods, use the annualized return formula: (Net proceeds / Cost basis)^(1/years) - 1.

What is the difference between realized and unrealized gains?

A realized gain occurs when you sell a stock and actually receive the profit. At that point, capital gains tax is triggered. An unrealized gain is the increase in value of a stock you still hold. Unrealized gains are not taxed under current US law. You can defer taxes indefinitely by holding an appreciating stock, and your full cost basis compounds without an annual tax reduction. When you sell, the total gain from your original buy price is taxed as either short-term or long-term depending on the holding period.

How are stock profits taxed?

Stock profits are taxed as capital gains. If you held the stock for one year or less, gains are short-term and taxed as ordinary income at rates from 10% to 37%. If you held for more than one year, gains are long-term and taxed at 0%, 15%, or 20% depending on your total taxable income. Most middle-income investors pay 15% on long-term gains. High earners may also owe an additional 3.8% Net Investment Income Tax on gains above certain income thresholds.

How do I calculate my percentage return on a stock?

Total return percentage = (Gross profit / Total cost basis) x 100. For time-adjusted comparisons, use the annualized return: (Net proceeds / Cost basis)^(1/years) - 1, then multiply by 100. For example, a 60% total return over 3 years equals an annualized return of about 17.1%. Always compare investments using annualized returns when the holding periods differ, as raw profit percentages are misleading across different time frames.