Order of Operations for Tax Advantaged Investing

New Reader? Get free regular updates from Can I Retire Yet? on saving, investing, retiring, and retirement income. New articles weekly. Join more than 18,000 subscribers. Unsubscribe at any time:

U.S. tax laws are complex. Spending my time and energy thinking about complicated tax schemes ranks right up there with having dental work done. . . without novocaine.

However, mistakes I made early in my career made me realize that totally ignoring tax planning is an expensive mistake. Taxes are a major detriment to building wealth. Tax planning is a necessity for those looking to quickly build wealth to enable early retirement.

It’s easy to be overwhelmed by stories like this one, reporting that the tax code has doubled since 1955 and is approximately 6,550 pages long. Fortunately, tax planning doesn’t need to be complicated.

Each of us needs to find the portions of the tax code that apply to our individual situation. We can then learn to control the things we can control while ignoring the vast majority of the law which doesn’t apply to us.

One of the easiest and most effective things you can do when saving and investing for retirement is to use tax advantaged accounts. It’s important to develop a framework for how to use these accounts to build up and then spend down wealth in the most tax efficient way possible.

Understanding Your Options

Anyone with earned income that does not exceed the limits allowed by the law can utilize a tax deductible individual retirement account (IRA) or contribute after tax dollars to a Roth IRA where future earnings and distributions are tax free.

Many employees have access to work sponsored retirement accounts. These may include 401(k), 403(b), Thrift Savings Plan, or Simple IRA depending on your employer. The self employed may set up Solo 401(k) or SEP IRAs. A recent CNBC report states that “seven in 10 companies offer a Roth 401(k) option,” giving further opportunity for those with work sponsored retirement accounts to decide between tax-deferred and Roth options.

Those with high deductible health insurance plans can utilize health savings accounts (HSA). Parents concurrently saving for retirement and their children’s education have other options for tax advantaged saving, including 529 plans.

Taxable accounts can play an important role in retirement saving. They can be surprisingly tax efficient for retirees. They also are simpler than tax advantaged accounts if you need to access funds prior to traditional retirement age.

With all of the options, where do you start and how do you avoid getting stuck in paralysis by analysis? We need rules to guide us.

Establishing an Order of Operations

Having all these investing options presents two challenges. The first is to figure out which accounts you have access to. Next, you must prioritize the order for funding them in the most tax and cost efficient way.

When my wife and I were saving aggressively for early retirement, our decisions were easy because we needed to save aggressively to meet our goals. So we maxed out contributions to all the tax advantaged retirement accounts available to us and then saved additionally in taxable accounts.

We first maxed out our 401(k) accounts. This lowered our adjusted gross income enough to fully contribute to Roth IRA accounts, but not enough to contribute to deductible IRAs. This essentially made the decision for us to fully fund Roth IRA accounts. Anything left over went to taxable investments.

We didn’t see much value in 529 college accounts for our situation. We never had access to HSA or self-employed retirement accounts, eliminating those decisions. Contributions were placed on autopilot, and we never considered these decisions again.

Now we’re in semi-retirement with only my wife’s part-time income and my small income from writing. We need to establish a new framework for saving in and taking from these accounts.

Similarly, many saving for retirement who have lower incomes or higher expenses than we had will be faced with harder decisions about whether to invest in tax-deferred, taxable or Roth vehicles, what specific accounts to use, and in what order to prioritize funding them.

It is helpful to have a framework and an order of operations to guide your planning. This prevents the need to re-evaluate this decision from scratch every year, or worse yet have no plan.

Seeing the Big Picture

Using tax advantaged investment accounts gives you the option to use timing strategies to decrease the total amount of tax you pay over your lifetime.

Using tax deferred investment accounts during high earning (and thus high tax) years allows you to avoid paying at upper marginal tax rates in the year money is earned. Early retirees with a low cost of living can spread this income over many years in which the taxes are paid at lower effective tax rates when you are not earning a high income.

Likewise, tax-loss harvesting is a way to avoid paying capital gains taxes on taxable investments in your high earning working years. In retirement, or in lower earning semi-retirement years, capital gains can be paid at lower rates when money is taken from the accounts. Long-term capital gains are taxed at a rate of 0% at the federal level for those in the 10 and 12% marginal tax brackets.

