Tax calculator
Tax Optimization Calculator
For the last working years before retirement: what the 401(k) catch-ups, an HSA and the age-65 deductions would save you this year, under the current federal rules.
Tax Moves for the Final Working Years
What the calculator answers
How much less federal income tax and payroll tax you would pay this year if you put the most your age allows into a pre-tax 401(k) and an HSA, compared with what you contribute now. It applies the 2026 limits for your age, the rule that sends high earners' catch-ups to the Roth side, the end of HSA contributions on Medicare, and the extra deductions at 65. It is built for wages: if you have already stopped work, the tax bracket calculator handles IRA withdrawals and Social Security.
How to fill it in
- 1Enter your wages for the year and your filing status. If you are married and both work, run it once for each spouse’s wages and plan, then add the savings; the brackets are shared, so treat the sum as approximate.
- 2Enter your age at the end of 2026. It sets the catch-ups: the 50+ 401(k) catch-up, the larger one in the years you turn 60 to 63, and the HSA catch-up from 55.
- 3If you are married filing jointly, tick the box if your spouse is 65 or older by the end of the year. If you are 65 or older yourself, say whether you are enrolled in Medicare.
- 4Enter what you contribute now to a traditional (pre-tax) 401(k) and to an HSA through payroll, and your itemized deductions if you itemize: state and local taxes, mortgage interest, charitable gifts.
2026 401(k) limits by age
- Base deferral
- $24,500
- Age 50 to 59, and 64+
- $32,500
- Age 60 to 63
- $35,750
- IRA, age 50+
- $8,600
2026 HSA limits
- Self-only coverage
- $4,400
- Family coverage
- $8,750
- Catch-up, age 55+
- $1,000
- Once enrolled in Medicare
- $0
Reading the results
Potential annual tax savings is the difference in total tax between your current contributions and the maximum. The current and optimized columns show adjusted gross income, the deduction used, taxable income, federal tax and FICA. The recommendations list what to change, and flag when your catch-up has to be Roth and so will not lower this year's bill.
Before you change payroll elections
Illustrative example: the people and figures below are hypothetical, not real clients. Numbers are calculated from the stated assumptions.
Carol and Jim Cut Their Tax by $4,950 a Year
Carol is 61 and earns $185,000 as a hospital administrator; she plans to retire at 65. Jim, 64, retired last year and is delaying Social Security to 70, so Carol's salary is their only earned income. He is covered by her employer's family high-deductible health plan until Medicare starts. They file jointly, take the standard deduction now that the mortgage is paid off, and hold most of their $2.1 million in IRAs and 401(k)s.
Carol has been deferring $15,000 a year to her 401(k), a habit from when their children were in college, and nothing to the HSA the plan offers. These are the calculator's default inputs. Here is what each change does to their 2026 federal income tax and payroll tax.
- Wages
- $185,000
- Standard deduction, married filing jointly
- $32,200
- Taxable income today
- $137,800
- Federal tax plus FICA today
- $33,862
- 1
Raise the pre-tax 401(k) to $24,500: saves $2,090
The extra $9,500 comes off income taxed at 22%. Payroll tax is unchanged, because 401(k) deferrals are still subject to FICA.
- 2
Add the $11,250 catch-up as Roth: saves $0 this year
At 61 Carol qualifies for the larger catch-up for ages 60 to 63. Because her wages last year were over $150,000, it must go to the plan's Roth option. It does not lower this year's tax, but those dollars and their growth will come out tax-free, will not count toward required minimum distributions, and will not push up the income that sets Medicare premiums. They decided it was worth it.
- 3
Put $9,750 in the HSA through payroll: saves $2,860
The family limit of $8,750 plus Carol's $1,000 catch-up for being 55 or older. Contributions made through a cafeteria plan skip both income tax and FICA, so this dollar-for-dollar saves more than the 401(k): $715 of it is payroll tax. They invest the account and pay current medical bills from cash, keeping the HSA for Medicare premiums and costs later.
- 4
Next year, Jim turns 65: a further $1,673
Holding everything else equal, Jim's age adds the $1,650 additional standard deduction and the senior deduction of up to $6,000, available through 2028. The senior deduction shrinks by 6% of income above $150,000 for joint filers; with their adjusted gross income now $150,750, the steps above keep it nearly whole at $5,955. To model it, tick "My spouse is 65 or older". (This step uses 2026 figures; next year's will be adjusted for inflation.)
The result
- Pre-tax 401(k) to the base limit
- $2,090
- Roth catch-up
- $0 now; tax-free later
- HSA through payroll
- $2,860
- Tax saved in 2026
- $4,950
- Federal tax plus FICA after the changes
- $28,912
Take-home pay falls, because $30,500 more goes into accounts each year, but they are saving $4,950 in tax for it. Over the four years to Carol's retirement the tax saved alone comes to about $19,800 at today's rates, before growth.
FICA here: Social Security tax of 6.2% up to the $184,500 wage base and Medicare tax of 1.45%. Federal figures from the 2026 tables. State income tax is not included.
What Can You Still Save in Tax Before Retiring?
Several thousand dollars a year for most people in their late 50s and early 60s, from two accounts: a pre-tax 401(k) filled to the limit, and a health savings account funded through payroll. The last working years are usually the highest-earning ones, so every deferred dollar comes off income taxed at your top rate, often 22% to 35%, and can come out later at a lower one.
The calculator compares your current contributions with the most your age allows. With its defaults, a hypothetical 61-year-old earning $185,000, married filing jointly and deferring $15,000, pays $33,862 in federal income tax and FICA. Raising the pre-tax 401(k) to $24,500 and putting $9,750 in a family HSA through payroll brings that to $28,912: a saving of $4,950 a year. Her $11,250 catch-up is on top, but because her wages are over $150,000 it has to be Roth and does not change this year's figure. The example tab walks through each step.
How Do the Catch-Ups Work From 50 to 63?
From the year you turn 50 you can add a catch-up to the regular limit, and in the years you turn 60, 61, 62 and 63 the 401(k) catch-up is larger (IRS). In the year you turn 64 it drops back to the standard amount. The HSA has its own catch-up from 55.
| Account | Base | 50 to 59, 64+ | 60 to 63 |
|---|---|---|---|
| 401(k), 403(b), governmental 457(b) | $24,500 | $32,500 | $35,750 |
| IRA (traditional and Roth combined) | $7,500 | $8,600 | $8,600 |
| HSA, self-only / family (catch-up from 55) | $4,400 / $8,750 | +$1,000 from 55, until Medicare | |
Employer contributions sit on top of these, within the overall limit of $72,000 a year excluding catch-ups. A married couple who both work each have their own 401(k), IRA and catch-up limits; the HSA family limit is shared between spouses.
When Must Catch-Ups Go Roth?
From 2026, when your wages from the employer sponsoring the plan were over $150,000 in the previous year (IRS). The test uses Social Security (FICA) wages from that employer, so a partner or self-employed person without such wages is outside it, and so, usually, is someone in their first year with a new employer. The base deferral of $24,500 can still be pre-tax; only the catch-up is affected.
The calculator applies the rule using this year's wages as a stand-in for last year's: above the threshold, its optimized scenario puts only the base deferral pre-tax. That is the cost. The benefit is that Roth dollars come out tax-free, are not subject to required minimum distributions while you are alive, and do not count toward the income that sets Medicare IRMAA surcharges. For someone who expects large required distributions later, being pushed into Roth may be no loss at all. If your plan has no Roth option, ask whether it will add one: without it, the plan cannot accept catch-ups from employees the rule covers (final regulations).
What Changes at 65?
Your deductions rise and your HSA contributions end once you enroll in Medicare. For 2026, each person 65 or older adds $1,650 to the standard deduction if married ($2,050 if single), and can claim the senior deduction of up to $6,000, available for 2025 through 2028 whether or not you itemize (IRS).
| Both spouses | Standard deduction | Senior deduction (before phase-out) | Total |
|---|---|---|---|
| Under 65 | $32,200 | $0 | $32,200 |
| One 65 or older | $33,850 | $6,000 | $39,850 |
| Both 65 or older | $35,500 | $12,000 | $47,500 |
The senior deduction falls by 6 cents for every dollar of modified adjusted gross income above $150,000 for joint filers ($75,000 for others), so a couple both 65 or older loses it entirely at $250,000. Near that range, each pre-tax 401(k) or HSA dollar saves more than your bracket rate, because it also restores part of the deduction. The same logic applies to Roth conversions and IRA withdrawals in those years.
On Medicare, the HSA stops taking contributions, but the balance remains yours to spend tax-free on medical costs, including Part B and Part D premiums (IRS Publication 969). Because Part A is backdated up to six months when you enroll after 65, stop contributing six months before you apply for Medicare or Social Security (Medicare.gov). The HSA guide covers using the account in retirement.
Pre-Tax or Roth, This Close to Retirement?
Pre-tax usually wins in the peak earning years, and Roth usually wins once the paychecks stop. The comparison is your tax rate on the contribution now against your rate when the money comes out. For 2026, joint filers pay 22% on taxable income between $100,800 and $211,400 and 24% up to $403,550, while the 12% bracket runs to $100,800. A couple who retire with modest spending needs may spend several years in the 12% bracket before Social Security and required distributions begin.
That gap between retirement and required minimum distributions (at 73, or 75 if born in 1960 or later) is the time for Roth conversions. Deferring at 24% while working and converting at 12% after is the pattern this calculator supports. It fails for people who already hold most of their wealth in traditional accounts: their required distributions, stacked on Social Security, can keep them in the 22% or 24% bracket for life and lift Medicare premiums through IRMAA. For them, some Roth contributions now can be the better choice even at a high rate. The guide to Roth conversions before RMDs, the Roth vs traditional comparison and the Medicare and IRMAA guide work through the trade-off.
What Does the Calculator Leave Out?
- Other income. Interest, dividends, capital gains, Social Security benefits, pensions and IRA withdrawals are not modeled. Enter wages only, and use the tax bracket calculator for retirement income.
- State income tax, credits and the alternative minimum tax.
- Your HSA coverage. The optimized scenario assumes a qualifying high-deductible plan and uses the coverage you choose: the self-only limit of $4,400 or the family limit of $8,750, plus the catch-up from 55.
- Two earners. The calculator uses one set of wages and one plan; run it for each spouse.
- Charitable giving from IRAs. From age 70½, qualified charitable distributions of up to $111,000 a year go straight from an IRA to charity without counting as income; see the QCD guide.
All federal figures come from Revenue Procedure 2025-32 and the IRS cost-of-living notices for 2026. Treat the result as an estimate for planning, and check large decisions with a tax professional who can see your whole return.
Learn more: Read our comprehensive guide on
Roth Conversions Before RMDsHow to use the years between retirement and required minimum distributions to move money to Roth at low rates.
How this calculator works
Method and assumptions
- Current: adjusted gross income is your wages minus your traditional 401(k) and payroll HSA contributions. Taxable income subtracts the larger of your itemized deductions or the standard deduction (with the 65+ additions), plus the senior deduction of $6,000 per person 65+, which shrinks by 6% of income above $150,000 (joint) or $75,000. Federal tax uses the 2026 brackets.
- Payroll tax is 6.2% Social Security on wages up to $184,500, 1.45% Medicare, and 0.9% Additional Medicare tax above $250,000 (joint) or $200,000. A payroll HSA contribution escapes it; a 401(k) deferral does not.
- Optimized: the same calculation with the pre-tax 401(k) at your age's limit ($24,500, plus $8,000 at 50+ or $11,250 at 60 to 63). If your wages exceed $150,000, the catch-up must be Roth, so only $24,500 counts as pre-tax. This year's wages stand in for last year's, which is what the rule actually tests.
- The HSA goes to its limit for the coverage you choose: $4,400 self-only or $8,750 family, plus $1,000 from 55, and nothing once you are 65+ and enrolled in Medicare.
- The savings figure is the current total tax minus the optimized total tax, shown as zero if you already contribute more than the limits.
What it leaves out
- It assumes you are covered by a high-deductible health plan and can contribute to an HSA. Roth IRA contributions are left out because they do not change this year’s tax.
- Only the wages entered are taxed: a working spouse’s wages, Social Security, IRA withdrawals, investment income, credits, the alternative minimum tax and state income tax are left out.
- Itemized deductions are taken as entered; the SALT cap and other limits on them are not applied.
Sources
Methodology reviewed · Uses 2026 tax and benefit figures · For education, not individual advice
Tax Optimization FAQs
What does the Roth catch-up rule mean for me?
Is it worth maxing out a pre-tax 401(k) a few years before retiring?
Can I keep contributing to an HSA after 65?
What extra deductions do I get at 65 in 2026?
Should I itemize or take the standard deduction?
Can I still contribute to an IRA while working in my 60s?
What tax moves matter once I have stopped working?
Related Calculators
Tax Bracket Calculator
Federal tax on retirement income, with the 65+ deductions
Use calculator401(k) Calculator
Project your 401(k) with catch-ups to the day you retire
Use calculatorRetirement Savings Calculator
Check whether your savings and Social Security cover your goal
Use calculatorRMD Calculator
See the required distributions your pre-tax savings will create
Use calculator