CiteTax

Withholding & Planning · Guide

401(k) vs. HSA: Which Pre-Tax Contribution Saves You More Tax

A traditional 401(k) contribution only escapes federal income tax, but an HSA contribution made through payroll also escapes Social Security and Medicare tax — a gap that's largest below the Social Security wage base and never fully closes above it.

Informational only, not professional tax advice. Last reviewed: September 2026.

A dollar contributed to a traditional 401(k) and a dollar contributed to an HSA both reduce your federal taxable income. Only the HSA dollar also escapes Social Security and Medicare tax. That difference in FICA treatment — not the federal deduction, which is identical — is what determines which account saves you more per dollar contributed.

Two pre-tax vehicles, two different tax bases

A traditional 401(k) contribution is deducted from wages before federal income tax is calculated, which lowers your taxable income for the year. But it does not lower the wages reported for Social Security and Medicare purposes. Your employer still withholds the 6.2% Social Security tax and 1.45% Medicare tax on that contributed dollar, because FICA wages and federal taxable wages are calculated on different bases (IRS Notice 2025-67, https://www.irs.gov/pub/irs-drop/n-25-67.pdf).

An HSA contribution made through payroll under a cafeteria plan is different. It reduces both federal taxable wages and FICA wages. That means the same dollar avoids federal income tax, Social Security tax, and Medicare tax simultaneously — a triple exemption that the 401(k) does not offer.

Why this matters more below the Social Security wage base

The Social Security portion of FICA — 6.2% — only applies up to the annual wage base. For 2026, that wage base is $184,500 (SSA 2026 COLA fact sheet, https://www.ssa.gov/oact/cola/cbb.html). If your wages fall below that threshold, every dollar you earn is still subject to the 6.2% Social Security tax, so a dollar diverted into a 401(k) forgoes the chance to avoid that tax, while the same dollar diverted into an HSA does avoid it.

Once your wages exceed the $184,500 wage base, the 6.2% Social Security tax no longer applies to additional wages. At that point, the FICA advantage of the HSA narrows to the 1.45% Medicare tax, which has no wage cap and applies to all earnings. The gap between the two accounts is largest for earners below the wage base and smallest — though never zero — for earners above it.

Working the comparison

The math is straightforward once you separate the two tax bases a contribution touches. A 401(k) contribution reduces federal taxable wages only. An HSA contribution made through payroll reduces federal taxable wages, Social Security wages (up to the point where the wage base is already exceeded), and Medicare wages. For any filer whose total wages sit below the $184,500 Social Security wage base, an HSA contribution avoids 6.2% Social Security tax and 1.45% Medicare tax on top of the federal income tax savings that both accounts provide equally. The 401(k) contribution gets the federal income tax savings alone.

This doesn't mean the HSA should always come first dollar-for-dollar. HSA contribution limits are set annually and are considerably lower than 401(k) limits (IRS Notice 2025-67, https://www.irs.gov/pub/irs-drop/n-25-67.pdf), and HSA eligibility requires enrollment in a qualifying high-deductible health plan. For most earners, the practical sequencing question isn't

Sources