Some may use strategies like Roth IRA conversions and tax gain harvesting to create taxable events in lower earning years. In contrast to tax deferral strategies, these strategies accelerate the timing that taxes are paid to take advantage of the opportunity to pay them at lower rates in years when income is low.

We also need to balance the fees, limited investment options, and rules and regulations that come with the different tax advantaged account types.

Against this backdrop, how do you determine whether to utilize tax-deferred, taxable or Roth options? And in what order should we prioritize funding these different accounts?

First Consideration: Getting ACA Subsidies

My wife and I have always gotten our insurance through employers. We decided to have one of us continue working enough to continue receiving this benefit while we gradually transition into a more traditional retirement.

When the time comes that neither of us have employer provided health insurance, this will become the most important factor in determining our tax strategy. Optimizing ACA subsidies provides immediate and potentially large financial benefits.

As I reported last November after researching our health insurance options, the price we could pay for the exact same insurance plan for our family could range from a low of $982 per year to as much as $16,817. The wide variability is because ACA premium subsidies are based on your taxable income, technically your Modified Adjusted Gross Income (MAGI).

We would be especially wary if approaching the “subsidy cliff” where having too high of a MAGI would cause us to lose all subsidies. In our scenario, going one dollar over the cliff could cost us $8,194 in lost subsidies for the year.

Therefore, it behooves an early retiree, semi-retiree or entrepreneur needing to purchase insurance on the open marketplace to do whatever is possible to first control taxable income. You can accomplish this by using tax-deferred investment accounts to optimize ACA subsidies and try to limit your out of pocket insurance premium costs.

Second Consideration: Finding “Too Good to Pass Up” Options

There are a number of factors that go into deciding whether to use tax advantaged savings accounts and in what order to fund them. At the top of the list for my wife and I are financial simplicity.

There needs to be a compelling reason to add the complexity of utilizing a tax advantaged account or making additional financial transactions in the face of uncertain benefits. It is easier to use our earned income to provide cash flow and add to or take from taxable investments as needed.

This decision will be different for each of us. Here are two options for tax advantaged investing that I feel are too good for nearly anyone to pass up if they are available.

Getting an Employer Match

The first option is to receive an employer match for your contributions to work sponsored accounts. My wife’s employer matches her 401(k) contributions 100% on the first 3% and then 50% on the next 2% of her salary. They do not provide any incentive or match for HSA contributions.

In 2018, we were still in the accumulation mode mindset to max out all available retirement accounts, so my wife maxed out her 401(k). Contributing so much to her 401(k) caused us headaches when we tried to create enough cash flow to meet our monthly spending needs.

In exchange for the inconvenience, we got what is likely to be a marginal, at best, long-term tax benefit. Worse yet, this locked us into subpar investment options available through her plan. In a review of our investment portfolio last year, we found that her 401(k) made up only 4.3% of our portfolio, but accounted for 38% of our investment fees!

Going forward, she will contribute only to the level of the employer match. This essentially provides an 80% instant risk-free return on her contribution. That translates into a few thousand dollars of free money. The contribution also provides a small tax deduction.

Paying off high interest debt or having a high probability of not vesting and losing this free money are the only reasons not to contribute to an employer sponsored plan up to the employer match.

Beyond the level of the match, we will bypass contributing more to work sponsored retirement plans. The reward is not great enough for us to shift money around to manage our cash flow and deal with excessive investment fees.

Utilizing an HSA

The second factor is whether you have access to an HSA. My original research into HSAs left me lukewarm on them. Reader comments on that post, discovering some excellent options to invest an HSA, and subsequent developments in the HSA marketplace that further improved those options changed my opinion and left me feeling more bullish about them.

Here is my rationale. Contributing to an HSA provides a deduction at your marginal rate. Even if you are in a relatively low marginal tax bracket of 10 or 12%, this deduction will save several hundred dollars in the year of the contribution.

I’m quite sure  we’ll need to cover the cost of health expenses for someone in our family over the next 20-30 years. In that case we get a triple tax benefit; tax deductible contribution, tax-free growth until withdrawal and tax-free withdrawal.

