SoFi student loan refi rates just dropped. Save even more and pay off debt faster. View your rate.

# How to Calculate Stock Profit

By Inyoung Hwang · August 08, 2024 · 13 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. 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.

To calculate stock profit, it’s a relatively simple calculation that involves taking the original price you paid for the stock and subtracting it from the price at which you sold it. So, if you paid \$50 per share and the stock is now worth \$55, your profit would be \$5 per share, minus applicable fees or commissions. If the stock price has dropped since you bought it, you would subtract the current price from the original price, to arrive at the amount of your loss.

Understanding the implications of those gains (or losses) in terms of dollar amounts as well as percentages — and what to do next — is another matter. In most cases you’ll owe taxes on your gains, and/or you can use losses to offset gains. But when and how is where investors need to pay attention.

Key Points

•   Calculating stock profit involves subtracting the purchase price from the selling price, resulting in either a gain or a loss based on market fluctuations.

•   Differentiating between realized and unrealized gains is crucial; only gains from sold stocks are considered realized and subject to taxes.

•   Investors can calculate percentage changes in stock value to compare performance, using the formula: ((Selling Price – Purchase Price) / Purchase Price) x 100.

•   Capital gains tax may apply to profits from sold stocks, with differing rates for short-term and long-term holdings based on the holding period.

•   Tax-loss harvesting allows investors to offset capital gains with losses, potentially reducing overall tax liability while adhering to specific rules like the wash-sale rule.

## How Do You Calculate Stock Profit?

As noted, calculating stock profit involves a simple calculation to find the difference between the current share price and the price you initially purchased it – often called the “cost basis.”

Given the history of the stock market, and the constant price fluctuations of almost every stock, most investors should expect the price of the shares they buy to change over time. The question for investors, however, is whether the change is positive (a profit) or negative (a loss).

### Realized Gains vs Unrealized Gains

Another question that’s critical for investors: Are those gains or losses realized or unrealized?

When a stock in your portfolio gains or loses value, but you hold onto it, that is considered an unrealized gain or loss. Your asset has appreciated in value, but you haven’t sold it to reap the benefits, or “realized” the gain. As such, you wouldn’t pay additional trading fees and you wouldn’t (yet) face any tax implications because you haven’t actually sold the shares.

If you sell the shares through an online brokerage account or other means, that’s when you realize (or take) the actual cash profit or loss in your account. At that point, trading fees and taxes would likely come into play.

## Formula to Calculate Percentage Gain or Loss of Stocks

Calculating stock profit can be done as a dollar amount or as a percentage change. The same is true of losses. While knowing the dollar amount that you’ve gained or lost is relevant for long-term planning and tax purposes, calculating the percentage change will help investors gauge whether one stock had good return when compared with another.

Percentage change = (Price sold – Purchase price) / (Purchase price) x 100

The important thing to remember about this formula is to always keep the purchase price (cost basis) in the denominator. That way the percentage change in the shares is always divided by what an investor paid for them.

### Calculating Stock Profit Example

Here’s a hypothetical example 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 A, which they bought at \$20 a share for a total of \$2,000.

2.    The investor sells all of their shares when the stock is trading at \$23, for \$2,300.

3.    Ignoring any potential investment fees, commissions, or taxes in this hypothetical example, the investor would see a gain of \$3 per share or \$300 in profit.

4.    What’s the percentage gain? (\$23 – \$20) / \$20 = 0.15 x 100 = 15 or a 15% gain.

### Calculating Stock Loss Example

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

1.    Here, an investor owns 100 shares of Stock B, which they bought at \$20.

2.    This time, the investor sells all 100 shares at \$18.

3.    This means, the investor has to subtract \$18 from \$20 to get a \$2 loss per share.

4.    What’s the percentage loss? (\$20 – \$18) / \$20 = 0.10 x 100 = 10, or a 10% loss.

As an investor, you can also compare your stock profit with the average historical stock return, that number has historically hovered around 9%.

And if you’re wondering about how to calculate stock profit when shorting stocks, note that that is a more complex investing strategy that requires a more careful and detailed understanding and calculation.

### Calculating Percentage Change in Index Funds and Indices

Index funds are mutual funds that track a specific market index, which means they include the companies or securities in that index. An S&P 500 index fund mirrors the performance of the companies in the S&P 500 Index.

To calculate the percentage change of your shares in an index fund, you can approach it the same way you would when you calculate profit or loss from a stock.

You can also calculate the difference between the percentage change of the index itself, between the date you purchased shares of the related index fund and sold them. Here’s an example, using the S&P 500 Index.

Let’s say the index was at 4,500 when you bought shares of a related index fund, and at 4,650 when you sold your shares. The same formula applies:

4,650 – 4,500 / 4,650 = 0.032 x 100 equals a 3.2% gain in the index, and therefore the gain in your share price would be similar. But because you cannot invest in an index, only in funds that track the index, it’s important to calculate index fund returns separately.

### Get up to \$1,000 in stock when you fund a new Active Invest account.*

#### Access stock trading, options, auto investing, IRAs, and more. Get started in just a few minutes.

*Customer must fund their Active Invest account with at least \$25 within 30 days of opening the account. Probability of customer receiving \$1,000 is 0.028%. See full terms and conditions.

## Importance of Calculating Stock Profit

Calculating stock profits (and losses) is important because it can help inform you of how successful your overall strategy has been. That can have a downstream effect in numerous areas:

