What is this calculator for?
Your employer's open enrollment opens next Monday. You're trying to decide whether to contribute to the HSA (only available because you'll pick the high-deductible health plan) or to the FSA. You vaguely know both are "tax-free" but you can't remember the differences — the $3,300 vs $3,200 contribution limits, the use-it-or-lose-it rule, the rollover question. Or you're 51, your kids are out of the house, and you're trying to figure out whether maxing the HSA is a better retirement-savings move than contributing more to the 401(k). The HSA & FSA maximizer translates IRS rules into dollar-amount recommendations for your specific situation.
An HSA — Health Savings Account — is a tax-advantaged savings account tied to a High-Deductible Health Plan (HDHP). 2026 limits: $4,400 single / $8,750 family, with a $1,000 catch-up for age 55+. Contributions are tax-deductible (or pre-tax through payroll); growth is tax-free; withdrawals for qualified medical expenses are tax-free. After 65, non-medical withdrawals are taxed like an IRA (no penalty). It's the only account in the US tax code with all three layers of tax advantage — pre-tax in, tax-free growth, tax-free out (for medical use). Most financial planners call it the best retirement account available, given that older people spend $200K+ on medical costs in retirement.
An FSA — Flexible Spending Account — is also pre-tax for medical expenses, but with critical differences: tied to your employer (lost when you change jobs), use-it-or-lose-it (most plans require you to spend the year's contribution within the plan year, with up to $640 rollover in 2025 or 2.5-month grace period depending on employer plan), lower annual limit ($3,300 in 2025), and no investment growth. The FSA's role is funding predictable medical expenses for the year (glasses, copays, prescriptions, dental work). The HSA's role is funding healthcare AND building a lifetime tax-advantaged medical fund.
This calculator estimates the optimal HSA or FSA contribution amount for your situation: your annual medical expenses, your income tax bracket, your retirement-planning horizon, and your insurance type. It outputs the dollar amount to contribute, the tax savings, and which account to prioritize.
How to use this calculator
Start by selecting your insurance type. To contribute to an HSA you MUST have an HSA-eligible HDHP — the 2026 minimums are $1,650 deductible single / $3,300 family. If you have a traditional PPO or HMO, you can't contribute to HSA but you can to FSA. If you have an HDHP, you can do HSA only (not both HSA and a general-purpose FSA — though you can pair HSA with a "limited-purpose FSA" for dental/vision only).
Enter your annual medical expenses. For people with FSAs, this is what you'll spend in the plan year: prescriptions, copays, glasses, contacts, dental cleanings/fillings/orthodontia, OTC drugs (allowed since 2020 CARES Act), menstrual products, sunscreen. For HSA contributors, expenses are paid out of HSA balance, but you don't have to spend in the contribution year — many HSA strategies involve paying medical expenses out of pocket and investing the HSA for growth.
Enter your federal tax bracket (estimated marginal rate — typically 12%, 22%, 24%, 32%, 35%, 37%). The calculator computes tax savings as contribution × marginal rate. Higher brackets get more bang for the buck — a $5,000 HSA contribution at 32% marginal saves $1,600 in federal tax; at 12% it saves $600.
Indicate state. Most states allow HSA contributions to be deducted from state income tax as well — but California and New Jersey do not (their state income tax does not conform to federal HSA rules). FSA contributions reduce state taxable wages in most states automatically through payroll. The calculator includes state tax savings in the total tax-savings figure.
If you're using HSA as a retirement vehicle (paying medical out of pocket and investing the balance), select HSA-as-retirement strategy. The calculator switches to long-horizon mode and projects HSA balance growth at your chosen rate of return for the years until retirement.
Understanding your results
The calculator returns recommended contribution amount, annual tax savings (federal + state), effective net cost (contribution minus tax savings), and for HSAs in retirement mode, the projected balance at retirement.
How to read the tax-savings number. A $4,400 HSA contribution at 24% federal + 5% state marginal = $1,276 in tax savings. Your net cost to fund the account: $4,400 − $1,276 = $3,124. You effectively get $4,400 of medical-expense buying power for $3,124 of out-of-pocket. Plus FICA savings on payroll HSA contributions (employer-sponsored HSAs through cafeteria plans avoid the 7.65% FICA on contributions — about $337 more savings on the same $4,400). Total tax + FICA savings: $1,613. Net cost: $2,787.
The HSA-as-retirement-account framing. If you contribute $4,400/year for 30 years (assuming inflation-indexed limits trending higher), invest at 7% real, and avoid spending the balance (paying medical out of pocket from regular income), the projected balance at retirement: $480,000+ in today's dollars. This is a tax-advantaged $480K medical fund that pays for retirement healthcare tax-free. CFPB and Fidelity estimate retirees need $200-300K for healthcare in retirement; a maxed HSA easily covers that with surplus.
The "saving HSA receipts" strategy. The IRS allows you to reimburse yourself from HSA at any time for medical expenses, as long as the expenses were incurred AFTER the HSA was opened. Many strategic HSA users keep receipts for years of out-of-pocket medical expenses (dentist visits, glasses, prescriptions, doctor copays), let the HSA grow tax-free in investments, and then reimburse themselves decades later for cumulative past expenses. This converts the HSA into a tax-free cash withdrawal account using documented prior medical expenses. Risk: receipts can be lost, audits can challenge documentation, IRS guidance on receipt-aging is technical. But within IRS rules, this is a legitimate strategy.
FSA-specific guidance. The use-it-or-lose-it rule penalizes over-funding — contribute close to your reasonable expected expenses, not aspirational maxes. Most employer FSA plans now allow either: (1) up to $640 rollover to next year (2025 limit, indexed), or (2) a 2.5-month grace period to spend prior-year contributions (by March 15). Read your plan documents carefully — some employers have neither, in which case anything left in your FSA on December 31 is forfeit. A common error: setting $3,300 FSA contribution based on aspirational orthodontia plans that get delayed; if you spend only $1,800 of it, you forfeit $1,500 of contribution to the employer.
A worked example
Daniel and Lisa are 44 and 42, married filing jointly with two kids (ages 11 and 13). Household income: $185,000. They're at a 24% federal marginal bracket plus 5% state in their home state. Open enrollment is next week. They're choosing between Daniel's employer's HDHP (deductible $5,000 family, lower premium) and the PPO option (deductible $1,500 family, higher premium with $200/month more in premium cost).
HDHP scenario: They estimate their family medical spend at $4,200 (orthodontia for older child, two adults annual physical/labs, kids' well-child visits, ongoing prescriptions). HSA eligibility unlocked. Contribute $8,750 (family max) to HSA. Tax savings: $8,750 × (24% + 5%) = $2,538. Plus FICA savings on payroll contribution (7.65% × $8,750 = $669). Total tax savings: $3,207. Net cost of $8,750 HSA contribution: $5,543. Plus HDHP premium savings vs PPO: $200/month × 12 = $2,400 savings on premium.
Annual benefit summary HDHP route: HSA contribution $8,750 (covers $4,200 of expenses plus $4,550 to invest for retirement) − tax savings $3,207 − premium savings $2,400 = net positive $4,857 vs the PPO route. Plus the HSA grows tax-free for 20+ years until retirement.
PPO scenario: No HSA available. Contribute up to $3,200 to FSA. Lisa thinks they'll spend close to $4,200, so they fund $3,300 (current FSA limit for 2025, or $3,400 in 2026). Tax savings: $3,200 × 29% = $928. FICA savings: $245. Total: $1,173. Net cost: $2,027 for $3,200 of medical-spend buying power. Premium of $200/month more = $2,400 higher annual cost.
The math: HDHP+HSA path saves them about $4,857 + $4,550 invested for retirement annually. PPO+FSA path saves $1,173 in taxes, costs $2,400 more in premium, no retirement growth. HDHP+HSA wins by ~$6,000-7,000/year for this household. Caveat: HDHP requires the family to absorb up to $5,000 deductible if a major medical event occurs in the year. They should ensure their emergency fund covers the worst-case ($5,000 deductible plus out-of-pocket max, typically $10-15K family annual cap on cost). If they have less than $15K accessible cash, the HDHP is riskier despite the tax advantages.
Twenty years later — Daniel's 64, near Medicare eligibility. If they maxed HSA each year and invested at 7% real, the HSA balance: roughly $385,000. Paid medical out of pocket from regular income (saving receipts). They can now reimburse themselves $40K of accumulated documented medical expenses (essentially a tax-free $40K cash withdrawal) plus they have $345K growing for retirement medical needs. The 20-year HSA strategy has built them a substantial tax-advantaged medical fund that covers retirement healthcare with surplus left for other use.
Related resources
For broader retirement-planning context, use the 401(k) Planner and Social Security Estimator. For paycheck-level impact of pre-tax HSA/FSA deductions, the Paycheck Calculator. For health-insurance-cost-related decisions before retirement, the ACA Subsidy Estimator. For long-horizon compounding math on HSA-as-retirement-account strategies, the Compound Interest Calculator. The IRS Publication 969 (Health Savings Accounts and Other Tax-Favored Health Plans) is the authoritative federal reference; IRS Publication 502 (Medical and Dental Expenses) lists what counts as qualified medical expenses.