In a “worst case” scenario, this is a great bet to “lose.” It means we all stayed healthy, and the HSA then acts like a traditional IRA which is taxed at ordinary income tax rates. For us, it is unlikely we’ll pay more than 10-12% effective tax rate, so taxes would be a wash.

Unlike 401(k) plans, HSA investment options are not limited by your employer’s choice of provider. You can choose companies like Lively or Fidelity (we have no affiliate relationship with either) to invest your HSA without management fees.

We decided the benefits of funding an HSA are great enough that we will fully fund one every year it is available to us. We will do this even when it requires some effort to sell off taxable investments (assuming we pay no long-term capital gains taxes in the process) to fund it.

Third Consideration: Defining High and Low Tax Rates

Tax strategies require you to take definitive action in the face of an unknown future. I use terms high and low tax rates, but they are relative and speculative.

We each need to quantify the terms high and low marginal tax rates for the purpose of tax planning. When both of us were working, our household income typically put us firmly in the 25% (now 22%) federal marginal tax brackets. I consider these rates or anything above them to be high, leading us to first utilize tax-deferred investment options. Here is some perspective.

It was helpful for me to read Darrow’s posts on this blog over the years. He reported his effective federal income tax rate in 2014, 2016 and 2018 in early retirement. His average federal effective tax rate consistently had been less than 5%.

However, he is still in the early retirement stage, not yet eligible for social security or subject to required minimum distributions (RMD). Those factors reduce your ability to control your tax rate.

With many years to spread out taxes at low effective rates and with good planning, it is hard for me to imagine paying an effective rate greater than 10-12% in any given year of retirement. So we took advantage of every opportunity to defer taxes when in a “high” marginal rate.

Now that we’re transitioning to lower earning retirement years we will look for any opportunities to do Roth IRA conversions if there are years we could do so without paying taxes up to the standard deduction. More realistically for us at this point, we’re looking for opportunities for tax gain harvesting. In either case, these are no brainer decisions of accelerating taxes to “pay” them at a rate of 0%.

Decisions are less clear when deciding to defer taxes on income in the 10 and 12% marginal tax brackets or when having to actually pay taxes sooner than necessary. This is where it is helpful to have rules to guide your decisions.

No one would disagree that 0% is low. You may disagree with my definition of the 22 percent or above marginal tax rate as “high” and 10 and 12 percent as “crap shoots” based on the specifics of your circumstances. Wherever you choose to draw the line, it is helpful to have rules in place to determine whether to emphasize deferring taxes, accelerating them, or having a laissez-faire approach.

Fourth Consideration: Tax Rate Diversification

Next we consider diversification amongst tax-deferred, taxable and Roth accounts. The only thing we know about the future with certainty is that we don’t know anything about the future with certainty.

I therefore want diversification not only among asset classes but also tax diversification among  account types. We calculate this in a spreadsheet where we track our investment portfolio.

Our portfolio is evenly split between tax-deferred and taxable accounts, each making up approximately 45% of the value. Our Roth accounts are about 10% of our portfolio with our HSA account comprising less than 1% of our portfolio.

There is no optimal percentage to have in each account. However, the absolute value of your tax-deferred accounts, the number of years until you are subject to RMDs, whether you receive a pension, the size of your social security benefit and when you take it, and having some flexibility in how you take money from your accounts all contribute to how much tax you pay on that money over your lifetime.

Diversification was a secondary consideration when we had a higher income, with tax-deferral taking precedence. Now that it is less clear whether a tax-deferred, taxable, or Roth option is optimal for us, diversification is a bigger factor.

Our current strategy is to turn off the option to automatically reinvest dividends on our taxable accounts. We can use this money to supplement cash flow if needed. If not needed, it will be used to fund our HSA and then Roth IRAs each year. If more is needed to fund these accounts fully, we will sell off taxable investments as long as it doesn’t trigger capital gains taxes.

Developing Your Own Order of Operations

As with all personal finance topics, determine your priorities and make decisions to fit your personal situation. I’m sharing our decision process not as a one-size-fits-all solution, but as a template to evaluate your own decisions. We each need to develop our own framework to systematize and simplify our finances.

