Tax

W2 Tax Calculator

Decode the three different wage figures on your W-2 — and see why a 401(k) dollar and an HSA dollar are not worth the same thing.

W2 Tax Calculator

Results recalculate instantly on every keystroke. Nothing you type is transmitted.

Salary
$
Pre-Tax Deductions
$
$
$
State
%
Annual Take-Home Pay
Salary less pre-tax deductions, FICA and income tax
Box 1 — Federal Wages
Box 3 — Social Security Wages
Box 5 — Medicare Wages
Why Box 1 Differs From Box 5
Why Box 3 Differs From Box 5
Total FICA Withheld
Federal Income Tax
What Your 401(k) Dollar Saves
What Your HSA Dollar Saves
Which Pre-Tax Dollar Wins

What this result does not account for

  • Assumes a single filer taking the standard deduction; the Additional Medicare threshold is not adjusted for filing status.
  • Roth 401(k) contributions reduce none of the wage boxes — do not enter them here.
  • Employer HSA contributions and Box 12 items such as group term life above $50,000 can shift the boxes further.
Zero-Server Execution Updated 11 Aug 2026 Reviewed by Imran S. Qureshi, CFA IEEE-754 Double Precision

In short: On a $185,000 salary, Box 1 shows $165,250, Box 3 shows $168,600 and Box 5 shows $177,250 — three different numbers on one form. The 401(k) reduces income tax only, while the HSA escapes Medicare tax too, and Social Security stops entirely at the $168,600 wage base.

Formula

Box 1 = Salary − 401(k) − HSA − Section 125
Box 5 = Salary − HSA − Section 125
Box 3 = min(Box 5, $168,600)

The three boxes differ because a traditional 401(k) is exempt from income tax but not payroll tax, while HSA and Section 125 amounts are exempt from both. Social Security stops at the wage base; Medicare never does.

Worked Example

  1. Start from gross salary. $185,000 before any deduction.
  2. Remove what escapes both taxes. The $4,150 HSA and $3,600 of Section 125 premiums reduce every wage box, giving Box 5 of $177,250.
  3. Remove the 401(k) for income tax only. $12,000 more comes off Box 1, giving $165,250 — but it stays fully in Boxes 3 and 5.
  4. Cap Social Security wages. Box 3 stops at the $168,600 wage base, $8,650 below Box 5. Social Security withholding maxes at $10,453.20.
  5. Read the marginal values. A 401(k) dollar saves 24.00%; an HSA dollar saves 25.45% here, because Social Security has already capped and only Medicare remains.

Below the wage base the HSA advantage is the full 7.65% of FICA. Above it, Social Security has already stopped, so the advantage narrows to Medicare's 1.45%. The salary chosen here sits above the base deliberately, so that all three wage boxes hold different values.

Strengths & Limits Of This Model

Where this engine is strong

  • Explains why three wage figures differ rather than just reporting one.
  • Prices an HSA dollar against a 401(k) dollar at your actual marginal position.
  • Handles the Social Security wage base and Additional Medicare Tax correctly.

Where it stops

  • State payroll taxes, disability insurance and local wage taxes are not modelled.
  • Cannot see your actual W-2 — employer coding errors are common and this will not catch them.
  • Assumes contributions run evenly across the year.

Risk & accuracy notice. Figures produced here are estimates derived from the inputs you supply. They are not a forecast, an offer, or a guarantee of any outcome, and no result should be read as a promise of future performance. Rates, thresholds and statutory rules change, and your own circumstances may differ materially from the assumptions modelled.

Practical Use Cases

Reconciling your W-2 before filing

Three different wage figures is normal, not an error. This tool shows exactly which deduction explains each difference.

Choosing between an HSA and a 401(k)

The HSA is the only account exempt from income tax, FICA, growth tax and withdrawal tax when used for medical costs. Fund it before anything beyond the employer match.

Checking Social Security over-withholding

If you changed jobs mid-year, each employer applies the wage base separately and you may have overpaid. The excess is recoverable on your return.

Modelling a salary increase

Crossing the $168,600 wage base changes your marginal payroll rate sharply — compare take-home with the Paycheck Calculator.

Methodology & Editorial Standards

Box 1 reports wages subject to federal income tax, Box 3 wages subject to Social Security up to the $168,600 wage base, and Box 5 Medicare wages with no cap. Traditional 401(k) deferrals reduce Box 1 only; HSA contributions made through a cafeteria plan and Section 125 insurance premiums reduce all three. Additional Medicare Tax of 0.9% applies to wages above $200,000 with no employer match. Roth 401(k) contributions reduce none of the boxes and should not be entered here. The engine assumes a single filer taking the standard deduction, and the additional Medicare threshold is not adjusted for filing status. Employer HSA contributions, group term life above $50,000, and other Box 12 items that can shift the wage boxes are outside scope. The engine implements the standard published formula for this calculation. Inputs are validated for domain and sign before evaluation, and any undefined case returns an em-dash rather than a spurious value.

