It's easy to get caught up in choosing investments and forget about the tax consequences of your strategies. After all, picking the right stock or mutual fund is difficult enough without worrying about after-tax returns. However, if you truly want the best performance, you have to consider the tax you pay on investments. Here we look into the capital gains tax and how you can adjust your investment strategies to minimize the tax you pay. 

The Basics

capital gain is simply the difference between the purchase and selling price of an asset. In other words, selling price - purchase price = capital gain (if the price of the asset you purchased has decreased, the result would be a capital loss). And, just as tax collectors want a cut of your income (i.e., income tax), they also want a cut when you see a gain in any of your investments. This cut is the capital gains tax.

For tax purposes, it is important to understand the difference between realized gains and unrealized gains. A gain is not realized until the security that has appreciated is sold. For example, say you buy some stock in a company and your investment grows steadily at 15% for one year. At the end of the year, you decide to sell your shares. Although your investment has increased since the day you bought the shares, you will not realize any gains until you have sold them. As a general rule, you don't pay any tax until you've realized a gain. After all, you need to receive the cash made from selling at least part of your investment in order to pay any tax.

Holding Periods

For the purpose of determining tax rates on an investment, an investment can be held for one of two time periods: the short term (one year or less) and the long term (more than one year and less than five years). The tax system in the United States is set up to benefit the long-term investor. Short-term investments are almost always taxed at a higher rate than long-term investments.

Example

Say you bought 100 shares of XYZ stock at $20 per share and sold them at $50 per share, and say you fall into the tax bracket in which the government taxes your long-term gains at 15%. The table below summarizes how your gains from XYZ stock are affected.

Bought 100 shares @ $20 $2,000
Sold 100 shares @ $50 $5,000
Capital gain $3,000
Capital gain taxed @ 15% $450
Profit after tax $2,550

Uncle Sam is sinking his teeth into $450 of your profits. But had you held the stock for less than one year (made a short-term capital gain), your profit would have been taxed at your ordinary income tax rate which, depending on the state you live in, can be as high as 39.6%. Note again that you pay the capital gains tax only when you have sold your investment and realized the gain. (For related reading, see: What You Need to Know About Capital Gains and Taxes.)

Compounding

Most people think that the $450 lost to tax is the last of their worries, but that misconception is where the real problem with capital gains begins. Because of compounding—the phenomenon of reinvested earnings generating more earnings—that $450 could potentially be worth more if you keep it invested. If you buy and sell stocks every few months, you are undermining the potential worth of your earnings: instead of letting them compound, you are giving them away to taxes.

Again, this all comes down to the difference between an unrealized and realized gain. To demonstrate this, let's compare the tax consequences on the returns of a long-term investor and a short-term investor, assuming a 20% tax rate. This long-term investor realizes that year over year he can average a 10% annual return by investing in mutual funds and a couple of blue-chip stocks. The short-term investor is not a day trader, but he likes to hold trades for one year, and he's confident he can average a gain of 12% annually. Here is their overall after-tax performance after 30 years. 

  Long-Term (10%) Short-Term (12%)
Initial Investment $10,000 $10,000
Capital gain after one year $0 ($1,000 unrealized) $1,200
Tax paid @ 20% 0 $240
After-tax value in one year $11,000 $10,960
After-tax value in 30 Years $139,595 $120,140

Because our short-term trader continually gave a good chunk of his money to tax, our long-term investor, who allowed all of his money to continue making money, made nearly $20,000 more—even though he was earning a lower rate of return. Had both of them been earning the same rate of return, the results would be even more staggering. In fact, with a 10% rate of return, the short-term investor would have earned only $80,000 after tax.

Making constant changes in investment holdings, which results in high payments of capital gains tax and commissions, is called churning. Unscrupulous portfolio managers and brokers have been accused of churning, or excessively trading a client's account to increase commissions, even though it diminishes returns.

What to Do

There are a few ways to minimize or avoid capital gains:

Long-term investing: If you manage to find great companies and hold them for the long term, you will pay the lowest rate of capital gains tax. Of course, this is easier said than done. Many factors can change over a number of years, and there are many valid reasons why you might want to sell earlier than you anticipated.

Retirement plans: There are numerous types of retirement plans available, such as 401(k)s403(b)sRoth IRAs and traditional IRAs. Details vary with each plan but, in general, the prime benefit is that investments can grow without being subject to capital gains tax. In other words, within a retirement plan, you can buy and sell without losing a cut to Uncle Sam. Additionally, most plans do not require participants to pay tax on the funds until they are withdrawn from the plan. So, not only will your money grow in a tax-free environment, but when you take it out of the plan at retirement you'll likely be in a lower tax bracket.

Use capital losses to offset gains: If you experience an investment loss, you can take advantage of it by decreasing the tax on your gains on other investments. Say you are equally invested in two stocks and one company's stock rises by 10% and the other company's stock falls by 5%. You can subtract the 5% loss from the 10% gain, thereby reducing the amount on which you pay capital gains. Obviously, in an ideal situation, all your investments would be appreciating, but losses do happen, so it's important to know you can use them to minimize what you may owe in taxes. There is, however, a cap on the amount of capital losses you are able to use against your capital gains. Also, be sure to wait at least 31 days before buying back the losing position in order to satisfy the IRS wash-sale rule.

If you are going to realize material capital gains of any kind, you must report them to the IRS on a Schedule D form. You should also consider enlisting the help of an accountant or other financial advisor. (For more, see: When Would I Have to Fill Out a Schedule D IRS Form?)

Here are a few things to keep in mind:

Watch your holding periods: If you are selling a security that was bought about a year ago, be sure to find out the actual trade date of the purchase. If the sale will be eligible for capital gains treatment if you wait to sell for a few days, then this may be a wise move as long as the price of the investment being sold is holding at a relatively steady price. This will matter more for large trades than small ones, and also if you are in a higher tax bracket. Remember that a security must be sold more than a year to the day in order for the sale to qualify for capital gains treatment.

Pick your basis: Although you will typically use the first in, first out (FIFO) method to calculate cost basis, there are four other methods to choose from: last in, first out (LIFO)dollar value LIFOaverage cost and specific share identification. The best choice will depend on several factors, such as the basis price of shares or units that were purchased and the amount of gain that will be declared. A tax advisor may need to be consulted for complex cases. Computing cost basis can be a tricky proposition in some cases, but finding out when a security was purchased and at what price can be a real nightmare if you have lost the original confirmation statement or other records from that time. (For more, see: What Determines Your Cost Basis?)

The Bottom Line

Minimizing taxes is an important element of the financial planning process. Although the tax tail should not wag the entire financial dog, it is critical that you ensure reasonable measures are taken to reduce reportable gains and realize losses against them. The two main ways to reduce the tax you pay are to hold stocks for longer than one year and to allow investments to compound tax free in retirement-savings accounts.

Want to learn how to invest?

Get a free 10 week email series that will teach you how to start investing.

Delivered twice a week, straight to your inbox.