Taking the time now to develop a comprehensive plan and framework for decision making can save you substantial time and money over the long term. No one enjoys thinking about taxes, but there are few things you can do to save more money with less sacrifice than developing a simple, sensible and legal tax avoidance plan now.

* * *

* * *

Disclosure: Some links on this site, like the Amazon links, may be affiliate links. As an Amazon Associate we earn from qualifying purchases. If you click on one of these links and buy from the affiliated company, then we receive some small compensation. The modest income helps to keep this blog going. Affiliate links do not increase your cost, and we only use them for products or services that we're familiar with and that we feel may deliver value to you. By contrast, we have limited control over most of the display ads on this site. Though we do attempt to block objectionable content. Buyer beware.


  1. Great post Chris. I got hit pretty hard on taxes in 2018, mainly because the amount I now have invest in taxable accounts is getting large. And in years when those accounts do well, they’re paying lots of dividends. I maxed out all of my available tax deferred options every year in my working life, but had plenty extra to stash away. So it went in taxable accounts. I may have to consider making quarterly estimated payments to avoid IRS penalties at this point. Or perhaps have my employer take out extra Federal taxes from my part time W2 job to compensate for the extra income. Either way it’s a good problem to have 🙂

    • Chris Mamula says

      Or you could work even less. 😉

      Definitely a good problem to have.

    • I have this problem too, and it’s only getting “worse”. My taxable dividend income is now over half of my base salary. I just turned up my paycheck withholding by another $200. I hate the fact that I’m still working only because of the health insurance that my job provides. But that’s old news so I will stop there.

  2. Why did you avoid 529s? Did you pay for your kids college education from other funds or did your kids pay their own way?

    • Chris Mamula says

      Good question.

      My daughter is only 6 y/o. We front loaded saving for her college while working and have since stopped saving. I have a full post planned on our decision and why it may or may not be optimal for others.

      Quick summary:
      -You only get a state deduction when contributing, not federal. We were in PA while saving. State tax is 3.25% I believe. Not nothing, but not a massive benefit.
      -Even the best 529 plans have higher fees than investing outside of 529. Fees compound year after year while deduction is one time.
      -529 are not taxed annually. Being that I quit working when she was 5 y/o, most of the time the money would be invested we have a low income so get the same tax free growth (dividends taxed at 0% for those with low income).
      -529 can be taken out tax free. If we plan carefully, we can also sell funds that will be cost basis + LT Cap gains at 0% tax rate so again essentially the same treatment.
      -529 money is restricted in how it is used. Otherwise face a penalty (10% off the top of my head). Taxable money can be used as we see fit.

      So for us, we gave up what we perceived as relatively small tax benefits to have improved control of where we invest our money and how it is ultimately used.


  3. scott conger says

    You said: “… control taxable income. You can accomplish this by using tax-deferred investment accounts to optimize ACA subsidies and try to limit your out of pocket insurance premium costs.”

    I am not understanding this at all…we have after tax money set aside to draw upon as a “salary”, which is “0” income. Then draw IRA dollars up to a level that puts us at 200% Federal Poverty level. With rentals and related expenses, we typically pay nothing in Federal Tax and nothing for Health Insurance. An insane situation for anyone much less an early retiree, but those are the rules and I’m big on following rules.

    If someone is relying on simply throttling their tax advantaged accounts’ withdrawals to stay “under the cliff” then you are paying way more for ACA insurance than you need to, and possibly living a “poorer” life than necessary. After socking $$ away in 401K, IRA, Roth IRA, etc for years, we spent the last several years earning at a very low tax rate, while building a standard after-tax brokerage account. Those $$ now spin off capital gains which while they count toward MAGI (ACA) they are taxed at “0” at our income level. Win/Win.

    • Chris Mamula says


      Your comment is spot on. I could have been more clear by leaving out early-retirees. I wrote that statement more with the idea of semi-retirees still earning income or entrepreneurs who purchase their own health insurance and face many of the same challenges as those looking to retire early. In those cases, using tax-deferred investments to decrease taxable income could optimize your subsidy.

      As you point out, an early retiree with no or very little earned income would actually benefit by generating a taxable event (some or all of which may be taxed at 0% if < the standard deduction) by taking money from tax-deferred accounts directly (if 59.5 y/o or older) or indirectly (by doing Roth conversions) to get over the lower subsidy cliff which gets you off Medicaid and qualified for ACA subsidies. I covered this in detail in this post that I cited and was trying to reinforce that point w/o getting too repetitive. Sorry if I made it unclear.


  4. East Coast says

    Always confused about how to prioritize Roth conversions vs harvesting gains. Can you help? I’m probably going to do Roth conversions from current age 63 until collect social security at age 70 so RMDs don’t cause high taxation of social security. So my question is in general, and then specific to my situation. Thanks.

    • Chris Mamula says

      East Coast,

      We can’t give any specific financial advice. In general here is how I would think about the issue.

      Once you take SS and are subject to RMD you will have a baseline level of taxable income. This limits your ability to control your tax rate. As you age, you will be forced to take larger distributions from tax-deferred investments as RMD increase year over year, and thus taxes will increase accordingly. The most control of your tax rate is in the period after your peak earning years (retirement/semi-retirement), but before RMDs and SS.

      Many people have the problem of saving too little for retirement, so they need all of their RMD + SS + other money to fund their retirement. If in this boat, RMDs are not much of an issue.

      RMD are a “good” problem if you have it. It means you’ve saved more than you need in tax-deferred accounts. In that case, you will be faced to take (but not spend) larger than necessary RMD’s causing you to pay higher than necessary taxes. Over time, this problem only increases as RMDs force larger distributions while spending tends to decline for most.

      If you think you are in this boat, it may be worth your while to do Roth conversions to limit future tax burdens. This means paying taxes on some of the money now and converting it to a Roth IRA which is not subject to RMDs or future taxation. Darrow covered this decision process well in this post.

      Another concern for some is leaving money to heirs. Tax-deferred money remains taxable and subject to RMDs for your heirs. Roth money is not.

      Tax gain harvesting is not urgent. Money can sit there forever and you’re not forced to take it out. Even when you do, some of it (cost-basis) is not taxed, while the rest is taxed favorably as long as it is in the form of long-term capital gains. Taxable investments get a “stepped up” basis for heirs upon your death.

      Sorry for the long response to a complicated question. Hope that helps clarify.


  5. As I approach retirement three months from now this is of interest to me. Nearly all of our retirement savings is tax deferred in 403b and small Roth accounts, but we have very little in taxable investments to draw on. Both claiming Social Security and beginning RMDs in 5 years at age 70 will certainly create tax havoc unless we convert 403b funds to Roth accounts. Pension income and part time work should keep our AGI low enough between now and then to make doing so feasible. Time to start a spreadsheet…

  6. Good post but formatting of website always makes reading these tricky.

    • Chris Mamula says

      Thanks for the feedback Andrew. Working on some technical issues at the moment (names in the comments) and making some bigger changes in the long run to improve the website. Appreciate everyone who reads, but please remember we’re a couple of “retired” guys, who are doing this primarily as a way of giving back and technical issues cost time and money to fix.


  7. Well, guys – after reading this as well as other blogs I finally bit the bullet and gave notice at work that I am retiring at 59.5. I have been frugal and invested from the second year of my work-life, so I should be OK financially if I do not make big mistakes or cost of healthcare rises exponentially between now and 6 years from now. Right of the bet made a mistake of converting “small/safe” amount from traditional IRA to Roth. Including my earning from 3 mo of this year this will probably put me into 15% rate for LT gains instead of 0%. Those are gains that mutual fund that I had for 30 years or so will distribute at the end of the year and I have no control over it (at least it seems to me). I will even try to do max IRA contributions for me and wife and try to master all possible LT loses to offset and get under $77K AGI (or whatever the number is for 2019). I estimate this mistake will cost me around $6k in federal taxes, but I will have more degrees of freedom next year and will not do any stupid moves w/o looking.
    One thing that I found that is not covered in most sources is the following. Let’s say I made a “mistake” 30 years ago of investing my non-ira money into a mutual fund that performed well and generated significant return. Now I am smarter and want to invest that money into index fund instead, but would have to pay taxes on LT gains of about 60% of any sale. Good problem to have? Possibly. But I feel that I will have to stick with this fund forever. Moreover, yearly distributions will affect my medicare payments, put me into higher tax brackets for many years to come.
    Any suggestions/pointers will be greatly appreciated.


    • Chris Mamula says

      First and foremost, CONGRATS on your retirement!

      I think you get this, but for others that don’t: doing a Roth conversion while maxing out 401(k) contributions for the year adds complexity to get you back to the same place. This adds a transaction to convert from tax-deferred investments to Roth and accelerates when you pay taxes to this year. At the same time, adding to tax deferred accounts lowers taxable income this year and delays taxation of this money to a future date. From a tax perspective, these transactions essentially cancel one another out. Again, from the tone of your comment, think you get this but others may not and it’s an important point.

      Re: your “mistake”, I made a similar one when sold actively managed funds early in my career. In my case, I changed course after less than a decade so not as large of gains, but still an issue. I’ve had others ask this question in a similar manner, so probably worth addressing in a full blog post.

      Quick version, index funds give you much more control of how they are taxed b/c they don’t turnover securities inside the fund which are then passed on to the shareholder. However, selling all at once, especially when have large gains as you do would provide a massive tax hit.

      How exactly to manage is very individual decision. One easy first step if haven’t already done it is to stop automatic reinvestment of dividends and cap gains. You’re paying the taxes on them regardless, but to continue to reinvest throws good money after bad. After that, decisions become more complex as you have to look at potential positives of likely improved future performance and guaranteed improvement in control of taxation of investment and balance that against the pain of selling and paying taxes.

      Hopefully that helps.


    • I also have some actively managed mutual funds that I’ve owned for 30 years. They are long term outperformers of their indexes. I wouldn’t dream of liquidating them and going to index funds instead. Why would you want to do that? Why is it “smarter”? I don’t get it.

      As Chris mentions, you can stop reinvesting the distributions. I stopped reinvesting mine a few years ago. They can be used as income when needed (but they are unpredictable… however so are the distributions from an index fund), or I can reinvest them elsewhere. I also sell some of the funds from time to time, minimizing taxes of course.

      I’ve been putting the distributions and the sale proceeds into things that have a more predictable income stream, which will fund my early retirement. But the core of the mutual fund holdings will continue to grow and be part of my “reserves”.

      • I appreciate the reply and suggestions. Yes, reinvestment has been stopped a while back.
        Well, let me address the “smarter” part. According to Jack Boggle (of vanguard fame) most of the outperformers of the index tend to mean-revert, so in most cases outperformance does not last. The reason to go with index is that I have complete control of my taxable income (lets just assume that dividends and other distributions of index fund are negligible or at least very small). So I can sell with index fund exactly what I want knowing what I will owe in taxes. In my case (managed fund) it is out of my control – they trade all year long and distribute the gains at the end of the year. Lets for the sake of argument say that the distribution is 50K and for simplicity this is all LT gain. If you have any other income (SS, pension, interest, etc.) that totals 30K, you can never get 0% LT gain tax rate. The index fund would obviously allow me more flexibility to keep total income under 77K. [Which is exactly what Chris said].
        So I will have to endure the “pain of selling and paying tax” for the next 20 years or so and when RMD kicks in the tax-bite is going to be even greater.
        Once again, I appreciated the replies.

        • Your tax math needs some correction. If you have 30K ordinary income and 50K LT gain, and take the 24K married couple standard deduction for 2018, your taxable income is 56K. 6K of it is ordinary income taxed at 10%. The 50K LT gain is taxed 0 because qualified income (qualified dividends and LT gains) are taxed 0 up to $77,200 taxable income for a married couple. You could actually have $21,200 more qualified income, and it would not be taxed.

          In any case, I would never sell a long-term successful mutual fund simply because Bogle said to. No way. And index funds do indeed pay distributions, because they do have turnover, they have to buy and sell whenever the index changes. And dividends must be paid out, even if there was no change in the stocks held.

          • Yes, Larry, you are correct. My math is wrong there. Thank you for correcting me on 24K standard deduction. However, the point is that in my case I will be very much constrained by those distributions. I agree that index fund has to have distributions also, but in case of index funds it would be 10K not 50K.
            I am not going to do anything because Boggle or anyone says so, but because mean reversion is actually the way things work, and I will need the flexibility in the future.
            Thanks again.