How to determine which one will make you wealthier? Use the graph in Figure 1 on page 44 in the article you can download at http://www.umsl.edu/~geislerg/articles/HSAContribution.pdf to compare two percentages.
The first percentage is your employer’s matching contribution to your 401(k) (e.g., 25%, 50%, 100%). The second percentage is your combined tax rate (i.e., federal income tax rate, state income tax rate, Medicare tax rate on your salary, and Social Security tax rate on your salary) you are subject to on the last part of your salary (that will be directed into your HSA). The federal income tax rate schedule is available at http://www.bankrate.com/finance/taxes/tax-brackets.aspx When using the federal income tax rate schedule, remember to subtract your exemption deduction(s) of $4,050 per exemption and the greater of your standard deduction ($12,700 if married filing jointly and $6,350 if single) or itemized deductions to estimate your taxable income for 2017.
Click on “State Individual Income Tax Rates” at https://www.taxadmin.org/current-tax-rates to find state tax rate information.
The Medicare tax rate is 1.45% (or 2.35% if your total salary exceeds $200,000 if single or $250,000 if married filing jointly).
The Social security tax rate is 6.2% but becomes 0% to the extent one’s salary exceeds $127,200 in 2017.
Now that you have the two percentages, go to the graph in Figure 1 on page 44. For points northwest of the curved HSA line in Figure 1, an employee will be wealthier if contributing to his or her employer-matched 401(k) first. For points southeast of the curved line, employees will be wealthier if contributing to their HSA first. (Note that you can only contribute to an HSA if you have qualified high deductible health insurance.) For instance, if an employee’s combined tax rate is greater than 20 percent, and his or her employer’s 401(k) match is 25 percent or less, contribute to the HSA first. Another example is that if an employee’s combined tax rate is greater than 33⅓ percent, and his or her employer’s 401(k) match is 50 percent or less, contribute to the HSA before contributing anything to your 401(k). Remember that the tax-favored treatment for HSAs only occurs if the distributions are to pay for or reimburse yourself for qualified medical expenses.
Even if the comparison of the two percentages on the graph shows you’ll be wealthier if contributing to the HSA first, for your financial well-being also try your best to get the maximum employer 401(k) match you are entitled to.