US W-2 Wage and Tax Statement
Extract structured data from IRS Form W-2 including employer/employee information, wages, withholdings, and state tax details.
The fields this preset extracts.
employee_addressstringHome mailing address of the employee.
employee_namestringFull legal name of the employee.
employee_ssnstringSocial Security Number (9 digits without dashes or spaces).
employer_addressstringFull business address of the employer.
employer_instringEmployer Identification Number (9 digits without dashes).
employer_namestringLegal name of the employer.
federal_income_tax_withheld_usd_centsintegerFederal income tax withheld in USD cents.
medicare_tax_withheld_usd_centsintegerMedicare tax withheld in USD cents.
medicare_wages_and_tips_usd_centsintegerMedicare wages and tips in USD cents.
social_security_tax_withheld_usd_centsintegerSocial Security tax withheld in USD cents.
social_security_wages_usd_centsintegerSocial Security wages in USD cents.
state_codestringTwo-letter state abbreviation for state withholding (if applicable).
state_income_tax_usd_centsintegerState income tax withheld in USD cents.
state_wages_usd_centsintegerState wages in USD cents (if state income tax applies).
tax_yearintegerTax year as a 4-digit integer (e.g., 2024).
wages_tips_other_compensation_usd_centsintegerTotal wages, tips, and other compensation in USD cents (e.g., 50000 for $500.00).
curl -X POST 'https://app.staging.xberg.io/v1/extract' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'file=@your-document.pdf' \
--form-string 'options={"preset":"w2_us"}'- Call mode
- Text only
- Citations
- Enabled
- Version
- v1
The instructions Xberg gives the AI model when it extracts this document type.
You are a precise structured-data extractor for IRS Form W-2 (Wage and Tax Statement). Extract all fields exactly as printed on the form. Do not infer or estimate values. All monetary amounts are in USD cents (integers — multiply displayed dollar amounts by 100). Names, addresses, and identification numbers must be extracted literally. SSN format: exactly 9 digits without dashes or spaces. IN format: exactly 9 digits. Tax year is a 4-digit integer. State code is a 2-letter abbreviation (optional). Dates are ISO-8601 strings (YYYY-MM-DD) if present. Include all wage totals, federal withholding, Social Security wages and tax, Medicare wages and tax, and state-level data if present. If a field is absent or illegible, omit it from the output. Ensure all monetary values are consistent. If the document does not match this preset, return {}. Extract only values supported by the document. Omit absent, illegible, or incomplete values, including within nested objects, while retaining other supported values. Do not infer, guess, supply defaults, or calculate missing values. Omit dates whose complete year, month, and day are not explicit. Do not emit null or placeholder strings such as "null" or "2023-XX-XX" for missing values.