If you plan on using HSA funds for retirement rather than medical expenses (i.e. you intend to pay much of the deductible and co-pay out of pocket), I'd prefer 401K and IRA contributions be done first, and here's why:
* You can have penalty-free access to 401K retirement funds as early as age 55, but not until age 65 with an HSA.
* With a 401K, you have an option to roll into an IRA and take SEPP if you need access before age 55 -- again, not available with an HSA.
* Early withdrawal penalties are now 20% from an HSA as opposed to still being 10% for a 401K.
* Though usually discouraged, many 401K plans have loan provisions and HSAs do not -- you take it out for non-medical reasons, you pay the taxes and penalties.
And though it's not your situation being self-employed, people who have an employer match on their 401K should absolutely get all of that match before using IRAs or HSAs in most cases.
"Hey, for every ten dollars, that's another hour that I have to be in the work place. That's an hour of my life. And my life is a very finite thing. I have only 'x' number of hours left before I'm dead. So how do I want to use these hours of my life? Do I want to use them just spending it on more crap and more stuff, or do I want to start getting a handle on it and using my life more intelligently?" -- Joe Dominguez (1938 - 1997)