How to Calculate Stock Profit

By Inyoung Hwang · May 04, 2021 · 7 minute read

We’re here to help! First and foremost, SoFi Learn strives to be a beneficial resource to you as you navigate your financial journey. Read more We develop content that covers a variety of financial topics. Sometimes, that content may include information about products, features, or services that SoFi does not provide. We aim to break down complicated concepts, loop you in on the latest trends, and keep you up-to-date on the stuff you can use to help get your money right. Read less

How to Calculate Stock Profit

You’ve just sold some of your stocks and were lucky enough to make a profit. Now it’s time to find out exactly how much money you made.

Doing so not only helps you understand how much cash you’ll have to spend, more important, it tells you how much money you owe in taxes so you don’t run afoul of good old Uncle Sam. Here’s a closer look at how to figure out profits from stock investments.

How Do You Calculate Stock Profit

Investors need two numbers to calculate the percentage gain from their stock investments: 1). The original purchase price of the shares, and 2). The price at which the shares were sold at.

Formula For Calculating Stock Profit or Loss

Here is the formula for calculating the percentage move of your stock holdings. Calculating the percentage move will help figure out whether an investor had a good return on investment.

(Price sold – Purchase price)/(Purchase price) X 100% = Percentage move

The important thing about this formula is to always have the purchase price in the denominator. That way the move in the shares is always divided by what an investor paid for them.

Calculating Stock Profit Example

Here’s a hypothetical example of using the formula above but incorporating the number of shares an investor may hold. This will give the total dollar profit as well as the percentage move.

1. Let’s say an investor owns 100 shares of Stock ABB, which they bought at $20 a share.
2. The investor sells all 100 of their shares when the stock is trading at $23.
3. Ignoring any potential fees, commissions or taxes from this hypothetical example, the investor pockets a tidy profit of $3 per share.
4. Divide $3 by the original purchase price of $20 equals 0.15, which leads to a 15% gain.

Calculating Stock Loss Example

Now let’s look at an example where Stock ABB declines.

1. Again, an investor owns 100 shares of Stock ABB, which they bought at $20.
2. But this time, the investor sells all 100 shares at $18.
3. This means, the investor has to subtract $20 from $18 to get negative $2.
4. Dividing negative $2 by the original purchase price of $20 and then multiplying by 100, the loss equals 10%.

Other Income From Stocks

You may receive income from some stock holdings in the form of dividends, which are unrelated to the sale of the stock. A dividend is a distribution of a portion of a company’s profits to a certain class of its shareholders. Dividends may be issued in the form of cash or additional shares of stock.

While dividends represent profit from a stock, they are not capital gains. Dividends can be classified as either qualified or ordinary dividends, which are taxed at different rates. Ordinary dividends are taxed at regular income tax rates.

Qualified dividends that meet certain requirements are subject to the preferential capital gains tax rates. Taxpayers are responsible for identifying the type of dividends they receive and reporting that income on Form 1099-DIV.

Brokerage Fees or Commissions

Then there are brokerage account fees or commissions that you might have paid when you bought the stock. You may have already forgotten about these costs, but they do have an effect on your investment’s profitability and depending on their size, could make a profitable trade unprofitable.

You could tally all the fees you paid and subtract that sum from your profit to find out what your net gain was. Note that your brokerage account may do these calculations for you, but you might want to know how to do them yourself to have a better understanding of how the process works.

Before you bust out a pen, paper, and calculator, however, it might be easier to check and see if an online calculator option is available through your broker.

Some brokerage firms offer zero commission trading, but they may be engaging in a practice called payment for order flow, where your orders are sent to third parties in order to be executed.

Recommended: How to Buy Fractional Shares

Capital Gains Taxes

You can subtract the cost basis from total proceeds to calculate what you’ve made. If the proceeds are greater than the cost basis, you’ve made a profit, also known as a capital gain. At this point, the government will take a slice of the pie—you’ll owe taxes on any capital gains you make.