•   Taxes owed

•   Your overall tax strategy (more on that below)

## How Are You Taxed on Profit From a Stock?

To determine any tax liability resulting from a stock-trade profit, you would start by subtracting the cost basis from the total proceeds to calculate what you’ve earned from a sale. 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 your 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 Tax

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 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 onto stocks for a year or more to take advantage of these preferential rates and avoid the higher taxes that may result from the buying and selling of stocks inside a year.

### When Capital Gains Tax Doesn’t Apply

There are a few 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 to incentivize people to save for retirement, so it encourages people to set up tax-advantaged retirement accounts, including 401(k)s and/or an individual retirement account, or IRA.

You fund tax-deferred accounts such as 401(k)s and traditional IRAs with pre-tax dollars, which may help 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.

Tax-deferred accounts don’t allow you to avoid 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 avoid taxes with these types of accounts, either, since you fund these accounts with after-tax dollars.

Then you can also buy and sell stocks inside a Roth account where any gains grow tax free. Once again, you won’t owe capital gains on profit you make inside the account. And in the case of a Roth, when you make withdrawals at age 59 ½ you won’t owe any income tax either.

Recommended: How to Open an IRA: A 5-Step Guide

## Understanding Capital Losses

Though it seems counterintuitive, capital losses may help investors manage their tax liabilities, thanks to a strategy called tax-loss harvesting.

Capital losses can be used to offset gains from the sale of other stocks. Say you sold Stock A for a profit of \$15 and Stock C 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 (i.e. a net capital loss). When this happens, you may be able to deduct excess capital losses against other income. If an investor has an overall net capital loss for the year, they can deduct up to \$3,000 against other kinds of income — including ordinary and interest income.

The amount of losses you can deduct in a given year is limited to \$3,000. However, additional losses can be rolled over and deducted on the following year’s taxes.

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.

Another 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.

## 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 and therefore fall into a different tax category. (Different types of investment income are taxed in different ways.) 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

Investors need to remember that there are brokerage account fees or commissions that you might have paid when you bought the stock. You may have overlooked these costs, but they do have an effect on your investment’s profitability and, depending on the amounts involved, these fees could make a profitable trade unprofitable.

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.

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.

## When to Consider Selling a Stock

There are a number of reasons investors may choose to sell their stocks, especially when they may generate a positive return. First, they may 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.

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

Assuming a stock’s price is higher when you sell it versus when you bought it, learning how to calculate stock profit is pretty easy. You simply subtract the original purchase price from the price at which you sold it. (If the selling price is lower than the purchase price, of course, you’d see a loss.)

It’s important to calculate stock profits and losses because it can impact your taxes. If you realize a gain, you may owe capital gains tax; if you realize a loss, you may be able to use the loss to offset your gains. Of course, if you’re trading stocks within an IRA, Roth IRA, or 401(k), you avoid any tax consequences.

Ready to invest in your goals? It’s easy to get started when you open an investment account with SoFi Invest. You can invest in stocks, exchange-traded funds (ETFs), mutual funds, alternative funds, and more. SoFi doesn’t charge commissions, but other fees apply (full fee disclosure here).

For a limited time, opening and funding an Active Invest account gives you the opportunity to get up to \$1,000 in the stock of your choice.

## FAQ

### Why is it important to calculate stock profit?

Investing in stocks comes with a certain amount of risk. It may help you to know what your gains and losses are so that you can gauge the winners and losers in your portfolio. Calculating stock profit also helps with tax planning and portfolio rebalancing.

### How can you calculate stock profit?

Calculating the dollar amount is relatively simple (you subtract the final selling price from the original purchase price, or vice versa). The formula for determining the percentage change is also straightforward:

(Price sold – Purchase price) / (Purchase price) x 100 = Percentage change

### What is an example of calculating stock profit?

An investor owns 100 shares of Stock X, which they bought at \$50 a share for a total of \$5,000. The price rises to \$55, a gain of \$5, and the investor sells all their shares for a \$500 profit (\$5,500 total), excluding commissions, taxes, fees.

What’s the percentage gain? (\$55 – \$50) / \$50 = 0.10 x 100 = 10 or a 10% gain.

SoFi Invest®

INVESTMENTS ARE NOT FDIC INSURED • ARE NOT BANK GUARANTEED • MAY LOSE VALUE

SoFi Invest encompasses two distinct companies, with various products and services offered to investors as described below: Individual customer accounts may be subject to the terms applicable to one or more of these platforms.
1) Automated Investing and advisory services are provided by SoFi Wealth LLC, an SEC-registered investment adviser (“SoFi Wealth“). Brokerage services are provided to SoFi Wealth LLC by SoFi Securities LLC.
2) Active Investing and brokerage services are provided by SoFi Securities LLC, Member FINRA (www.finra.org)/SIPC(www.sipc.org). Clearing and custody of all securities are provided by APEX Clearing Corporation.
For additional disclosures related to the SoFi Invest platforms described above please visit SoFi.com/legal.
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.

Financial Tips & Strategies: The tips provided on this website are of a general nature and do not take into account your specific objectives, financial situation, and needs. You should always consider their appropriateness given your own circumstances.

Claw Promotion: Customer must fund their Active Invest account with at least \$25 within 30 days of opening the account. Probability of customer receiving \$1,000 is 0.028%. See full terms and conditions.

SOIN-Q324-002

TLS 1.2 Encrypted
Equal Housing Lender