What Line on a W-2 Shows Gross Income? Box 1, Box 5, and Rebuilding Pay

No single line on a W-2 shows your gross income. The form splits your earnings across boxes based on how each dollar is taxed, so the number that matches your salary or your final pay stub usually has to be rebuilt from more than one box. Box 5 (Medicare wages) comes closest for most workers, but it still leaves out health premiums paid pre-tax and HSA contributions. To get an accurate gross figure, you typically add Box 1 to specific amounts in Box 12, then check your last pay stub for anything the W-2 doesn’t code separately.

Why Box 1 Is Lower Than Your Salary

Box 1 reports wages, tips, and other compensation subject to federal income tax. It’s the number you enter on Line 1a of Form 1040, and it’s the starting point for your federal return.1Internal Revenue Service. Instructions for Forms 1040 and 1040-SR It includes your salary or hourly pay, commissions, bonuses, and taxable fringe benefits.2Office of the Law Revision Counsel. 26 USC 6051 – Receipts for Employees

What it excludes is why Box 1 almost always falls short of gross pay. Money you routed into a pre-tax 401(k), 403(b), or 457(b) never enters Box 1. Neither do health, dental, or vision premiums you paid through a cafeteria plan, or contributions to a health savings account. Those dollars were earned, but because they were sheltered from federal income tax, they don’t appear here. Box 1 is your taxable pay, not your total pay.

Why Box 5 Is the Closest Single Number

Box 5 shows wages subject to Medicare tax. Medicare has no wage cap, so all covered earnings are included.3Internal Revenue Service. Topic No. 751, Social Security and Medicare Withholding Rates For most employees, Box 5 is the highest figure on the form, because pre-tax retirement deferrals are still subject to Social Security and Medicare taxes even though they escape federal income tax.4Office of the Law Revision Counsel. 26 USC 3121 – Definitions That’s why Box 5 usually exceeds Box 1: it adds your 401(k) or similar contributions back in.

Box 3, Social Security wages, tracks the same idea but is capped at an annual wage base that adjusts each year.5Social Security Administration. Contribution and Benefit Base If your earnings crossed the cap, Box 3 stops there while Box 5 keeps going, which is why Box 5 is the better reference point for gross pay.

Even so, Box 5 isn’t a perfect gross-pay figure. It still excludes cafeteria plan premiums for health coverage and HSA contributions. If you pay for medical, dental, or vision coverage pre-tax, or if you fund an HSA through payroll, Box 5 will be lower than what your employer actually paid you.

How to Rebuild Gross Pay from the W-2

The working formula for most people:

Box 1 + Box 12 retirement codes (+ Box 12 Code W if present) = approximate gross pay

Box 12 uses letter codes to identify specific compensation and deduction items. The retirement codes that were subtracted from Box 1 are:

  • Code D: 401(k) elective deferrals
  • Code E: 403(b) elective deferrals
  • Code G: 457(b) elective deferrals
  • Code S: SIMPLE IRA salary reduction contributions

Each of these represents money you earned but chose to redirect into retirement savings before federal income tax was calculated. They’re excluded from Box 1 but included in Boxes 3 and 5.6Internal Revenue Service. 2026 General Instructions for Forms W-2 and W-3

Code W reports HSA contributions, both employer and employee portions made through a cafeteria plan. Code W amounts are excluded from Box 1, Box 3, and Box 5, so if you have one, add it back to reach true gross pay.6Internal Revenue Service. 2026 General Instructions for Forms W-2 and W-3

One code to ignore for this purpose: Code DD, which reports the total cost of your employer-sponsored health plan. It’s informational only, not taxable income, and it doesn’t belong in a gross pay calculation.7Internal Revenue Service. Reporting Employer-Provided Health Coverage on Form W-2

The Gap the W-2 Doesn’t Code

Here’s where the math often stops matching. Health, dental, and vision premiums paid through a Section 125 cafeteria plan reduce Boxes 1, 3, and 5, but they have no dedicated Box 12 code.8Internal Revenue Service. FAQs for Government Entities Regarding Cafeteria Plans Some employers list them in Box 14, a catch-all field for miscellaneous items, but reporting there is optional.6Internal Revenue Service. 2026 General Instructions for Forms W-2 and W-3

If Box 14 shows a labeled amount for health insurance premiums, add it to your total. If it doesn’t, look at your final pay stub of the year. It should carry year-to-date totals for every pre-tax deduction, including the premiums the W-2 didn’t itemize. This is the most common reason people can’t reconcile their W-2 to their salary.

A Faster Sanity Check

Compare Box 5 to the salary you know you earned. If you don’t fund an HSA through payroll and your employer offers no unusual pre-tax perks, Box 5 should equal your gross pay minus your cafeteria-plan health premiums. A small gap points to those premiums. A large gap means something else is running through payroll, and the pay stub is the place to find it.

What the W-2 Never Shows

Some compensation is part of what your employer spends on you but doesn’t count as your wages and won’t appear as income on any W-2 box:

None of these belong in a W-2 gross pay calculation. They’re either employer costs or tax-free benefits, not wages paid to you. For a full picture of total compensation, your employer’s benefits summary is a better source than the W-2.