Capital gains tax rates are the rates at which you’re taxed on the profit from selling your stock, in addition to other investments you may hold such as bonds and real estate. You are only taxed on a stock when you sell and realize a gain, and then you are taxed on net gain, which is the difference between gains and losses.

You can deduct capital losses from your gains every year. So if some stocks sell for a profit, while others sell for an equal loss, your net gain could be zero, and you’ll owe no taxes on these stocks.

Short-Term vs. Long-Term Capital Gains Taxes

There are two types of capital gains tax that might apply to you: short-term and long-term investment capital gains tax. If you sell a stock you’ve held for less than a year for a profit, you realize a short-term capital gain.

If you sell a stock you’ve held for more than a year and profit on the sale, you realize a long-term capital gain. Short-term capital gain tax rates can be significantly higher than long-term rates. These rates are pegged to your tax bracket, and they are taxed as regular income.

So, if your income lands you in the highest tax bracket, you will likely pay a short-term capital gains rate equal to the highest income tax rate—which is quite a bit higher than the highest long-term capital gains rate.

Long-term capital gains, on the other hand, are given preferential tax treatment. Depending on your income and your filing status, you could pay 0%, 15% or a maximum of 20% on gains from investments you’ve held for more than a year.

Investors may choose to hold on to stocks for a year or more to take advantage of these preferential rates and avoid the higher taxes that may result from the swift buying and selling of stocks inside a year.

When Capital Gains Tax Doesn’t Apply

There are a few rare instances when you don’t have to pay capital gains tax on the profits you make from selling stock, namely inside of retirement accounts.

The government wants you to save for retirement, so they’ve come up with tax-advantaged investment accounts to encourage you to do so, including 401(k)s and individual retirement accounts.

You fund tax-deferred accounts such as 401(k)s and traditional IRAs with pre-tax dollars, which helps lower your taxable income in the year you make a contribution. You can then buy and sell stocks inside the accounts without incurring any capital gains tax.

These tax-deferred returns can give your savings an extra boost, potentially helping it grow faster than it would in a regular brokerage account. As tax-deferred returns are reinvested, investors are able to take greater advantage of the magic of compounding interest—the returns investors earn on their returns.

Tax-deferred accounts don’t allow you to escape taxes entirely however, when you make qualified withdrawals after age 59½, you are taxed at your regular income tax rate. Roth accounts, such as Roth IRAs function slightly differently. You don’t escape taxes here either, but you fund these accounts with after-tax dollars.

Then you can then buy and sell stocks inside the account where they can grow tax-free. Once again, you won’t owe any capital gains on returns you make inside the account, and when you make withdrawals at age 59½, you won’t own any income tax either.

Understanding Capital Losses

Now, let’s take a closer look at capital losses. You may be wondering why it would ever make sense to take a capital loss since they are essentially a negative profit. However, capital losses could be an important tool to help you manage your taxes.

Capital losses can be used to offset gains from the sale of other stocks. Say you sold Stock ABB for a profit of $15 and Stock CDD from another company for a loss of $10. The resulting taxable amount is now $5, or $15 minus $10.

In some cases, total losses will be greater than total gains. When this happens, you may be able to deduct excess capital losses against other income.

The amount of losses you can deduct in a given year is limited. However, if you go over this limit, any excess to reduce capital gains in subsequent years could be rolled over into the next year.

There are other limitations with claiming capital losses. The wash sale rule, for example, prohibits claiming a full capital loss after selling securities at a loss and then buying “substantially identical” stocks within a 30-day period.

The rule essentially closes a loophole, preventing investors from selling a stock at a loss only to immediately buy the same security again, leaving their portfolio essentially unchanged while claiming a tax benefit. One way investors try to defer taxes is through automated tax loss harvesting, or strategically taking some losses in order to offset taxable profits from another investment.

When to Consider Selling a Stock

There are a number of reasons investors may choose to sell their stocks and collect a profit. First, they may simply need the money to meet a personal goal, like making a down payment on a home or buying a new car. Investors with retirement accounts may start to liquidate assets in their accounts once they retire and need to make withdrawals.

