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

  1. 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.
  2. 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.
  3. 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.
  4. 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

An HSA needs coverage under a qualifying high-deductible health plan, and the optimized figure uses the self-only or family limit you choose. Stop HSA contributions six months before you apply for Social Security or Medicare Part A after 65, because Part A coverage is backdated up to six months (Medicare.gov).

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.

2026 limits by age
AccountBase50 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).

2026 deductions for a married couple filing jointly
Both spousesStandard deductionSenior 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 RMDs

How 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.

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?

If your wages from the employer were over $150,000 last year, your 401(k) catch-up must be made as Roth contributions starting in 2026 (IRS). You can still contribute the full catch-up ($8,000 from 50, $11,250 at 60 to 63), but it no longer lowers this year's taxable income. Your base $24,500 can still be pre-tax. The wages test is per employer, and the rule applies only if the plan offers a Roth option; ask your plan administrator how your plan handles it.

Is it worth maxing out a pre-tax 401(k) a few years before retiring?

Usually, if your bracket now is higher than the one you expect once paychecks stop. Most people in their peak earning years are in the 22% or 24% bracket or above; after retirement, before Social Security and required distributions start, many fall to 12%. Deferring at 24% and withdrawing or converting at 12% is a clear gain. The case weakens if you already have most of your savings in traditional accounts and expect large required distributions later, in which case the Roth side of the plan may be the better home for new money.

Can I keep contributing to an HSA after 65?

Only until you enroll in Medicare. Once any part of Medicare starts, new contributions must stop, but you can keep spending the account tax-free on qualified medical costs, including Medicare Part B and Part D premiums (IRS Publication 969). If you enroll in Part A after 65, coverage is backdated up to six months, so stop contributing six months before you apply (Medicare.gov).

What extra deductions do I get at 65 in 2026?

Two. The additional standard deduction is $1,650 per person 65 or older if married, or $2,050 if single. On top of that, the senior deduction created in 2025 allows up to $6,000 per person 65 or older through 2028, whether or not you itemize, reduced by 6% of modified adjusted gross income above $75,000 ($150,000 for joint filers). Married couples must file jointly to claim it (IRS).

Should I itemize or take the standard deduction?

Take the larger; the calculator does this for you. For 2026 the standard deduction is $32,200 for joint filers and $16,100 for single filers, before the 65+ additions. With the mortgage paid off, most retirees take the standard deduction; state and local taxes (capped at $40,000, lower at high incomes) and charitable gifts are what can tip it. Bunching two or three years of gifts into one year, often through a donor-advised fund, lets you itemize in that year and take the standard deduction in the others.

Can I still contribute to an IRA while working in my 60s?

Yes; there is no age limit on IRA contributions as long as you or your spouse have earned income. The 2026 limit is $8,600 at 50 and over. A traditional IRA deduction phases out when you are covered by a workplace plan and income is between $129,000 and $149,000 (joint) or $81,000 and $91,000 (single). Roth IRA contributions phase out between $242,000 and $252,000 (joint) or $153,000 and $168,000 (single).

What tax moves matter once I have stopped working?

Different ones. With no wages, the questions become which accounts to draw from, how much to convert to Roth each year before required minimum distributions start at 73 (75 if born in 1960 or later), how to keep income below Medicare IRMAA thresholds, and, from age 70½, giving to charity straight from an IRA with qualified charitable distributions of up to $111,000 a year. The tax bracket calculator and the guide to withdrawal order cover that stage.