The US tax-advantaged account hierarchy
HSA, 401(k) match, Roth IRA, max 401(k), mega backdoor Roth, taxable — the order to fund US retirement accounts, with bracket-aware math.
The single highest-leverage personal finance question a US worker can ask is “in what order do I fund my tax-advantaged accounts?” Get the order wrong and you forfeit thousands of dollars a year in tax-arbitraged value. Get it right and a moderate-income worker can compound a retirement balance that materially exceeds what the same dollars produce in a taxable brokerage account.
Most US personal finance sites publish a generic order — “401(k) match, IRA, max 401(k)” — and stop there. That advice is structurally correct in outline but obscures the bracket-aware reasoning that actually drives the decision. This guide publishes the full hierarchy with the math, including the cases where the conventional order is wrong.
The hierarchy, in priority order
- 401(k) up to the full employer match. A 50–100% instant return, by definition, before any market return. Highest-ROI dollar in personal finance.
- Health Savings Account (HSA), if eligible. The only triple-tax-advantaged account in the US tax code. Pre-tax contribution, tax-free growth, tax-free withdrawal for qualified medical expenses. After 65, withdrawal for any purpose is taxed like a Traditional IRA.
- Roth IRA up to the annual cap ($7,500 / $8,600 with catch-up in 2026). Broader investment menu than a 401(k), no RMD during owner’s lifetime, structurally favorable tax treatment for most middle-income earners.
- 401(k) up to the full deferral cap ($24,500 / $32,500 with catch-up in 2026). Captures the rest of pre-tax or Roth-401(k) capacity. Investment menu is whatever the plan offers — varies enormously by employer.
- Mega backdoor Roth, if the plan permits. After-tax 401(k) contributions converted to Roth, up to the $72,000 total additions limit (IRC §415(c)). Available at perhaps 30–40% of employer plans; if available, the most powerful single lever.
- Taxable brokerage account. Where additional savings go after all tax-advantaged capacity is exhausted. Tax-efficient if held long-term in broad-market index funds.
This is the order for an unmarried W-2 employee in a typical earnings range. Married filing jointly, self-employed, very-high-income, and very-low-income workers face variants discussed at the end.
Why the 401(k) match comes first — and why it dominates every other consideration
The mechanics: most US employers offering a 401(k) match contribute a percentage of your salary into your account contingent on your own contribution, up to a stated limit. A common formula is “50% match on the first 6% of salary deferred” — if you contribute 6% of your salary, the employer contributes another 3%. A more generous variant is “100% match on the first 3%, 50% on the next 2%” — contribute 5% and the employer contributes 4%.
The economic significance is enormous. On a $80,000 salary at a 50%-on-6% match, contributing the full 6% triggers $2,400 in employer money each year. The employer money is granted before any investment return; it is purely additive to your portfolio. If you contribute less than 6%, you leave that money on the table. The instant 50% return on every matched dollar dwarfs any return any other strategy can offer in the same year.
The decision rule is binary: fund the 401(k) to the full match before anything else, every year, without exception. The marginal complexity considerations — Traditional vs Roth election, plan investment menu quality, fees — all matter, but only after the match is captured. Even a poor 401(k) with high-fee investments outperforms not contributing if doing so forfeits the match. The 401(k) match math guide walks through the worked example at typical employer match formulas.
The one common exception is workers at employers where the match has a vesting schedule and the worker plans to leave before vesting completes. Some employers vest match contributions over 3–5 years (cliff vesting or graded vesting under the Pension Protection Act); a worker who plans to leave before the cliff loses the unvested portion. For a worker confidently planning to leave within 1–2 years before a 3-year cliff, the match math is more nuanced. But this is the exception; for most workers, the match is captured and retained.
HSA — the only triple-tax-advantaged account in the code
A Health Savings Account is available to workers enrolled in a High-Deductible Health Plan (HDHP), which the IRS defines for 2026 as a plan with a minimum deductible of $1,700 self-only or $3,400 family, and out-of-pocket maximums no greater than $8,500 self-only or $17,000 family. Eligibility requires HDHP coverage, no other non-HDHP medical coverage, no enrollment in Medicare, and not being claimed as a dependent on another return.
The structural advantage of the HSA is the only triple-tax-advantaged treatment in the US tax code:
- Contribution is pre-tax — federal income tax, state income tax (in most states), AND payroll tax (FICA, when made through employer payroll deduction). The payroll tax exemption alone saves 7.65% on the contribution; no other tax-advantaged account offers this.
- Growth is tax-free if invested in eligible HSA investment options (most major HSA custodians offer broad-market index fund options once a small cash threshold is met).
- Withdrawal is tax-free for qualified medical expenses, at any age.
After age 65, withdrawal for any purpose is taxed as ordinary income — making the HSA function as a Traditional IRA for non-medical withdrawals after retirement age, in addition to its tax-free medical withdrawal capacity.
The 2026 annual contribution limits are $4,400 self-only and $8,750 family, with an additional $1,000 catch-up for those 55+. For workers eligible to fund an HSA, the math says: contribute the full annual limit, do not spend the HSA dollars on current medical expenses (pay those out of pocket if possible), invest the HSA balance in low-cost index funds, and let it compound for decades. Save medical receipts; you can reimburse yourself tax-free from the HSA at any point in the future — even years later — using receipts from years past.
A 30-year-old maxing the HSA family limit at $8,750/year for 30 years at 7% nominal return accumulates roughly $830,000 in tax-free medical-eligible retirement assets. The tax savings on the contributions over those 30 years, at typical bracket rates, exceed $90,000. There is no other US tax-advantaged structure with this profile — the HSA as a retirement account guide walks through the receipts strategy that crystallizes the advantage decades later.
Roth IRA before max-401(k) — why
This is where conventional advice diverges from bracket-aware analysis. Most sites recommend maxing the 401(k) ($24,500 in 2026) before opening a Roth IRA ($7,500). Bracket-aware analysis usually says the opposite for moderate-income workers.
The reason is investment menu quality. A typical 401(k) plan offers 15–30 investment options chosen by the plan administrator, often dominated by actively managed funds with expense ratios above 0.50%. Even at well-designed plans, the lowest-cost options usually charge 0.10–0.20% on broad-market exposure — not bad, but not best-in-class. A Roth IRA at Fidelity, Schwab, or Vanguard offers the full universe of low-cost index funds, including funds with 0.00–0.04% expense ratios (FZROX, VTI, FSKAX). Over a 30-year horizon, the 20–40 basis point expense ratio difference compounds to a meaningful drag on the 401(k) portfolio.
The strategic logic: fund the 401(k) to the match (capturing the 50–100% instant return), then route incremental dollars to the Roth IRA (capturing the broader, cheaper investment menu and the structurally favorable Roth tax treatment), then come back to fund the 401(k) up to the cap once the Roth IRA cap is exhausted. The dollars in the Roth IRA do more work over decades because of the lower fee drag and the broader optionality. The Roth IRA guide covers the 2026 contribution and income limits and the five-year qualified-distribution clock.
Exceptions exist. A worker at a particularly well-designed 401(k) — one with institutional-class index funds at expense ratios near zero (some large-employer plans offer this) — might reasonably max the 401(k) before turning to the Roth IRA, because the fee advantage of the Roth IRA disappears. A worker subject to the Roth IRA income phase-out ($153,000–$168,000 MAGI for singles and heads of household in 2026, $242,000–$252,000 for joint) cannot contribute directly and must use the backdoor Roth conversion mechanism instead. A worker with strong reason to expect a much higher retirement marginal bracket (e.g., business owner expecting a liquidity event) might lean more heavily into Roth.
Roth vs Traditional 401(k) — the bracket-aware decision
For 401(k) contributions beyond the match, the next decision is Traditional vs Roth. The structurally honest framing:
- Traditional contribution — deducted from current taxable income, growth tax-deferred, withdrawal taxed as ordinary income in retirement.
- Roth contribution — made with after-tax dollars, growth tax-free, qualified withdrawal tax-free in retirement.
The mathematical equivalence: if your marginal tax rate is the same in your contribution year and your retirement withdrawal year, Traditional and Roth produce identical after-tax outcomes. The difference is your bracket arbitrage. Contribute Traditional when current bracket exceeds expected retirement bracket; contribute Roth when current bracket is at or below expected retirement bracket.
The conventional rule of thumb — “Roth when young, Traditional when old” — embodies the assumption that incomes (and brackets) rise over a career. For workers on a steady upward trajectory, that is right. But it is wrong about half the time once you factor in:
- Retirement bracket effects from Social Security taxation. A retiree earning $80,000 in 401(k) withdrawals plus $30,000 in Social Security can face effective marginal rates of 22% federal plus state. The “I’ll be in a lower bracket in retirement” assumption frequently underestimates retirement-era taxation.
- RMD effects. Traditional 401(k) balances require minimum distributions starting at age 73, which can push retirees into higher brackets they would not otherwise reach.
- Roth’s lack of RMD (during owner’s lifetime) — preserves optionality.
- State tax differences. A worker in California (top state bracket 13.3%) contributing during career years and retiring to Florida (no state income tax) has a strong case for Traditional. A worker in Texas (no state tax) contributing during career and retiring to California has a strong case for Roth.
- IRMAA brackets. Medicare Part B and D premiums rise with income via the Income-Related Monthly Adjustment Amount (IRMAA). Traditional 401(k) withdrawals count toward IRMAA; Roth withdrawals do not.
The practical math for a typical worker in the 22% federal bracket (single filer, $50,000–$103,000 of taxable income in 2026) is: Roth is usually right. The current 22% rate is at or below most realistic retirement marginal rates once Social Security and RMD effects are layered in, particularly for workers planning to accumulate a substantial retirement balance.
For workers in the 32% or 35% bracket (single filer above $208,000 or $258,000 respectively in 2026), Traditional is usually right. The current tax savings of 32–35% on each contribution dollar exceeds the realistic retirement marginal rate for most accumulating households.
Most savers benefit from contributing to both Roth and Traditional accounts across their career, which preserves optionality in retirement to draw from whichever bucket is tax-optimal in any given year. The Roth-vs-Traditional comparison covers the specific bracket math in more detail.
The mega backdoor Roth — when available
The mega backdoor Roth is the highest-impact retirement planning lever in the US tax code, but it is plan-specific. It exists at maybe 30–40% of US employer 401(k) plans — mostly at large tech companies, large financial services firms, and some other high-end employers. If your plan does not allow after-tax (non-Roth, non-Traditional) employee contributions plus either in-plan Roth conversion or in-service distribution, the mega backdoor Roth is unavailable regardless of your income.
Where it is available, the math is striking. Internal Revenue Code Section 415(c) caps total annual additions to a 401(k) — across employee deferral, employer match, and employee after-tax — at $72,000 in 2026 ($80,000 for those 50+). For a worker maxing the $24,500 employee deferral with a $10,000 employer match, the remaining capacity is $72,000 − $24,500 − $10,000 = $37,500 of after-tax contribution. That $37,500 is contributed with after-tax dollars (not deductible). The strategy then converts those after-tax contributions to Roth as soon as possible — either through an in-plan Roth conversion or via in-service withdrawal to a Roth IRA at a separate brokerage. Once converted, the after-tax dollars compound entirely tax-free.
For an eligible worker, executing the mega backdoor Roth at the full $37,500 annual capacity for 30 years at a 7% nominal return generates approximately $3.5 million of additional tax-free retirement assets — on top of the $24,500 employee deferral and the employer match. This is the lever that distinguishes a maxed-out tax-advantaged retirement portfolio from a merely strong one. The full mechanics are walked through in the mega backdoor Roth guide.
Three operational notes. First, verify your plan permits both after-tax contributions and either in-plan conversion or in-service distribution by reading the Summary Plan Description or asking HR. Second, executing the conversion frequently (ideally same-period as contribution, or monthly) minimizes pre-conversion growth that would be subject to ordinary income tax when converted. Third, the mega backdoor Roth has been at risk of legislative elimination in recent Congresses; it remains available in 2026 but is not guaranteed indefinitely.
After everything tax-advantaged is exhausted
For workers with savings capacity beyond the tax-advantaged ceilings — the household saving $50,000+ per year on top of retirement accounts — the next destination is a taxable brokerage account. The right tax-efficient strategy is to hold broad-market index funds and ETFs (low turnover, low dividend distribution, minimal capital gains distributions) and minimize trading. Tax-loss harvesting can offset capital gains realized elsewhere. Holding individual stocks creates higher tax friction; holding actively managed mutual funds in a taxable account creates worse tax friction due to the capital gains distributions those funds tend to throw off.
A typical asset-location strategy puts the most tax-inefficient holdings (taxable bonds, high-dividend stocks, REITs) in tax-advantaged accounts (Roth IRA, 401(k), HSA) and the most tax-efficient holdings (broad-market equity index funds, growth-tilted ETFs) in the taxable brokerage. Most retail savers do not need to optimize asset location aggressively, but the principle is worth understanding once the savings rate justifies the complexity.
Variants by household and earnings profile
Married filing jointly: Both spouses can fund their own Roth IRAs (or spousal Roth IRAs based on the working spouse’s earned income) up to $7,500/$8,600 each, totaling $15,000/$17,200 of household Roth capacity. Both can max their employer 401(k) plans. Joint income limits apply for Roth IRA phase-out ($242,000–$252,000 MAGI in 2026).
Self-employed: A Solo 401(k) or SEP-IRA replaces the employer plan, with higher contribution capacity (up to $72,000 in 2026 between employee deferral and employer profit-sharing) but no employer match. The Solo 401(k) allows Roth treatment on the employee deferral portion; SEP-IRA does not. A self-employed worker with the income to do so can effectively replicate the mega backdoor Roth structure through a Solo 401(k) that permits after-tax contributions.
Very high income (above Roth IRA phase-out): The backdoor Roth IRA — contributing to a non-deductible Traditional IRA, immediately converting to Roth — bypasses the income limit. The pro-rata rule complicates the math if you have other Traditional IRA balances; rolling those into a 401(k) before executing the backdoor Roth resolves the complication. For very-high-income households, the mega backdoor Roth at the 401(k) plan is usually higher-leverage than the regular backdoor Roth IRA. Households with substantial restricted stock unit compensation frequently land in this bracket the first time their vesting cliff arrives; the under-withholding trap, the timing of recognition, and the planning levers around RSU income are walked through in the RSU vesting taxation guide.
Very low income (below standard deduction): The Roth IRA is almost always right. The Saver’s Credit (federal credit for retirement contributions by lower-income households, up to $1,000 single / $2,000 joint) reduces the cost of contributing further. Traditional IRA deduction is less valuable because the bracket is already low.
How the hierarchy shifts by life stage
Early career (20s, low-to-mid income). Capture the full 401(k) match. Beyond the match, default heavily to Roth contributions — your current bracket is likely at or below your future retirement bracket, and decades of tax-free Roth compounding are uniquely valuable for the youngest savers. If the budget allows funding only one account beyond the match, make it the Roth IRA at a low-cost broker. If income is below the Saver’s Credit thresholds, the federal credit (up to $1,000 single / $2,000 joint) is a meaningful subsidy that further tilts toward funding retirement.
Mid-career (30s and 40s, peak earning years). This is when the full hierarchy gets exercised: match, HSA, Roth IRA, max 401(k), mega backdoor Roth (if available), and possibly taxable. Roth vs Traditional 401(k) becomes a more bracket-specific decision; the 22–24% bracket band is the inflection point where the math gets genuinely close. Doing some of both — for example, half the 401(k) as Roth and half as Traditional — is a defensible hedge against bracket uncertainty in retirement. Mega backdoor Roth, if available, is the highest-leverage lever and should be a deliberate planning priority rather than an afterthought.
Pre-retirement (50s and early 60s). Catch-up contributions kick in at age 50: an extra $1,100/year on IRA contributions, an extra $8,000/year on 401(k) contributions, an extra $1,000/year on HSA contributions (the HSA catch-up applies at 55). Use them. Roth conversions become a more nuanced planning tool — moving Traditional balances to Roth in lower-bracket years (sabbatical years, early retirement before Social Security starts) can pre-pay tax at a low rate and create tax-free balances for later. RMD planning starts mattering: a heavily Traditional-skewed balance approaching age 73 can generate large mandatory withdrawals that push into higher brackets and IRMAA tiers.
Retirement (65+). The hierarchy stops being about contributions and becomes about withdrawal sequencing — which accounts to draw from in which order to minimize lifetime tax. The general framework: taxable accounts first (long-term capital gains are taxed at lower rates than ordinary income), then Traditional accounts up to the top of the desired bracket, then Roth for anything beyond. Roth conversions in the gap years between retirement and RMD age 73 are often the highest-impact tax-planning move available.
The order, restated
For most US workers, the order is: capture the full 401(k) match, then max the HSA if eligible, then max the Roth IRA, then max the 401(k) deferral, then execute the mega backdoor Roth if the plan allows, then route additional savings to a taxable brokerage account. The math is not arbitrary; it follows from the structural tax advantages of each layer.
What this guide does not do is tell you whether you can afford to fund the hierarchy. That is a budgeting question, not a tax question, and it depends on your income, household structure, and other financial goals. But for the dollars you can save, this is the order — and getting it right over a working career compounds to materially more retirement wealth than getting it generically right.
Most of the contribution limits referenced above adjust each year for inflation, and the Internal Revenue Service typically announces the following year's numbers in early November. The mechanics of which limits are indexed, which are statutory, and what the adjustment pattern has historically looked like are detailed in anticipating the IRS 2027 contribution limits, with a worked timeline of how to plan ahead of the announcement.
Sources
- 2026 Internal Revenue Service contribution limits for 401(k), IRA, Roth IRA, HSA, and the Section 415 overall limit: Internal Revenue Service — 2026 Limits Notice.
- Roth IRA income phase-out and modified adjusted gross income mechanics: Internal Revenue Service Publication 590-A.
- High-deductible health plan definition and Health Savings Account eligibility: Internal Revenue Service Publication 969.
- Required Minimum Distribution rules and SECURE 2.0 changes to RMD age (raised to 73 from 2023, raised again to 75 from 2033): Internal Revenue Service — Required Minimum Distributions.
- Social Security benefit taxation thresholds (provisional income $25,000 single / $32,000 joint for partial taxation, $34,000 / $44,000 for 85% taxation): Social Security Administration — Income Taxes And Your Benefits.
- Medicare Income-Related Monthly Adjustment Amount (IRMAA) brackets: Medicare.gov — Part B Costs.
- Saver’s Credit thresholds (Internal Revenue Code Section 25B): Internal Revenue Service Form 8880.
If a limit on this page looks off against current Internal Revenue Service guidance, the official source above is the one we trust; let us know via contact and we will reconcile.
Quick answers
Should I max my 401(k) or open a Roth IRA first?
After capturing the full employer match on the 401(k), the Roth IRA usually beats further 401(k) contribution for moderate-income workers. The Roth IRA offers a broader investment menu at typically lower expense ratios than most employer 401(k) plans, plus the structurally favorable Roth tax treatment. After the Roth IRA cap, return to the 401(k) to maximize the deferral. Exceptions: a particularly well-designed 401(k) with institutional-class index funds at near-zero expense ratios, or income above the Roth IRA phase-out ($153K–$168K single, $242K–$252K joint in 2026).
What is the mega backdoor Roth and who can use it?
The mega backdoor Roth is a strategy that exploits the gap between the 401(k) employee deferral limit ($24,500 in 2026) and the Section 415 overall plan limit ($72,000 in 2026), routing after-tax employee contributions into the plan and converting them to Roth treatment. The strategy requires the employer 401(k) plan to permit after-tax contributions plus either in-plan Roth conversion or in-service withdrawal. Approximately 30–40% of US employer plans support both features, concentrated at large tech companies, major financial firms, and well-designed mid-size employer plans. Verify the Summary Plan Description before attempting it.
Why does the HSA come before the Roth IRA in the order?
The Health Savings Account is the only triple-tax-advantaged account in the US code: contributions are tax-free (federal, most state, and FICA when made through payroll), growth is tax-free if invested, and withdrawals are tax-free for qualified medical expenses at any age. After 65, non-medical withdrawals are taxed as ordinary income (the same treatment as a Traditional IRA), so the HSA functions as a Traditional IRA for non-medical use plus as a tax-free medical account. No other US account combines all three legs.
Educational content only. finbarrow is an independent editorial publication, not a licensed financial advisor, broker, tax preparer, or attorney. Verify rates and terms with the issuer or relevant regulator. See disclaimers and funding disclosures.