As a medical professional working toward your financial goals, you’ve probably considered the idea of investing in stocks and other assets along with paying off debt. And, although markets fluctuate throughout the years, the long-term trends are typically up. That means, over time, you’re highly likely to experience appreciation and capital gains.

Unfortunately, many investors struggle to know what to do when their stocks appreciate. For some, the initial instinct might be to always sell off securities at a gain and hold onto ones that have lost value until they might swing up again. Others hold onto the gains, thinking they will continue to rise, and selling ones that have gone down to avoid further losses.

While investments are typically best evaluated based on what your belief will be about the future of the stock, investors frequently don’t consider an additional consideration that can make a significant difference in their long-term results: capital gains.

This article serves as a deeper dive into capital gains and losses and how to get the most of them as a doctor.

The Capital Gains Tax Rates

Capital gains are taxed according to different tax brackets than income taxes, so it’s important to know where you sit on the capital gains tax bracket chart.

According to the IRS Capital Gains and Losses publication, the thresholds for households fall at $80,800 and below for a 0% rate, $80,800 to $501,600 for a 15% rate, and a 20% rate for any capital gains harvested above that $501,600 threshold. Because the tax is progressive, it means that the first $80,800 of total income has a capital gains tax rate of 0%, regardless of whether one exceeds the threshold.1

These rules and principles can confuse some people who think that income and capital gains are the same bracket, or that they don’t have any relation to each other. While there is no additional tax on capital gains below $80,800 this doesn’t mean your gains are tax-free if there’s less than $80,800 in gains. It means they don’t get taxed if your total reported income is less than $80,800. It takes your income into account first, and then adds capital gains. Failing to recognize this could result in a hefty tax bill. The ideal place to be is right at the top of a bracket, but not over. This leads to the lowest effective tax rate in relation to the marginal tax rates of each bracket.

Cost Basis and Holding Periods

Notice how these taxes applied to long-term capital gains rather than short-term capital gains. That’s because long-term capital gains (gains on investments held for longer than one year) are taxed at different rates than short-term capital gains (gains on investments held for one year or less).

Short-term capital gains are taxed as regular income (typically your higher marginal rate). This means that an individual must hold onto their investments for more than a year to take advantage of the rules surrounding both capital gains and losses.

Capital gains and losses are calculated based on cost basis, which is typically the amount the investor paid to purchase the securities.2 To benefit and avoid penalties, taxpayers should diligently calculate, record and report cost basis each tax year.3

Capital Losses and Carryover

Though it may not be desirable from an investment perspective to incur losses, capital losses can carry a significant benefit to the taxpayer as a consolation. When accurately recorded and claimed, they can be used to offset capital gains and even some ordinary income for certain taxpayers. This has led to a strategy some employ known as capital loss harvesting: selling securities that have lost value to offset other taxable income and lower one’s total income tax obligations. Make sure you do not repurchase the investment within thirty days, triggering a wash sale3that invalidates the transaction. Many investors simply sell losses and purchase different investments they believe in for the future.

Net capital losses also may be carried over into future years. If one has net capital losses and records them properly, they can be claimed in subsequent years to offset capital gains and even some ordinary income over time until capital losses are exhausted.

Of course, regardless of your financial situation, these strategies work best when paired with a Certified Public Accountant (CPA), wealth manager, or financial advisor who can walk you through the important details about how these all work in your specific situation.