Tax season can be stressful, but it also offers an opportunity to look at the tax implications of your investment strategies and plan for the year ahead. You may want to take time to consider the tax treatment of capital gains.

When you sell a capital asset such as an investment or property, the capital gain or loss is the difference between the selling price and the basis, which is typically the cost of the asset plus certain related expenses. For tax purposes, capital gains and losses are classified as short term or long term, depending on how long you own or “hold” the asset. A holding period of one year or less is short term; more than one year is long term.

Short-term gains are taxed as ordinary income, whereas long-term gains are taxed at lower rates based on your tax bracket. Most taxpayers pay 15% on long-term gains; those in the top 39.6% bracket pay 20%; taxpayers in the 10% and 15% brackets pay no capital gains taxes at all. (Gains on certain assets, such as collectibles, are taxed at higher rates.)

Losses Offsetting Gains

Sometimes it makes strategic sense to sell an investment at a loss. The good news is that capital losses can offset capital gains or ordinary income in the following order: (1) capital gains in the same category, i.e., short term or long term; (2) capital gains in the other category; and (3) up to $3,000 in ordinary income ($1,500 for married taxpayers filing separately). Finally, any remaining losses can be rolled over to the next year and treated as though they occurred in that tax year. You cannot deduct losses on personal use property, such as a primary residence, but gains on such property must be reported.

Looking Forward

You should not buy or sell investments based solely on tax considerations, but it might be wise to consider the tax implications when you want to sell investments for other reasons. For example, if you have two investments that you want to sell, one with a gain and the other with a loss, you may want to sell them both in the same tax year so the loss can help offset the gain.

Here’s another scenario: If you are considering selling an investment with a large long-term gain, you might examine whether it makes sense to sell it now or wait until a year when your income drops to a level at which you would pay 0% on long-term capital gains. This could be an appropriate strategy for those close to retirement, who may have lower incomes when they retire but need to sell highly appreciated assets.

Keep in mind that taxpayers with adjusted gross incomes exceeding $200,000 ($250,000 for joint filers) may also be subject to an additional 3.8% tax on net investment income. Be sure to consult a tax professional before making tax-related decisions.