Investors may also choose to sell stocks that have appreciated considerably. Stocks that have made significant gains can shift the asset allocation inside an investor’s portfolio. The investor may want to sell stocks and buy other investments to rebalance the portfolio, bringing it back in line with their goals, risk tolerance, and time horizon.

This strategy may give investors the opportunity to sell high and buy low, using appreciated stock to buy new, potentially cheaper, investments. That said, investors might want to avoid trying to time the market, buying and selling based on an attempt to predict future price movements. It’s hard to know what the market or any given stock will do in the future.

As a result, timing the market could backfire, leading investors to make expensive mistakes like selling when prices are low and buying as prices are reaching their peak.

Sometimes investors may decide that buying a certain stock was a mistake. It may not be the right match for their goals or risk tolerance, for example. In this case, they may decide to sell it, even if it means incurring a loss.

The Takeaway

Calculating your profit can tell you how much money you made and could help you figure out how much you owe in taxes. However, it doesn’t tell you much about how well your stock performed. Calculating percentage gain and loss could be an important tool when comparing how one stock fared against another.

The calculation is simple. First, calculate gain, subtracting the purchase price from the price at which you sold your stock. Remember that if you took a loss, this number could be negative. Now, divide the gain by the original purchase price. Multiply by 100 to get a percentage that represents the change in your investment.

With this percentage in hand, you now might have an idea of how different stocks you’ve sold performed against each other. For example, if one stock had a percent gain of 15% and another had a percent gain of 12%, you could quickly tell that the first stock performed better.

Ready to start online investing? You can invest your way—all in one place with SoFi Invest®. Do it yourself by choosing stocks, ETFs, fractional shares and crypto, or let us build a portfolio for you with Automated Investing.

Get started trading stocks and crypto with SoFi today.

SoFi Invest®
The information provided is not meant to provide investment or financial advice. Investment decisions should be based on an individual’s specific financial needs, goals and risk profile. SoFi can’t guarantee future financial performance. Advisory services offered through SoFi Wealth, LLC. SoFi Securities, LLC, member FINRA / SIPC . SoFi Invest refers to the three investment and trading platforms operated by Social Finance, Inc. and its affiliates (described below). Individual customer accounts may be subject to the terms applicable to one or more of the platforms below.
1) Automated Investing—The Automated Investing platform is owned by SoFi Wealth LLC, an SEC Registered Investment Advisor (“Sofi Wealth“). Brokerage services are provided to SoFi Wealth LLC by SoFi Securities LLC, an affiliated SEC registered broker dealer and member FINRA/SIPC, (“Sofi Securities).
2) Active Investing—The Active Investing platform is owned by SoFi Securities LLC. Clearing and custody of all securities are provided by APEX Clearing Corporation.
3) Cryptocurrency is offered by SoFi Digital Assets, LLC, a FinCEN registered Money Service Business.
For additional disclosures related to the SoFi Invest platforms described above, including state licensure of Sofi Digital Assets, LLC, please visit Neither the Investment Advisor Representatives of SoFi Wealth, nor the Registered Representatives of SoFi Securities are compensated for the sale of any product or service sold through any SoFi Invest platform. Information related to lending products contained herein should not be construed as an offer or pre-qualification for any loan product offered by SoFi Lending Corp and/or its affiliates.
Tax Information: This article provides general background information only and is not intended to serve as legal or tax advice or as a substitute for legal counsel. You should consult your own attorney and/or tax advisor if you have a question requiring legal or tax advice.
Disclaimer: The projections or other information regarding the likelihood of various investment outcomes are hypothetical in nature, do not reflect actual investment results, and are not guarantees of future results.

All your finances.
All in one app.

SoFi QR code, Download now, scan this with your phone’s camera

All your finances.
All in one app.

App Store rating

SoFi iOS App, Download on the App Store
SoFi Android App, Get it on Google Play

TLS 1.2 Encrypted
Equal Housing Lender