IRS Form Extraction

Extract Every Field from Your W-2 PDF — Federal and State Boxes Resolved to Separate Columns

A W-2 has both label letters and numeric values on the same form line — and the same Box 1 label exists in the federal section AND the state section with different dollar amounts. Template-based OCR conflates them into one column. This AI distinguishes "Federal Wages Box 1" from "State Wages Box 16" by understanding section context, extracting 5-10 seconds per form.

Enterprise-grade security · TLS 1.3 encrypted

PDF & Scans
XLSX/CSV
All W-2 Boxes
SSN/EIN Secure

What You Can Extract from a W-2 Form

Type the column names you need — the AI finds each value on every W-2 by understanding what it means and which section it belongs to, not by matching box numbers alone. The same column definition works across W-2s from ADP, Paychex, Gusto, QuickBooks Payroll, and scanned paper copies.

Employer & Employee Identity

Employer Name
Employer EIN
Employer Address
Employee Name
Employee SSN
Employee Address

Federal Wages & Taxes (Boxes 1–6)

Box 1 Wages
Box 2 Federal Tax
Box 3 Social Security Wages
Box 4 Social Security Tax
Box 5 Medicare Wages
Box 6 Medicare Tax

State & Local Wages + Box 12 Codes

State ID
Box 15 State / EIN
Box 16 State Wages
Box 17 State Tax
Box 18 Local Wages
Box 19 Local Tax
Box 20 Locality Name
Box 12a Code
Box 12a Amount
Box 12b Code
Box 12b Amount

This is not a prescriptive list — type any field name your W-2 contains. The AI reads the document to find what you ask for.

Why a W-2 Looks Standardized — and Why Box-Level Extraction Is Still Harder Than It Looks

Every W-2 follows the same IRS-mandated layout: employer block at the top, employee block below, then numbered boxes for federal wages, Social Security, Medicare, and a state section at the bottom. The form is consistent across every employer. The challenge is not layout variation — it is that the same visual patterns appear in two different sections of the same form, carrying different meanings and different dollar amounts.

The Problem

01 Each box number is paired with a label letter AND a dollar amount — all on the same form line

Every W-2 box contains a small label letter (a, b, c...), a descriptive text label, and a numeric value — all printed closely together on one line. For example, Box 1 reads "1 Wages, tips, other compensation" followed by the dollar figure. Box 2 reads "2 Federal income tax withheld." A traditional OCR engine that reads a scanned W-2 treats this as a flat stream of text: "1 Wages tips other compensation 75231.00 2 Federal income tax withheld 11348.75." The label, box number, and dollar value are no longer connected — and downstream tools must guess where each box's value ends and the next label begins. This is why importing a scanned W-2 into Excel via a generic PDF converter produces misaligned columns: the converter doesn't understand that the pair "1" and "$75,231.00" forms a single data point.

02 The federal section and the state section use the same label conventions — with different numbers

This is the core extraction trap. A W-2 has a federal wage section (Boxes 1 through 14) across the middle of the form, and a state wage section (Boxes 15 through 20) at the bottom. Both sections contain dollar-amount boxes accompanied by labels — and those labels look structurally identical: small letter in a box, followed by a label, followed by a dollar figure. For an employee who lives in one state and works in another, Box 1 federal wages might be $75,000 while Box 16 state wages for the work state might be $28,000. Template-based OCR tools that only match on the textual pattern "wages" or the box number "1" cannot distinguish which section they are reading — and they will indiscriminately extract whichever "wages" value they encounter first. If the tool grabs the federal figure and labels it "state" (or vice versa), the downstream tax filing is wrong with no obvious error indicator. Tax preparers on r/taxpros describe the exact problem: extraction tools that "miss part of the income or have different income amounts" when a W-2 contains values in both the federal and state sections.

03 Multi-state W-2s multiply the problem — two or more state sections on one form

An employee who worked in two states during the year receives a W-2 with two state wage sections stacked at the bottom — one for each state. Each section uses the same box numbers (15, 16, 17) but carries a different State ID, different wage totals, and different tax withheld amounts. A coordinate-based extraction template that handles one state section will miss the second entirely. A tool that matches by box number alone will extract Box 16 twice and cannot tell which value belongs to which state.

How Custom Column Extraction Solves This

01 The AI reads the form's two-dimensional structure, not a flat stream of text

Custom Column Extraction — the core mechanism of ImageToTable.ai — does not treat a W-2 as a one-dimensional sequence of characters. It reads the form the way a human tax preparer does: by understanding the spatial layout. The small letter-inside-a-box notation, the descriptive label adjacent to it, and the numeric value next to the label are read together as one unit — a single box-value pair. When you define a column named "Box 1 Wages," the AI locates the "1" box marker, traces across the line to read the dollar value next to it, and outputs that pair as one data cell. A column named "Box 2 Federal Tax" receives the value paired with the "2" marker on the next line — not the value from Box 1 or Box 3. Each box is isolated by its spatial position on the form, not by a regular-expression guess at numeric boundaries in a stream of OCR text.

