Skip to main content
Buying and Selling

Capital Gains Explained

Close up of button on business white calculator

You bought a stock, and then that stock surged 20 percent in value. You now have 20 percent more cash in your pocket, right? Not so fast—don’t forget about the capital gains tax.

Money you make on an investment is considered a capital gain, and in most cases, you’ll need to pay a capital gains tax. Conversely, if your investment loses money, you have a capital loss, which might benefit you come tax time.

All investors should have some understanding of how capital gains work. Here are a few key facts to get you started.

How Does It Work?

Selling an investment typically has tax consequences. To figure out whether you need to report a gain or can claim a loss, you need to know the cost basis for that investment. Your capital gain (or loss) is the difference between the sale price of your investment and the cost basis.

If you held the security for less than a year, that difference qualifies as a short-term capital gain (when positive) and is taxed as ordinary income. But if you held the security for a year or longer, your profit is a long-term capital gain and is taxed at a lower rate.

The tax code can change, so you should check with the IRS for the current capital gains tax rate.

When Does It Apply?

Capital gains (and losses) apply to the sale of any capital asset. That includes traditional investments made through a brokerage account—such as stocks, bonds and mutual funds—but it also includes assets like real estate, cars, jewelry and collectibles, and digital assets such as cryptocurrency. 

Capital gains shouldn’t be confused with the ordinary income that these investments may also generate while you hold them. For example, interest payments and rent aren’t generally considered capital gains but rather are taxed as ordinary income.

Mutual funds also work differently from other securities when it comes to capital gains. As with a stock or a bond, you’ll have to pay capital gains taxes if you sell your shares in the fund for a profit. But even if you hold your shares and don’t sell, you’ll have to pay your share of taxes each year on the fund's overall capital gains. Each time the managers of a mutual fund sell securities within the fund, there's the potential for a taxable capital gain (or loss). If the fund has gains that can’t be offset by losses, then it must distribute those gains to its shareholders.

What Is Excluded?

Certain tax-advantaged investment accounts either are exempt from capital gains tax or benefit from tax deferral.

Tax-exempt accounts can include Roth IRAs and 529 plan college savings accounts, among others. In these accounts, you don’t have to pay a capital gains tax if you sell the investments held in those accounts within certain guidelines. For example, in a 529 plan, your earnings grow tax-free, and you don’t pay capital gains tax or income tax if you sell the investments to pay for qualified education expenses.

Tax-deferred accounts include traditional 401(k) plans and traditional IRA accounts, among others. Contributions to these accounts come from your pre-tax income, and your investments grow tax-free. Your gains on those investments will be taxed as earned income at a later date (after age 59 ½). That can be a benefit since many people move to a lower tax bracket than the one they were in when they were at the peak of their earning years.

It’s a good idea to read up on the tax implications of any account before you invest. When in doubt, consult an investment professional. And remember: Tax rates can change.

What About Losses?

You never want to lose money on an investment, but federal tax law can make it a little less painful if you do. When you sell an investment for less than your cost basis, the negative difference between the purchase price and the sale price is known as a capital loss. Like capital gains, capital losses are classified as either long-term or short-term.

Whereas a capital gain increases your income on your tax return, a capital loss generally counts as a deduction. A capital loss can sometimes offset your capital gains and thus your capital gain tax burden. For example, if you sell two stocks in a year, one at a $1,000 profit and the other at a $500 loss, you can report a net capital gain of $500 and only pay the capital gains tax on $500.

The exception to this policy is what the IRS terms a “wash sale.” Designed to prevent investors from exploiting potential tax deductions from losses, the rule states that capital losses can’t be counted against reported income when an investor buys the same or a “substantially similar” security 30 days before or after selling securities at a loss.

If your capital losses exceed your capital gains, the excess can be deducted on your tax return and used to reduce other income, such as wages, up to an annual limit. If your loss is more than that annual limit, you can carry over part of the loss into later years and deduct it from taxable income for those years, as reflected on the IRS’s website.

What Else Do I Need to Know?

While capital gains may be taxed at a different rate, they’re still included in your adjusted gross income (AGI) and can affect your tax bracket and your eligibility for some income-based investment opportunities.

There’s also a net investment income tax (NIIT) that’s applied at a fixed rate on the net investment income of individuals, estates and trusts when their AGI exceeds specified threshold amounts. For NIIT purposes, investment income most commonly includes interest, dividends, capital gains, rent and royalties. It can also include income from some types of annuities and passive activities.

Of course, many factors can impact your AGI, and your tax situation, other than capital gains. The IRS has a number of resources to help you. Along with discussing the tax implications of your investments with your registered financial professional, you can consult a tax professional to help you understand how your investments may impact your tax situation, particularly if you’re an active investor.