At the end of successful careers, many people would like nothing more than to kick back and enjoy their retirements. But just because you've stopped working doesn't mean you should give up on tax planning. In fact, some of the most lucrative tax opportunities are tailor-made for retirees.

For instance, it's very difficult to find ways to bring in income without paying taxes. But if you're fortunate enough to have had winning investments over the course of your career, then you might be able to cash out of those positions without having to pay any additional tax.

This is especially true if you're nervous about the lofty heights to which the stock market has risen; then, the prospect of selling a portion of your stock portfolio tax-free probably looks extremely attractive. Below, we'll see who qualifies for this tax-free treatment and how it works.

Instruction page reading tax-free.

Image source: Getty Images.

A 0% rate on capital gains

Most taxpayers know that there are preferential tax rates on long-term capital gains. Under the provisions of the most recent tax laws, the maximum long-term capital gains rate is 20% for those with the highest incomes. Most other taxpayers pay a lower maximum of 15% on their long-term capital gains.

However, there's a special rule that governs lower-income taxpayers. Due to tax reform, the numbers don't match up perfectly, but in general, those who are in the 10% or 12% tax brackets currently can qualify for a 0% tax rate on their long-term capital gains.

Limits on tax-free gains

It's important to understand, however, that just because you're in the lowest two brackets doesn't mean that you can get a 0% long-term capital gains rate on an unlimited amount of portfolio profits. The reason is that the income you realize from selling winning stocks will go into the calculation of what tax bracket you're going to be in. If your income climbs above the threshold for 0% tax rates, then any additional capital gains will end up getting taxed at a higher 15% maximum rate.

As an example, say that you're married and file a joint return. Your taxable income from retirement plan distributions and investment income adds up to $60,000, and you'd like to consider cashing in some of your winning stocks.

The 0% rate for joint filers in 2019 goes up to $78,750. So if you have other income of $60,000, that lets you claim as much as $18,750 in long-term capital gains without having to pay any tax.

Moreover, if you go over $18,750, there's no need to panic. You'll still get to pay no tax on that first $18,750. Any additional tax will apply only to the amount that pushes you above the overall upper threshold of $78,750.

Selling early to take advantage of 0% rates

The challenge in using this strategy is that you have to turn conventional wisdom on its head. Generally, you want to avoid generating capital gains because they increase the amount of tax you owe. However, if you can lock in a 0% rate, it's worth it to sell.

To take advantage of this strategy for 2019, however, you have to sell winning stocks by Dec. 31. Otherwise, the sales will count toward your 2020 capital gains, and any 0% eligibility you had in 2019 will go away.

Be tax smart

Sometimes, the best things to do from a tax perspective aren't necessarily intuitive. By being aware of the 0% rate on long-term capital gains for taxpayers in relatively low tax brackets -- as often happens for retirees -- you can free up investment capital and either reinvest it or take it for use in paying for your living expenses. That's a retirement plan you can feel good about following.