02 Federal section and state section are disambiguated by their position on the page — not by box number matching

The AI understands that the federal wage section occupies the upper-middle area of the form, while the state wage section sits below it, separated by a horizontal boundary. When you define separate columns — "Box 1 Wages" for the federal section, "Box 16 State Wages" for the state section — the AI locates each value inside its respective section of the form. It does not return the first "wages" value it finds or the value closest to a coordinate anchor. It reads the federal section to find the dollar figure beside box marker "1," and separately reads the state section to find the dollar figure beside box marker "16." The two values land in two different columns in your output Excel — no conflation, no overwrite. This section-context reading is what prevents the $75,000 federal wages from being mistakenly reported as state wages in a downstream tax filing.

03 Each state section on a multi-state W-2 is extracted as an independent column group

For a W-2 with California and Oregon state sections, define columns like "State 1 ID," "State 1 Wages (Box 16)," "State 1 Tax (Box 17)," "State 2 ID," "State 2 Wages (Box 16)," "State 2 Tax (Box 17)." The AI reads each state section independently, associating the correct State ID (the two-letter abbreviation in Box 15) with its paired wage and tax values. Each state's data enters the correct column group — California wages in the State 1 column, Oregon wages in State 2 — without manual reordering after extraction. The same approach extends to local tax boxes (18-20) when present.

From a Stack of W-2 PDFs to One Reconciliation Spreadsheet: How It Works

If you process W-2s for multi-client payroll reconciliation, year-end tax preparation, W-3 filing, or employee onboarding data entry, here is what the workflow looks like from upload to verified output — with the federal-state disambiguation built into the process.

1

Upload W-2 PDFs — one employee or fifty, digital or scanned

Drop in W-2 PDFs from any payroll system — ADP, Paychex, Gusto, QuickBooks Payroll, Paylocity — or scanned paper W-2s from employees who handed you physical copies. The tool accepts PDF, JPG, PNG, and WebP. If you are processing W-2s for a full workforce ahead of W-3 filing, upload all of them at once: batch processing handles every file in a single job, with each employee's form becoming one row in the consolidated output. For collecting W-2s from employees who work remotely, generate a Collection Link — a shareable URL where each employee can upload their W-2 PDF directly to your processing queue by entering a short verification code, with no registration or login required on their end.

2

Type the column names you need — the AI distinguishes federal from state values automatically

Enter the fields you want: "Employee Name," "Employee SSN," "Employer Name," "Employer EIN," "Box 1 Wages," "Box 2 Federal Tax," "Box 3 Social Security Wages," "Box 4 Social Security Tax," "Box 5 Medicare Wages," "Box 6 Medicare Tax," "Box 15 State ID," "Box 16 State Wages," "Box 17 State Tax." The AI reads each W-2's layout and returns the value inside the federal section's Box 1 into your "Box 1 Wages" column, and the value inside the state section's Box 16 into your "Box 16 State Wages" column — never conflating the two. For multi-state W-2s, add a second state column group: "State 2 ID," "State 2 Wages (Box 16)," "State 2 Tax (Box 17)." Add a Computed Column like "FICA Check (Box 4 + Box 6)" to verify that Social Security and Medicare withholding matches expected rates, or "Wages Check (Box 3 - Box 5)" to flag any gap between Social Security wages and Medicare wages. For recurring tax-season processing, save your column configuration as a template after logging in.

3

Download the consolidated Excel — each employee as one row, every box-value in the right column

Each W-2 becomes one row in your output spreadsheet. The data is organized exactly as you requested: Employee Name in one column, Employer EIN in another, Box 1 Wages and Box 2 Federal Tax next to each other, Social Security and Medicare boxes grouped together, state-level values in their own column group. If you processed a batch of 80 employee W-2s, you get 80 rows — one per employee — with all requested fields aligned. The file exports as XLSX, CSV, or JSON, ready for import into QuickBooks, Drake Tax, UltraTax, ProSeries, or any tax preparation software, or for W-3 reconciliation against the aggregate totals in your payroll system.

When It Works Best — and When to Verify Results

When it works best

Standard IRS-format W-2s from any payroll provider. Digital PDFs from ADP, Paychex, Gusto, QuickBooks Payroll, Paylocity, and similar platforms extract with high accuracy. The IRS-mandated W-2 format is the same regardless of which payroll system generates it — the form layout is fixed, so column-name extraction works identically across providers without per-format templates.

Single-state and multi-state W-2s. W-2s with one state section and three-state W-2s with Boxes 15-17 repeated for each state extract equally well. The AI reads each state section independently, pairing each State ID with its wage and tax values. This includes local tax boxes (18-20) when present.

Batch employee processing for W-2/W-3 preparation. Upload W-2s for an entire workforce in a single batch. Each employee's form becomes one row in the output Excel — ready for W-3 reconciliation, tax filing software import, or employee data migration into an HRIS. Send a Collection Link to employees who need to upload their W-2 themselves.

When to be cautious

