Repository navigation
Description
The model subtracts health_savings_account_payroll_contributions from wages in full when it computes irs_employment_income. It never caps the amount at the HSA contribution limit, so it takes contributions past the limit out of AGI and out of EITC earned income too.
For example, a single 40-year-old in Texas earns $60,000 in 2026 and owes $5,020 of federal income tax with no HSA contributions. With $4,400 of HSA payroll contributions, the 2026 self-only limit, the model gives AGI of $55,600 and income tax of $4,492. With $20,000, more than twice the $8,750 family limit, it gives AGI of $40,000 and income tax of $2,620. With self-only coverage all year, the worker owes tax on the $15,600 excess, for AGI of $55,600 and income tax of $4,492.
Only users who enter contributions above the limit in a household calculation get these results, since the model reads no HSA payroll contributions from the default dataset.
What the law says
- Congress excludes an employer's contributions to an eligible employee's HSA only "to the extent such amounts do not exceed the limitation under section 223(b)" (IRC 106(d)(1)).
- The IRS treats salary reductions through a cafeteria plan as employer contributions, and says "Excess contributions made by your employer are included in your gross income" (Publication 969).
- In IRC 223(b), Congress sets monthly limits for self-only and family coverage, adds $1,000 from age 55, and cuts the limit on the employee's own HSA deduction by the employer contributions 106(d) excludes. For 2026 the IRS published inflation-adjusted limits of $4,400 and $8,750 (Rev. Proc. 2025-19).
In the code
- The model subtracts
pre_tax_contributionsfromemployment_incomeinirs_employment_income.pylines 12-15. - It counts all of
health_savings_account_payroll_contributionsamong those contributions inpre_tax_contributions.yamllines 11-12. - It reads the 223(b)(2) family limit only to uprate the input, in
health_savings_account_contributions.pylines 12-16, though we added the self-only and family limits as parameters in Uprate HSA payroll contributions by the 223(b)(2) contribution limit #10097. - It counts
irs_employment_incomeas EITC earned income ineitc_earned_income.pylines 25-26. - For 401(k) deferrals the model already applies the 402(g) limit, scaling desired deferrals down to it in
traditional_401k_contributions.pylines 18-21 andelective_deferral_contribution_scale.pylines 28-31.
Reproduction
At 935b24f, this script:
from policyengine_us import Simulation, CountryTaxBenefitSystem
YEAR = 2026
def run(people, tax_unit_extra=None, state="ND", outputs=(), year=YEAR):
members = list(people)
adults = [n for n in members if people[n].get("age", 40) >= 18][:2]
marital = {"m": {"members": adults}}
for n in members:
if n not in adults:
marital[f"m_{n}"] = {"members": [n]}
situation = {
"people": {name: {k: {year: v} for k, v in attrs.items()} for name, attrs in people.items()},
"tax_units": {"tu": {"members": members, **{k: {year: v} for k, v in (tax_unit_extra or {}).items()}}},
"families": {"f": {"members": members}},
"spm_units": {"s": {"members": members}},
"marital_units": marital,
"households": {"h": {"members": members, "state_code": {year: state}}},
}
sim = Simulation(situation=situation)
return {o: float(sim.calculate(o, year).sum()) for o in outputs}
def fmt(d):
return ", ".join(f"{k}={v:,.2f}" for k, v in d.items())
p = CountryTaxBenefitSystem().parameters(f"{YEAR}-01-01").gov.irs.gross_income.health_savings_account_contributions.limit
print("limit self_only =", p.self_only, " family =", p.family)
out2 = ["irs_employment_income", "adjusted_gross_income", "income_tax"]
for hsa in [0, 4_400, 8_750, 20_000]:
print(f"HSA payroll {hsa:>6,}:", fmt(run({"you": {"age": 40, "employment_income": 60_000, "health_savings_account_payroll_contributions": hsa}}, state="TX", outputs=out2)))prints:
limit self_only = 4400 family = 8750
HSA payroll 0: irs_employment_income=60,000.00, adjusted_gross_income=60,000.00, income_tax=5,020.00
HSA payroll 4,400: irs_employment_income=55,600.00, adjusted_gross_income=55,600.00, income_tax=4,492.00
HSA payroll 8,750: irs_employment_income=51,250.00, adjusted_gross_income=51,250.00, income_tax=3,970.00
HSA payroll 20,000: irs_employment_income=40,000.00, adjusted_gross_income=40,000.00, income_tax=2,620.00
Fix
The model could take no more than the person's 223(b) limit out of wages and leave the rest in irs_employment_income, as it does for 401(k) deferrals. To find that limit, we would add a parameter for the $1,000 age-55 amount and an input for high deductible health plan coverage: none, self-only or family. Congress limits the 106(d) exclusion to eligible individuals, who need that coverage (IRC 223(c)(1)). Until the coverage input exists, the model could cap each person at the family limit plus $1,000 from age 55, the most Congress allows one person under 223(b).
Activity