US W-2 Wage and Tax Statement

Finance

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'
Sample US W-2 Wage and Tax Statement document

Structured fields extracted by this preset

employee_addressstringrequired

Home mailing address of the employee.

employee_namestringrequired

Full legal name of the employee.

employee_ssnstringrequired

Social Security Number (9 digits without dashes or spaces).

employer_addressstringrequired

Full business address of the employer.

employer_instringrequired

Employer Identification Number (9 digits without dashes).

employer_namestringrequired

Legal name of the employer.

federal_income_tax_withheld_usd_centsintegerrequired

Federal income tax withheld in USD cents.

medicare_tax_withheld_usd_centsintegerrequired

Medicare tax withheld in USD cents.

medicare_wages_and_tips_usd_centsintegerrequired

Medicare wages and tips in USD cents.

social_security_tax_withheld_usd_centsintegerrequired

Social Security tax withheld in USD cents.

social_security_wages_usd_centsintegerrequired

Social Security wages in USD cents.

state_codestring

Two-letter state abbreviation for state withholding (if applicable).

state_income_tax_usd_centsinteger

State income tax withheld in USD cents.

state_wages_usd_centsinteger

State wages in USD cents (if state income tax applies).

tax_yearintegerrequired

Tax year as a 4-digit integer (e.g., 2024).

wages_tips_other_compensation_usd_centsintegerrequired

Total wages, tips, and other compensation in USD cents (e.g., 50000 for $500.00).

Configuration

Call Mode

text_only

Citations

Enabled

Version

v1

Tags

taxw2formirswageswithholding
+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.

Open-source primitives, composed into one backend. Curated cohort of design partners. Apply to work with us.

Cookies

We value your privacy

Xberg uses cookies to improve your experience, personalize content, and analyze traffic. You can manage your preferences at any time.