How to calculate stock profit


Written by:

You’ve just sold some of your stocks and were lucky enough to make a profit. Now, like Scrooge McDuck rubbing his hands together with dollar signs in his eyes, 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.

Calculating your profit

How investors receive returns varies depending on the investments they hold. One way investors profit from stock investments is by selling appreciated stocks — those for which the stock price has risen since the shares were purchased.

To calculate your total profit, you first need to know where you started. Once you identify the price per share you paid when you initially bought your stock, you could multiply the number of shares you own by this starting share price.

The resulting number is what is known as the basis. If you bought shares of a company at different times and prices, this calculation should be run separately for each transaction.

Next, you could multiply the number of shares you sold by the price per share at the time of the sale to find your total proceeds from the sale.

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. It is also possible that the cost basis could be greater than the proceeds, in which case profit will be negative, also known as a capital loss.

Uncle Sam isn’t the only one who might take a bite out of profits. The basis calculation most likely includes brokerage fees or commissions 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 understand better how the process works.

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

You could also do these calculations before you sell your stocks to help you figure whether it makes sense to do so based on the potential return on investment.

In that case, you could replace the sale price in the above calculations with the current market value. Market value is constantly fluctuating a little bit, so this calculation might only give you a close approximation of what your profit would be if you were to sell your stocks at that moment.

Calculating gain as a percentage

Calculating your profit can tell you how much money you made and 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 basis 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 amount of the investment. 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, assuming they were purchased and sold simultaneously.

Capital gains taxes

Capital gains tax is the tax you pay 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.

There are two types of capital gains tax that might apply to you: short-term and long-term 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 onto 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.

Understanding capital losses

So far, we’ve mentioned capital losses a couple of times – let’s take a closer look at them. 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 one stock for a profit of $15 and stock 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 repurchase the same security, leaving their portfolio essentially unchanged while claiming a tax benefit.

Tax laws can get a bit complicated. You may want to consult a tax professional to help you decide whether tax strategies involving capital gains and losses are right for you.

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 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, IRAs, and Roths.

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 contribute. 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 them grow faster than they would in a regular brokerage account. As tax-deferred returns are reinvested, investors can 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.

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.

When to consider selling a stock

There are several reasons investors may choose to sell their stocks and collect a profit. 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 allow investors 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.

Learn more:

This article originally appeared on and was syndicated by

External Websites: The information and analysis provided through hyperlinks to third-party websites, while believed to be accurate, cannot be guaranteed by SoFi. Links are provided for informational purposes and should not be viewed as an endorsement.
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.
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 are offered through SoFi Wealth, LLC. SoFi Securities, LLC, member FINRA/SIPC. The umbrella term “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.

Main Image Credit: GaudiLab / iStock.