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.
curl -X POST $XBERG_ENTERPRISE_URL/v1/extract \ -H "Authorization: Bearer $XBERG_API_KEY" \ -F file=@your-w2_us.pdf \ -F 'preset=w2_us'

Structured fields extracted by this preset
employee_addressstringrequiredHome mailing address of the employee.
employee_namestringrequiredFull legal name of the employee.
employee_ssnstringrequiredSocial Security Number (9 digits without dashes or spaces).
employer_addressstringrequiredFull business address of the employer.
employer_instringrequiredEmployer Identification Number (9 digits without dashes).
employer_namestringrequiredLegal name of the employer.
federal_income_tax_withheld_usd_centsintegerrequiredFederal income tax withheld in USD cents.
medicare_tax_withheld_usd_centsintegerrequiredMedicare tax withheld in USD cents.
medicare_wages_and_tips_usd_centsintegerrequiredMedicare wages and tips in USD cents.
social_security_tax_withheld_usd_centsintegerrequiredSocial Security tax withheld in USD cents.
social_security_wages_usd_centsintegerrequiredSocial 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_yearintegerrequiredTax year as a 4-digit integer (e.g., 2024).
wages_tips_other_compensation_usd_centsintegerrequiredTotal wages, tips, and other compensation in USD cents (e.g., 50000 for $500.00).
Configuration
Call Mode
text_onlyCitations
EnabledVersion
v1Tags
+System Prompt
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.