Remember the days before self- service when you could drive your car to a gas pump and tell the attendant to “fill ‘er up”? There are good reasons to take the same approach to selling securities before the end of the year. If you’re careful to fill up your lower tax brackets with long-term capital gains, you can pocket some cash and pay little, if anything, in federal income tax.

Before you start filling up tax brackets, it’s important to understand the basic tax rules affecting capital gains.

Currently, there are six federal income tax brackets ranging from 10% to 39.6%. Most “ordinary income,” as well as short-term capital gains from sales of assets you hold a year or less, is taxed under this graduated rate structure. But long-term capital gains from selling securities you’ve owned longer than a year may be taxed at three capital gain rates:

  • The 0% rate applies to long-term capital gains of investors in the two lowest brackets (10% and 15%).
  • The 15% rate applies to long- term gains of those in the middle three
  • brackets (25%, 28%, and 35%).
  • The 20% rate applies to long- term gains of investors in the top bracket (39.6%).

With the tax system’s graduated rate structure, even investors whose capital gains eventually will push them into the 39.6% tax bracket may be able to benefit from having part of their capital gains taxed at the lower 0% and 15% rates. That’s what tax bracket management is all about.

The best way to explain the concept of filling up tax brackets with long-term gains may be with an example.

Hypothetical facts: Suppose that 2014 will be a low-income year for you because of losses from your S corporation or other business circumstances. Not including your investment income, your taxable income on a joint federal return should be only $50,000, but the upper threshold of the 15% bracket is $73,800. That leaves room for another $23,800 of income ($73,800 – $50,000) before you reach the 25% bracket-and the 15% bracket for long-term capital gains. So if you pull down a $23,800 long-term gain before year-end, the entire amount will be taxed at the 0% rate.

What’s more, consider that the upper threshold for the 35% rate is $457,600. Any other long-term gains below that threshold will be taxed at the 15% rate.

Of course, there are other factors to consider, including the 3.8% surtax on net investment income. Also, be aware that capital losses offset capital gains plus up to $3,000 of annual ordinary income. But the long and the short of it all is: You can manage your tax brackets to maximize favorable tax rates for long-term capital gains.