*** September 2026 Major Release ***Read and watch
Document type

Extracting data from W-2 forms

Every US employer issues a W-2 to every employee each January, on a layout the IRS fixes box for box. What differs is the rendering, and every payroll vendor has its own. Tax preparers and mortgage underwriters take them by the thousand, as portal downloads and phone photographs of the mailed copy.

A preparer needs the wages in box 1, the federal tax withheld in box 2, and the state and local rows along the bottom. Tax software carries those onto a return, and a loan origination system reads box 1 to qualify a borrower's income.

Page 1 of a sample W-2 Form, with extracted values outlined
2,225Markdown characters
58parse blocks
36fields extracted
The problem

What makes W-2 forms hard

Same boxes, no two alike

The IRS fixes every box and its number, and each payroll vendor renders that layout its own way on its own stock.

Box 12 codes carry meaning

A single letter beside each box 12 amount says what the money is: D marks a 401(k) deferral, DD the cost of health coverage.

Marks and write-ins among numbers

Box 13 is three checkboxes and box 14 is an unconstrained write-in, sitting on a form that is otherwise printed amounts.

How it works

Parse, extract, verify

1

Parse

Parse turns the document into reading-order Markdown and a hierarchy of blocks (text, tables, figures), and grounds each block to its exact location on the page.

2

Extract

You define the fields in a JSON schema, and Extract returns their values in a consistent, structured format, each linked back to where it appears in the Markdown.

3

Verify

Each value links back to where it appears, down to the character range in the Markdown, and the page and bounding box in the source document, so every result can be verified.

Worked example

One W-2 form, end to end

About this document: An example Form W-2, Copy A, published as an illustration on the Remote People blog. One landscape page, supplied as an image with no text layer, so each value is read from pixels. All of it is obvious test data: employee John Doe, employer Company Inc, and a locality named Test.

Processing objective: The objective is to read one of each kind of value the form carries. That means a printed amount, a ticked checkbox, a free-text write-in, and a figure from the state and local row. Each grounds to its own box, label and value together.

Demonstration fields: Wages (box 1), Social security wages (box 3), Third-party sick pay checked (box 13), Other (box 14 write-in), Local income tax (box 19)

The document

1 page
  • Page 1 of the sample W-2 FormPage 1shown below

Where each value came from

Page 1 of the sample W-2 Form, with every featured field outlined
Wages (box 1)federal.wages_tips_other_compensation
2,323
The region of the sample W-2 Form containing Wages (box 1), with the extracted value outlined
extraction_metadata["federal.wages_tips_other_compensation"]
{
  "value": 2323,
  "page": 1,
  "range": {
    "end": 261,
    "start": 220
  },
  "box": {
    "xmin": 0.53868,
    "ymin": 0.08766,
    "xmax": 0.75533,
    "ymax": 0.15043
  }
}
Social security wages (box 3)federal.social_security_wages
2,323
The region of the sample W-2 Form containing Social security wages (box 3), with the extracted value outlined
extraction_metadata["federal.social_security_wages"]
{
  "value": 2323,
  "page": 1,
  "range": {
    "end": 485,
    "start": 454
  },
  "box": {
    "xmin": 0.53865,
    "ymin": 0.1504,
    "xmax": 0.75532,
    "ymax": 0.21315
  }
}
Third-party sick pay checked (box 13)box_13.third_party_sick_pay
true
The region of the sample W-2 Form containing Third-party sick pay checked (box 13), with the extracted value outlined
extraction_metadata["box_13.third_party_sick_pay"]
{
  "value": true,
  "page": 1,
  "range": {
    "end": 1190,
    "start": 1166
  },
  "box": {
    "xmin": 0.68762,
    "ymin": 0.46317,
    "xmax": 0.75529,
    "ymax": 0.526
  }
}
Other (box 14 write-in)box_14_other
Other Income $100
The region of the sample W-2 Form containing Other (box 14 write-in), with the extracted value outlined
extraction_metadata["box_14_other"]
{
  "value": "Other Income $100",
  "page": 1,
  "range": {
    "end": 1290,
    "start": 1261
  },
  "box": {
    "xmin": 0.53888,
    "ymin": 0.52598,
    "xmax": 0.75523,
    "ymax": 0.68283
  }
}
Local income tax (box 19)state_and_local.local_income_tax
675
The region of the sample W-2 Form containing Local income tax (box 19), with the extracted value outlined
extraction_metadata["state_and_local.local_income_tax"]
{
  "value": 675,
  "page": 1,
  "range": {
    "end": 1646,
    "start": 1617
  },
  "box": {
    "xmin": 0.74268,
    "ymin": 0.68309,
    "xmax": 0.88274,
    "ymax": 0.74518
  }
}

How to try it yourself

Everything on this page is reproducible. The sample, its schema, and the Parse and Extract API outputs are published. You can repeat the same two calls from whichever surface you already build on.

  • Claude Skilldescribe the job; the agent writes it
  • CLIno code at all
  • MCPexpose ADE docs as an agent tool
  • REST APIany language
  • Pythonlandingai-ade
  • TypeScriptlandingai-ade
Why LandingAI?

Documents into data

Accurate

The best accuracy on the difficult documents other tools get wrong, such as messy scans, complicated tables, checkboxes and handwriting.

Auditable

Every answer cites its sources. Values come back with an audit trail (page, bounding box, character range) so a human can review them.

Agentic

Applies multi-step reasoning, and plans before it acts. Handles documents it has never seen before and adapts to variations.

API-first

Composable APIs that drop into any tech stack and can be called from anywhere. Easy to build on and embed in your pipelines and products.

Affordable

Cost-competitive rates with complete price transparency. Spend controls before you run, and every job reports its exact cost.

Enterprise-grade

Built for production and scale from day one. Fully observable and monitored, running securely in our cloud or yours.

Built for high-volume, high-throughput production

  • Zero data retention
  • Priority rate limits
  • Enhanced support
  • VPC and on-prem deployment

Available on Team and Enterprise plans.

Compare plans
Capabilities

W-2 Form processing highlights

Federal boxes 1 to 11
Wages and withholding amounts
Box 13 checkbox states
Box 14 free-text write-ins
Repeating state and local rows
Employer name and EIN
Red-ink Copy A forms
Control numbers
Photographed and scanned copies
Images with no text layer
Any payroll vendor layout
Bounding box for every value
FAQs

Questions, answered

Yes. DPT-3 Pro, the default parse model, reads images and scans as readily as native PDFs. A W-2 photographed off the mailed copy parses the same way as one downloaded from a payroll portal, with coordinates against the page image either way.

Yes. Each of the three box 13 checkboxes returns as a boolean. A ticked box grounds to its own label, so a reviewer sees the mark the value was read from.

Define boxes 15 through 20 as an array in your schema. The row repeats per state and locality, and the full set comes back as structured rows, each with its own state code, wages and tax.

Every value comes back with the page, a bounding box and a character range. On a boxed form the box covers the printed label and the amount together, so a crop shows which numbered box a figure was read from.

A W-2 carries a social security number, an employee address and an employer EIN. A schema can ask for the wage and withholding boxes and leave the identifiers out entirely. Accounts are available with zero data retention, alongside SOC 2 Type II, GDPR and HIPAA compliance.

Start extracting W-2 form data

Reliable, structured outputs with full traceability in minutes