Amended W-2c forms with side-by-side original and corrected columns. A corrected W-2c uses a different layout than the standard W-2 — it displays Column A (previously reported) and Column B (correct amount) for each box. The AI extracts both values but does not inherently label them as "original" and "corrected" unless you define those column names explicitly. Review which column entered your output before filing.

Partially masked SSNs on employee copies. Some payroll providers redact the first five digits of the SSN on employee-issued copies (XXX-XX-1234). Extraction captures only the visible digits. If your workflow needs the full SSN for filing or identity verification, you will need the complete number from the employer copy or a separate source. The tool does not reconstruct or infer masked digits.

Heavily skewed or low-resolution scanned W-2s. Scanned paper W-2s at 200 dpi or above on a flatbed scanner extract reliably. Photographed W-2s taken at an angle, low-light phone photos with shadows across box fields, and photocopies of photocopies may reduce accuracy — particularly for tight box-number fields where a "3" and "8" or a "5" and "6" become visually ambiguous at low resolution. Scan at 200+ dpi when possible; for phone photos, position the camera directly above the form with even lighting.

Frequently Asked Questions

How does the AI distinguish between the federal Box 1 and the state Box 16 when both are labeled with the same number-letter pattern?

This is the central extraction challenge for any W-2 form. A standard W-2 has a federal wage section (Boxes 1-14) and a state wage section (Boxes 15-20) printed in two different regions of the page. Both sections contain box labels followed by dollar amounts, and the visual pattern is identical — a small number, a label, a dollar figure. The AI does not extract by box number alone. It reads the form's two-dimensional structure: it understands that the federal section occupies the upper-middle area of the form and the state section sits below it. When you type "Box 1 Wages" as a column name, the AI reads the federal section to find the dollar figure beside Box 1. When you type "Box 16 State Wages," the AI reads the state section to find the dollar figure beside Box 16. The two values — which may be completely different numbers — land in two different columns in your output. A template-based OCR tool that looks for the text string "wages" or matches on box coordinates cannot make this distinction and will often conflate the two values.

Can it extract all Box 12 entries when there are multiple codes on the same W-2?

Yes. A W-2 can carry up to four Box 12 entries (labeled a, b, c, d), each consisting of a one- or two-letter code and a dollar amount on the same visual line. Define columns like "Box 12a Code," "Box 12a Amount," "Box 12b Code," "Box 12b Amount" — the AI reads each code letter and its paired dollar amount as a unit and routes both into the correct output columns. This works for all common Box 12 codes: D (401(k) elective deferrals), E (403(b) elective deferrals), DD (cost of employer-sponsored health coverage), and less common codes including AA (designated Roth contributions) and BB (designated Roth 403(b) contributions). If a W-2 has only two Box 12 entries, the columns for 12c and 12d remain empty in that employee's output row rather than pulling in unrelated data.

Does it handle hand-filled or partially handwritten W-2 forms?

The AI reads handwritten numbers on W-2 forms, but accuracy depends on handwriting clarity. Clearly printed, block-style numbers in pen extract reasonably well — a cleanly written "$42,500" in Box 1 will read as $42,500. Small, tightly packed handwriting, cursive numbers, or numbers that cross into adjacent box fields may reduce accuracy. For handwritten W-2s, verify Box 1 Wages, Box 2 Federal Tax, Box 3 Social Security Wages, and Box 16 State Wages against the source form — these are the highest-impact fields for tax filing. The form's grid lines help the AI distinguish which box a handwritten value belongs to, which is why a cleanly filled W-2 form extracts more reliably than handwritten notes on a blank sheet.

Can I batch-process W-2s for 50+ employees and get each employee as a separate row in the output?

Yes — and this is how most users process W-2s at scale. Upload one W-2 per file (e.g., 50 PDFs for 50 employees) or a multi-page PDF containing all employees' W-2s concatenated into one document. Define your columns once — Employee Name, Employee SSN, Employer EIN, Box 1 Wages, Box 2 Federal Tax, Box 3 Social Security Wages, Box 4 Social Security Tax, Box 5 Medicare Wages, Box 6 Medicare Tax, Box 16 State Wages, Box 17 State Tax — and the AI extracts each employee's form independently. The output is one consolidated Excel file with one row per employee, all fields aligned. If an employee has a multi-state W-2, their row contains the additional state columns you defined. The merged spreadsheet is ready for W-3 reconciliation: sum the Box 1 Wages column and compare against your payroll system's total, sum the Box 2 Federal Tax column against your 941 deposits, spot-check individual employees for anomalous values.

Is sensitive W-2 data — Social Security Numbers, Employer EINs — secure during processing?

Yes. All W-2 file uploads and data transfers occur over TLS 1.3 encrypted connections. Files are processed in an isolated environment and automatically deleted from our servers after conversion completes. We do not retain your documents, access your extracted data, or use any uploaded content for AI model training. The tool does not send your data to any third-party service for processing — all extraction happens within our own infrastructure. For accounting firms processing hundreds of client W-2s, this means each client's data remains segregated by processing job and is purged on completion. If your organization requires additional compliance documentation, contact our support team for a data processing agreement.

📮 contact email: [email protected]