Computation runs in IEEE-754 double precision at full internal precision; rounding to two decimal places occurs strictly at the display layer, so no cumulative drift enters the result. All monetary outputs use accounting presentation — grouped thousands, two decimals, negatives in parentheses — so figures can be transcribed directly into a model or working paper. Division-by-zero and out-of-domain inputs return an em-dash rather than a misleading number.

This engine was reconciled against an independent reference implementation and hand-verified for the worked example above before release. Our full five-stage review process is published on the About Us page.

Imran S. Qureshi, CFA Head of Quantitative Modelling · ApexConverter

Cross-border taxation and treasury reporting across multiple jurisdictions. Last reviewed: 11 August 2026.

Disclaimer. This calculator is provided for informational and modelling purposes only and does not constitute financial, tax, legal, medical, or engineering advice. Verify all figures with a qualified professional before acting on them.


W2 Tax Calculator — 20 Expert FAQs

20 analyst-written answers to the questions practitioners actually ask — optimised for voice and answer-engine retrieval.

Why are Box 1, Box 3 and Box 5 different on my W-2?

Because different deductions are exempt from different taxes. Your 401(k) reduces Box 1 but not Boxes 3 and 5, and Box 3 caps at the Social Security wage base.

Why is Box 1 lower than Box 5?

The gap is exactly your traditional 401(k) contribution — $12,000 here. It escapes income tax but never payroll tax.

Why is Box 3 lower than Box 5?

Social Security stops at the $168,600 wage base while Medicare has no cap. The $8,650 difference here is simply wages above that base.

Does a 401(k) reduce Social Security tax?

No. Traditional 401(k) deferrals are exempt from income tax only. You pay full FICA on every dollar you defer, which surprises most contributors.

Is an HSA better than a 401(k) for tax?

Per dollar, yes. An HSA escapes income tax and FICA, while a 401(k) escapes income tax alone. Below the wage base the HSA advantage is the full 7.65%.

What is the Social Security wage base?

$168,600 for 2024. Once your Social Security wages reach it, the 6.2% stops entirely for the rest of the year and your take-home jumps.

What is Additional Medicare Tax?

An extra 0.9% on wages above $200,000, withheld from the employee only with no employer match. It appears nowhere as a separate box.

Do Roth 401(k) contributions appear in Box 1?

Yes, in full. Roth contributions are after-tax, so they reduce none of the wage boxes — do not enter them in this calculator.

What are Section 125 deductions?

Pre-tax benefits under a cafeteria plan, most commonly health insurance premiums. They reduce all three wage boxes because they are exempt from both income tax and FICA.

I changed jobs and overpaid Social Security. What now?

Each employer applies the wage base independently, so you can exceed it in total. The excess is credited on your return — it is not lost.

Why does my take-home rise later in the year?

Because Social Security withholding stops once you reach the wage base. High earners see a visible pay increase for the remaining pay periods.

Does my employer pay the same FICA I do?

Yes, an identical 6.2% and 1.45% match, except for Additional Medicare Tax which is employee-only. The employer half never appears on your W-2.

What is Box 12 code D?

Your elective 401(k) deferrals for the year. It should reconcile exactly with the gap between Box 1 and Box 5, assuming no other adjustments.

Should I fund the HSA before the 401(k)?

Fund the 401(k) to the employer match first, since that is a 100% return. Then the HSA, which is the only triple-tax-advantaged account available.

Do these boxes affect my Social Security benefit?

Box 3 does. Your eventual benefit is based on Social Security wages, so deferring into a 401(k) does not reduce your future benefit, while an HSA marginally can.

Is this w2 tax calculator free to use?

Yes. It is free, requires no account, and has no usage limits. ApexConverter is funded by contextual advertising, never by selling user data.

Is my data sent to a server?

No. The engine runs as Vanilla JavaScript inside your browser under our Zero-Server Client-Side Execution model. Your figures are computed locally and are never transmitted, logged, or stored.

How accurate is this calculator?

It applies the standard closed-form formula in IEEE-754 double precision, rounding only at the display layer. The engine is reconciled against an independent reference implementation before release.

Does it work on mobile?

Yes. The interface is mobile-first with numeric keypad hints and is tested down to a 320-pixel viewport with no horizontal scrolling.

Can I use it offline?

Largely, yes. Because computation is client-side, the page continues to calculate without a network connection once it has loaded.

Related Tax Engines