# W2 to Excel: A Spreadsheet Layout That Works

- Canonical: https://schematax.com/blog/w2-to-excel
- Author: Schema Tax (https://schematax.com)
- Published: 2026-03-22T12:08:27.000Z
- Updated: 2026-03-22T12:08:27.000Z

To move a W2 to Excel in a layout you can use, give each W-2 one row and each box its own column, store Box 12 as code-and-amount column pairs, add columns for a second state, and put formulas beside the amounts that test the withholding. That layout matters more than whether you type, paste or import.

## One row per W2: an Excel column layout

A one-row-per-W2 layout puts every form on a single Excel row and every box in a fixed column, in the same order the form prints them. One row per form means you can sort, filter and total with plain formulas. The order below follows the box labels in the [IRS General Instructions for Forms W-2 and W-3 (2026)](https://www.irs.gov/instructions/iw2w3).

### Column layout with example values

| Column | Header | Format | Example value (fictional) |
| --- | --- | --- | --- |
| A | Tax year | Number | 2026 |
| B | Employer name (box c) | Text | Example Payroll Co. |
| C | Employer EIN (box b) | Text | XX-XXXXXXX |
| D | Employee SSN last four (box a) | Text | 1234 |
| E | Box 1 wages, tips, other compensation | Number, 2 decimals | 42,000.00 |
| F | Box 2 federal income tax withheld | Number, 2 decimals | 3,950.00 |
| G | Box 3 social security wages | Number, 2 decimals | 44,800.00 |
| H | Box 4 social security tax withheld | Number, 2 decimals | 2,777.60 |
| I | Box 5 Medicare wages and tips | Number, 2 decimals | 44,800.00 |
| J | Box 6 Medicare tax withheld | Number, 2 decimals | 649.60 |
| K | Box 7 social security tips | Number, 2 decimals | (blank) |
| L | Box 8 allocated tips | Number, 2 decimals | (blank) |
| M | Box 10 dependent care benefits | Number, 2 decimals | (blank) |
| N | Box 11 nonqualified plans | Number, 2 decimals | (blank) |
| O, P | Box 12a code, amount | Text, Number | D, 2,800.00 |
| Q, R | Box 12b code, amount | Text, Number | DD, 6,900.00 |
| S, T | Box 12c code, amount | Text, Number | (blank) |
| U, V | Box 12d code, amount | Text, Number | (blank) |
| W, X, Y | Box 13 statutory employee, retirement plan, third-party sick pay | TRUE/FALSE | FALSE, TRUE, FALSE |
| Z | Box 14a other | Text | Union dues 480.00 |
| AA to AD | State 1: state, employer state ID, state wages, state tax | Text, Text, Number, Number | XX, 000-0000, 42,000.00, 1,610.00 |
| AE to AH | State 2: same four fields | Text, Text, Number, Number | (blank) |
| AI | Check: Box 4 | Formula | TRUE |
| AJ | Check: Box 6 | Formula | TRUE |
| AK | Check: EIN pattern | Formula | TRUE |

Put the headers in row 1 and freeze it, so each column stays labelled while you scroll. Keep the check formulas in the rightmost columns, away from the data, so a sort or filter never breaks them.

Local lines in boxes 18 to 20 and Box 14b are often empty. When they are not, add columns for them at the end of the data block rather than squeezing them between existing columns, so formulas that point at fixed columns keep working.

The layout handles one form per row. When you collect many W-2s and need totals per employer or per person, the guide to [laying out multiple W2s in one spreadsheet](/blog/multiple-w2s-in-one-spreadsheet#laying-out-multiple-w2s-in-one-spreadsheet) covers grouping and totals.

## Which W2 boxes get their own Excel column?

Every W2 box that holds one value gets its own Excel column. The two exceptions are Box 12, where each entry is a code with an amount, and boxes 15 to 20, where each state or locality is a row of several values. Those need column pairs or column groups, not single columns.

### Box 12 as code-and-amount pairs

A Box 12 entry is meaningless without its code. Code D is a 401(k) elective deferral; code DD is the cost of employer-sponsored health coverage. If you put both amounts in one "Box 12" column, nobody can tell them apart. Give each slot two columns: the code as text and the amount as a number.

Four slots, 12a to 12d, match Copy A, which the IRS instructions limit to four items. [IRS Publication 1141](https://www.irs.gov/pub/irs-pdf/p1141.pdf) allows employee copies to show more, so the W-2 you hold may list a fifth code. Add a fifth and sixth pair if you see one, or move all Box 12 entries to a second sheet with one row per entry and the employer EIN as the link.

A data-validation list on the code columns should include the codes added for 2026, listed in the [overview of W2 boxes 12, 13 and 14](/blog/w2-boxes-explained#what-do-w2-boxes-12-13-and-14-hold), or Excel will reject correct data.

### State and local lines as column groups

The IRS instructions say the state and local boxes hold two states and two localities, and a third requires a second W-2. Two groups of four columns cover one form. A second W-2 for a third state becomes its own row with the same employer EIN.

Box 13 is three checkboxes, so it becomes three TRUE/FALSE columns. Box 14a is free text the employer labels, such as union dues, so keep it as text; it cannot be totalled reliably.

## Can you convert a W2 PDF to Excel without retyping?

You can convert a W2 PDF to Excel without retyping if the PDF has a text layer, but a plain copy and paste rarely lands values in the right columns. A text layer is the selectable text inside a PDF. A scanned W-2 has none, so it needs OCR or an extraction tool before anything reaches a cell.

Pasting a whole W-2 page into Excel usually produces one long column of mixed labels and numbers, or a single cell with everything run together. Box labels end up in the same column as amounts, and a four-up page repeats every value four times. You then spend as long sorting the paste as you would have spent typing.

Pasting one box at a time works better. Copy the Box 1 amount, paste it into column E, and repeat. Two problems are common. The paste may carry stray spaces or a non-breaking space, which makes Excel store the number as text. And Box 12 may paste as "D2800.00", which you must split into code and amount by hand.

For a scan or phone photo, there is no text to paste. The options are to type, to run OCR and then map the text to columns, or to use an extraction tool that returns fields directly. The guide to [scanned W2 to Excel](/blog/scanned-w2-to-excel) walks through those routes. Schema Tax reads a W-2 PDF, scan or photo into named fields and exports them as a spreadsheet; Excel export starts with the Starter plan, and plain CSV is available on the [free tier](/#pricing).

## Excel formulas that check W2 withholding

Excel formulas that check W2 withholding compare Box 4 with Box 3 and Box 6 with Box 5 using the rates in the IRS instructions, and test that the EIN has the right shape. Each formula returns TRUE when the row looks consistent and FALSE when a person should look at the form again.

The rates come from the [IRS General Instructions for Forms W-2 and W-3](https://www.irs.gov/instructions/iw2w3). For 2026 they give a Social Security wage base of $184,500, a Box 4 ceiling of $11,439 (the base times 6.2%), a Medicare rate of 1.45% with no wage base, and an Additional Medicare Tax of 0.9% on wages over $200,000. Why those rates apply is explained in [the 6.2% check between W2 Box 3 and Box 4](/blog/w2-box-4-social-security-tax-withheld#the-6-2-check-between-w2-box-3-and-box-4).

### Check formulas for row 2

```
AI2  Box 4 check
=AND(ABS(H2-ROUND(G2*0.062,2))<=0.01, H2<=11439, G2+K2<=184500)

AJ2  Box 6 check
=ABS(J2-ROUND(I2*0.0145+MAX(0,I2-200000)*0.009,2))<=0.01

AK2  EIN pattern check
=AND(LEN(C2)=10, MID(C2,3,1)="-", ISNUMBER(--SUBSTITUTE(C2,"-","")))

AL2  Amounts are numbers, not text
=AND(ISNUMBER(E2), ISNUMBER(F2), ISNUMBER(G2), ISNUMBER(H2))
```

Fill each formula down the column. With the example row in the layout table, Box 3 is 44,800.00, and 6.2% of that is 2,777.60, which matches Box 4. Box 5 is also 44,800.00, and 1.45% is 649.60, which matches Box 6. All checks return TRUE.

The one-cent tolerance allows for rounding in payroll systems. Raise it to a few cents if your W-2s come from a system that rounds each paycheck separately, since many small roundings can add up over a year.

Add conditional formatting so FALSE cells turn red. A sheet of fifty W-2s then shows at a glance which rows need a second look. A FALSE does not prove the W-2 is wrong. It may be a typo in the sheet, a pay situation the simple formula does not model, or an employer error, and only the form itself settles which.

## W2 to Excel mistakes: merged cells and numbers stored as text

The two W2 to Excel mistakes that break a sheet most often are merged cells, used to make the sheet look like the form, and numbers stored as text, which look right but do not add up. Both turn a sheet you can total into one you can only read.

### Merged cells

Merging cells to mimic the W-2's box layout seems natural, but it fights everything a spreadsheet does well. Microsoft's guide to [merging and unmerging cells in Excel](https://support.microsoft.com/en-us/office/merge-and-unmerge-cells-5cbd15d5-9375-4540-907f-c673a93fcedf) warns that when you merge, only the upper-left cell's contents remain and "the contents of the other cells that you merge are deleted." A merged state block silently drops values. Keep one value per cell and use alignment, not merging, for appearance.

### Numbers stored as text

A number stored as text sits in a cell as characters, not as a value. Pasted amounts with stray spaces, or amounts imported as text, end up this way. Microsoft's article on [converting numbers stored as text to numbers](https://support.microsoft.com/en-us/office/convert-numbers-stored-as-text-to-numbers-40105f2a-fe79-4477-a171-c5bad0f0a885) says Excel usually marks them with a green triangle and offers Convert to Number or the VALUE function as fixes. The ISNUMBER check in column AL catches them.

### IDs stored as numbers

The opposite mistake hits IDs. An EIN or a ZIP code that starts with zero loses it when Excel treats it as a number. Microsoft's page on [keeping leading zeros and large numbers](https://support.microsoft.com/en-us/office/keeping-leading-zeros-and-large-numbers-1bf7b935-36e1-4985-842f-5dfa51f85fe7) says Excel "automatically removes leading zeros" and recommends formatting the cells as Text before entering data, or importing those columns as text. Format columns C and D as Text before you paste. The same problem appears when a CSV is opened in Excel, which the post on [keeping EIN and ZIP code leading zeros in a W2 CSV](/blog/w2-to-csv#keeping-ein-and-zip-code-leading-zeros-in-a-w2-csv) covers.

Other habits that cause trouble: a total row placed in the middle of the data, which a sort scatters; dollar signs typed into cells, which turn amounts into text; and blank rows between forms, which stop filters and tables at the gap. If you plan to share the data as plain rows, the guide on [W2 to CSV](/blog/w2-to-csv) shows a column order that survives export.

## Using W2 data in an Excel budget

W2 data in an Excel budget gives you yearly totals: what you earned, what was withheld for each tax, and what went to some benefits. A W-2 has no box for net pay, so it cannot tell you take-home pay on its own. It works best as a yearly check against the budget you built from pay stubs.

The boxes that carry budget information are few. Box 1 shows wages counted for federal income tax, which can be lower than Box 3 because the [IRS Box 3 instructions](https://www.irs.gov/instructions/iw2w3) say elective deferrals to plans such as a 401(k) are "not includible in box 1". Boxes 2, 4 and 6 show federal income tax, Social Security tax and Medicare tax withheld. Boxes 17 and 19 show state and local income tax withheld. Box 12 code D shows 401(k) elective deferrals, and code DD shows the cost of employer-sponsored health coverage.

A simple budget sheet can total withholding with one formula per row, such as =F2+H2+J2+AD2+AH2 for federal, Social Security, Medicare and both state taxes. Summed across all of a household's W-2s, that gives the year's withheld tax in one figure, which is useful for comparing years.

What the W-2 does not show matters as much for a budget. Many paycheck deductions have no box of their own. [IRS Publication 1141](https://www.irs.gov/pub/irs-pdf/p1141.pdf) mentions withholding for health insurance, union dues, bonds or charity as items an employer may add in Box 14a, so some show up there as labelled text and others not at all. Pay stubs remain the source for monthly take-home figures, with the W-2 as the annual cross-check that nothing was missed.

For more spreadsheet layouts and the formats around them, see the [Excel, CSV and JSON articles](/blog/category/excel-csv-json). The budget use of W-2 data describes what the form shows; how those numbers affect a tax return is a question for your preparer or tax software.
