W-2 Box Calculator

Calculate W-2 box values: Box 1 federal wages, Box 3 Social Security wages, Box 5 Medicare wages, Box 12 codes (D, DD, W, C), and Box 13 flags.

$
$
$
$
$
$
$

W-2 Box Values

Box 1 — Federal Wages
$73,180.00
Before taxes and deductions
Box 3 — SS Wages
$83,180.00
Box 4 — SS Tax Withheld
$5,157.16
Box 5 — Medicare Wages
$83,180.00
Before taxes and deductions
Box 6 — Medicare Tax
$1,206.11

Box 12 Codes

Code D — 401(k)
$10,000.00
Code W — HSA
$3,600.00
Code DD — Health Insurance
$22,400.00
Informational only
Code C — GTL Imputed
$180.00

Box 13 Flags

Retirement Plan
Checked
Third-Party Sick Pay
Unchecked
Before taxes and deductions
Planning notes, formulas, and examples

About the W-2 Box Calculator

The W-2 form is the cornerstone of employee tax reporting in the United States. Each box on the W-2 represents a specific category of wages, taxes, or benefits, and the values must reconcile precisely with payroll records. Errors in W-2 reporting can trigger IRS penalties, employee complaints, and time-consuming corrections via W-2c filings.

Understanding how each box is calculated is essential for payroll professionals and beneficial for employees reviewing their year-end tax documents. Box 1 (Federal Wages) starts with gross pay and subtracts all pre-tax deductions. Box 3 (Social Security Wages) starts with gross pay, subtracts only Section 125 (cafeteria plan) deductions, and is capped at the wage base. Box 5 (Medicare Wages) is similar to Box 3 but with no cap. Box 12 contains coded entries for specific benefits like 401(k) contributions (D), employer health insurance costs (DD), HSA contributions (W), and group-term life insurance (C).

This W-2 Box Calculator walks you through the inputs needed to compute each major W-2 box value. Enter gross wages, pre-tax deductions by type, and benefit amounts to see the calculated value for Boxes 1, 3, 5, 12, and 13 flags. It's an invaluable reconciliation tool during W-2 preparation season.

When This Page Helps

W-2 reconciliation is one of the most error-prone year-end payroll tasks. This worksheet shows a clear step-by-step derivation of the main box values from gross wages, making it easier to verify payroll output, troubleshoot discrepancies, and explain why box totals differ.

How to Use the Inputs

  1. Enter the employee's total gross wages for the year.
  2. Enter pre-tax 401(k)/403(b) contributions (Box 12, Code D).
  3. Enter Section 125 cafeteria plan deductions (health insurance, FSA, etc.).
  4. Enter HSA contributions through payroll (Box 12, Code W).
  5. Enter employer-paid health insurance cost (Box 12, Code DD).
  6. Enter group-term life insurance cost above $50,000 coverage (Box 12, Code C).
  7. Review calculated values for Box 1, Box 3, Box 5, and Box 12 codes.
  8. Check Box 13 flags for retirement plan participant and third-party sick pay status.
Formula used
Box 1 = Gross − 401(k) − Section 125 − HSA − Other Pre-Tax Box 3 = Gross − Section 125 (capped at the Social Security wage base for the tax year) Box 5 = Gross − Section 125 + GTL Imputed Income (no cap) Box 12D = 401(k) Employee Contributions Box 12DD = Employer + Employee Health Insurance Cost Box 12W = Employer + Employee HSA Contributions Box 12C = GTL Imputed Income (coverage > $50K)

Example Calculation

Result: Box 1: $73,000 | Box 3: $86,600 | Box 5: $86,780

Box 1: $95,000 − $10,000 (401k) − $8,400 (Sec 125) − $3,600 (HSA) = $73,000. Box 3: $95,000 − $8,400 (Sec 125) = $86,600 (under wage base). Box 5: $86,600 + $180 (GTL imputed) = $86,780. Box 12D: $10,000. Box 12W: $3,600. Box 12DD: $14,000 + $8,400 = $22,400. Box 12C: $180.

Tips & Best Practices

  • Box 1 is almost always less than Box 3 because 401(k) reduces Box 1 but not Box 3.
  • Box 3 is capped at the Social Security wage base for the tax year—Box 5 has no cap.
  • Group-term life imputed income adds to Boxes 1, 3, and 5 but is non-cash.
  • Box 12 Code DD includes both employer and employee portions of health insurance premiums—it's informational only.
  • If Box 13 "Retirement plan" is checked, it affects the employee's ability to deduct traditional IRA contributions.
  • Reconcile W-2 boxes against quarterly Form 941 filings before distributing to employees.
  • Non-qualified deferred compensation appears in Box 11 and Box 12 Code Y.

W-2 Box Calculation Logic

The key to understanding W-2 boxes is knowing which deductions affect which boxes. Pre-tax 401(k) contributions reduce Box 1 but NOT Boxes 3 and 5. Section 125 cafeteria plan deductions (health insurance, FSA, dependent care FSA) reduce Boxes 1, 3, AND 5. HSA contributions reduce Box 1 but not Boxes 3 and 5 (unless they go through a Section 125 plan). These asymmetries cause most reconciliation confusion.

Box 12 Code Reference

Box 12 uses letter codes to report various compensation and benefit amounts. The most frequently used codes are D (401k), E (403b), W (HSA), DD (health insurance cost), C (GTL imputed income), AA (Roth 401k), and P (moving expenses reimbursement). Each code tells the IRS and the employee exactly what type of compensation or deduction is being reported.

Year-End W-2 Reconciliation Process

Before distributing W-2 forms, payroll teams should reconcile total W-2 wages against quarterly 941 filings, verify that Box 12 codes are correctly populated, confirm the SS wage base cap on Box 3, ensure GTL imputed income is added to Boxes 1, 3, and 5, and check that Box 13 flags accurately reflect retirement plan participation and statutory employee status.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • Box 1 (Federal Wages) excludes pre-tax deductions like 401(k) contributions, health insurance premiums paid through a cafeteria plan, HSA contributions, and FSA contributions. These reduce your taxable federal wages but are still included in your total gross compensation.