While many were stockpiling toilet paper as the pandemic escalated, others were adding more shares of Tesla (TSLA -3.57%) stock to their portfolios, waking up to triple-digit gains this summer that seemed too good to be true. The electric car maker announced a five-for-one stock split, and the stock jumped 74.2% in August alone. Tesla's meteoric rise left many investors with a tough decision: Should I sell, buy more, or hold? 

If the temptation of cashing in on quick profits caused you to sell shares of Tesla in a standard (taxable) brokerage account, the capital gains could affect your tax returns. Taxes are probably the last thing on your mind when you're winning big in the stock market. But all investors should know this to maintain their sanity: Selling stock is a taxable event. This additional income -- although unearned -- could easily put you in a higher tax bracket due to capital gains taxes.

Angled view of an electric vehicle connected to a power source at a charging station.

Image source: Getty Images.

The 411 on capital gains 

Capital gains are good -- they mean you've made some money in the stock market. When you sell a stock for more than you purchased it for, you have a capital gain. Let's say you bought Tesla stock for $400 and sold it for $2,000. That's a $1,600 capital gain

As much as you'd probably like to keep all the profits for yourself, the IRS believes that sharing is caring. Just like with other forms of income such as wages and dividends, you are required to share a percentage of your capital gains in the form of taxes -- at either short-term or long-term capital gains rates. If you held your investment for a year or less, you pay a short-term capital gains rate. If you invested for the long term (over a year), you'll unlock lower tax rates. 

Bad news: If you bought shares of Tesla in March and sold in September (holding your shares for only six months), your short-term capital gains will be included in your ordinary income. This means your profits will be taxed at ordinary income rates -- the same rates you pay on the wages you make from working a job. 

Debunking the tax bracket myth 

If you do sell enough Tesla shares that you're pushed into a higher tax bracket, don't worry -- you might not owe as much as you think. 

For example, if you are filing single for 2020 taxes and earned $40,000 in wages and $2,000 from short-term investments, your total taxable income would be $42,000 -- the 22% tax bracket. (See the chart below.) But let's clear up some confusion: Only a portion of your income will fall into that tax bracket.

You pay 10% on the first $9,875 of taxable income, 12% on income between $9,876 and $40,125, and 22% on the rest. The total tax bill would be approximately $5,030 -- about 12% of your total taxable income, even though you're in the 22% bracket. 

2020 tax brackets

Below are the federal tax brackets for taxes due by April 2021, for the income you earned in 2020.

This is the Tax Rate for the Income in Each Range

Single Filers (Taxable Income)

Married Filing Jointly or Qualified Widow

Heads of Household

Married Filing Separately

10%

$0 to $9,875

$0 to $19,750

$0 to $14,100

$0 to $9,875

12%

$9,876 to $40,125

$19,751 to $80,250

$14,101 to $53,700

$9,876 to $40,125

22%

$40,126 to $85,525

$80,251 to $171,050

$53,701 to $85,500

$40,126 to $85,525

24%

$85,526 to $163,300

$171,051 to $326,600

$85,501 to $163,300

$85,526 to $163,300

32%

$163,301 to $207,350

$326,601 to $414,700

$163,301 to $207,350

$163,301 to $207,350

35%

$207,351 to $518,400

$414,701 to $622,050

$207,351 to $518,400

$207,351 to $311,025

37%

$518,401 or more

$622,051 or more

$518,401 or more

$311,026 or more

Data source: IRS.

The bottom line

Selling Tesla stock that you owned for a year or less will be taxed at ordinary income rates, which could push you into another tax bracket -- although all of your income will not be taxed at that higher rate. 

To avoid those higher ordinary tax rates altogether, you can hold for more than a year to earn lower, more attractive long-term capital gains rates. Or pay no additional taxes at all by investing in a tax-advantaged account, such as a Roth IRA, where selling shares of Tesla won't trigger any taxes -- as long as you don't touch the money before retirement.