Build Form 1042-S E-File (IRS 1042-S XML)
Skill: Convert US-source FDAP payments to foreign persons into a 1042-S electronic file
Region: United States
Category: Information Returns — Withholding on Foreign Persons (Form 1042-S)
Does: Takes a withholding agent's records of US-source FDAP (Fixed, Determinable, Annual, or Periodical) income paid to foreign persons and produces the Form 1042-S electronic file — one Form1042S record per recipient mapping income code, chapter 3 / chapter 4 status, gross income, withholding rate, exemption codes, treaty/LOB data, and tax withheld for transmission through the IRS IRIS (or legacy FIRE) system.
System: IRS IRIS / FIRE — Form 1042-S, "Foreign Person's U.S. Source Income Subject to Withholding"
The IRS accepts Form 1042-S electronically through IRIS (the modern XML intake) and, for transition years, the legacy FIRE system (Publication 1187 fixed-width). A withholding agent filing 10 or more information returns in aggregate must file electronically. The 1042-S reconciles to the annual Form 1042 (the aggregate withholding return). This skill produces a well-formed XML record; confirm the exact IRIS 1042-S schema element names, the current-year income/exemption/status code lists, and the Form 1042 reconciliation against the IRS instructions and Publication 1187 before transmission. The AI does not file; it builds the data.
When this applies
- A withholding agent (US payer, financial institution, university, broker, or partnership) pays US-source FDAP income — interest, dividends, royalties, rents, scholarships, compensation for personal services, pension distributions — to a nonresident alien, foreign corporation, or other foreign person.
- A separate 1042-S is required per recipient, per income code, per tax rate, per chapter — split a recipient into multiple records when income types or rates differ.
- Not for wages reported on a W-2, payments to US persons (1099 series), or effectively connected income reported elsewhere.
Conversion procedure
- Read the source — accept CSV/JSON/pasted payment records. Each record needs: recipient name and address, country, US TIN and/or foreign TIN, chapter 3 status code, chapter 4 status code, income code, gross income, withholding rate, tax withheld, exemption code(s), and (if treaty-based) the country and LOB code.
- Extract the withholding agent block once — agent EIN, name, address, chapter 3 and chapter 4 status codes, and (for an FFI) the GIIN.
- Classify the income — assign the 2-digit income code (Box 1) and decide whether withholding falls under chapter 3 (NRA withholding) or chapter 4 (FATCA). One record per income code/rate/chapter.
- Determine the rate and exemption — set the chapter 3 tax rate and exemption code (Box 3a/3b) and the chapter 4 status/exemption (Box 4a/4b). A reduced treaty rate uses exemption code
04 plus the recipient's treaty country and LOB code.
- Compute the tax — federal tax withheld = gross income × rate (whole-dollar). Reconcile total withholding across all 1042-S records to the Form 1042.
- Emit the XML — build the transmission/withholding-agent header and one
Form1042S element per recipient record, using the worked example as the template.
- Validate — run the checklist; confirm against the current IRIS schema and Publication 1187.
Source → 1042-S field map
| From the source |
→ Element / Box |
| Withholding agent EIN |
WithholdingAgent/EIN |
| Withholding agent name/address |
WithholdingAgent/Name, .../USAddress |
| Agent chapter 3 status code |
WithholdingAgent/Ch3StatusCode (Box 12b) |
| Agent chapter 4 status code |
WithholdingAgent/Ch4StatusCode (Box 12c) |
| Agent GIIN (if FFI) |
WithholdingAgent/GIIN |
| Income code |
Form1042S/IncomeCode (Box 1) |
| Gross income paid |
Form1042S/GrossIncome (Box 2) |
| Chapter indicator (3 or 4) |
Form1042S/ChapterIndicator (Box 3) |
| Chapter 3 tax rate |
Form1042S/Ch3TaxRate (Box 3b) |
| Chapter 3 exemption code |
Form1042S/Ch3ExemptionCode (Box 3a) |
| Chapter 4 exemption code |
Form1042S/Ch4ExemptionCode (Box 4a) |
| Chapter 4 tax rate |
Form1042S/Ch4TaxRate (Box 4b) |
| Federal tax withheld |
Form1042S/FederalTaxWithheld (Box 7a) |
| Total withholding credit |
Form1042S/TotalWithholdingCredit (Box 10) |
| Recipient name |
Form1042S/Recipient/Name (Box 13a) |
| Recipient country code |
Form1042S/Recipient/CountryCode (Box 13b) |
| Recipient US TIN |
Form1042S/Recipient/USTIN (Box 13e) |
| Recipient foreign TIN |
Form1042S/Recipient/ForeignTIN (Box 13i) |
| Recipient chapter 3 status code |
Form1042S/Recipient/Ch3StatusCode (Box 13f) |
| Recipient chapter 4 status code |
Form1042S/Recipient/Ch4StatusCode (Box 13g) |
| Treaty country / LOB code |
Form1042S/Recipient/CountryCode, .../LOBCode (Box 13b/13j) |
| Unique form identifier |
Form1042S/UniqueFormIdentifier |
Document structure
Form1042STransmission
├── WithholdingAgent ← once per file
│ ├── EIN / Name / USAddress
│ ├── Ch3StatusCode / Ch4StatusCode (Box 12b / 12c)
│ └── GIIN ← if a Foreign Financial Institution
└── Form1042S (one per recipient/income-code/rate/chapter, repeatable)
├── UniqueFormIdentifier ← 10-char unique ID per form
├── IncomeCode (Box 1)
├── GrossIncome (Box 2)
├── ChapterIndicator (Box 3 — "3" or "4")
├── Ch3ExemptionCode / Ch3TaxRate (Box 3a / 3b)
├── Ch4ExemptionCode / Ch4TaxRate (Box 4a / 4b)
├── FederalTaxWithheld (Box 7a)
├── TotalWithholdingCredit (Box 10)
└── Recipient
├── Name / ForeignAddress (Box 13a / 13c–13d)
├── CountryCode (Box 13b)
├── Ch3StatusCode / Ch4StatusCode (Box 13f / 13g)
├── USTIN / ForeignTIN (Box 13e / 13i)
└── LOBCode (Box 13j — treaty Limitation on Benefits)
Note: Ch3TaxRate/Ch4TaxRate are expressed as the percentage applied (e.g. 15.00, 30.00, 00.00). A record claiming a treaty rate must carry both the recipient's treaty CountryCode and an LOBCode. The aggregate of all FederalTaxWithheld reconciles to Form 1042.
Code tables
Income codes (Box 1, selected)
| Code |
Income type |
01 |
Interest paid by US obligors — general |
06 |
Dividends paid by US corporations — general |
12 |
Other royalties (e.g. copyright, software, recordings) |
16 |
Scholarship or fellowship grants |
17 |
Compensation for independent personal services |
18 |
Compensation for dependent personal services |
20 |
Compensation during studying and training |
29 |
Deposit interest |
40 |
Other income |
51 |
Other income — distributions |
Chapter 3 exemption codes (Box 3a, selected)
| Code |
Meaning |
00 |
Not exempt (tax withheld at the stated rate) |
01 |
Income effectively connected with a US trade or business |
02 |
Exempt under an Internal Revenue Code section (income other than portfolio interest) |
03 |
Income is not from US sources |
04 |
Exempt under tax treaty |
05 |
Portfolio interest exempt under the IRC |
06 |
Qualified intermediary that assumes primary withholding responsibility |
07 |
Withholding foreign partnership or withholding foreign trust |
Chapter 4 exemption codes (Box 4a, selected)
| Code |
Meaning |
13 |
Grandfathered payment |
14 |
Effectively connected income |
15 |
Payee not subject to chapter 4 withholding |
16 |
Excluded nonfinancial payment |
21 |
Other — payment not subject to chapter 4 withholding |
Chapter 3 status codes (Box 13f, selected)
| Code |
Recipient status |
01 |
U.S. withholding agent — FI |
09 |
Qualified intermediary |
15 |
Corporation |
16 |
Individual |
17 |
Estate |
20 |
Private foundation |
Chapter 4 status codes (Box 13g, selected)
| Code |
Recipient status |
01 |
U.S. withholding agent — FI |
05 |
Participating FFI — other |
23 |
Section 501(c) organization |
27 |
Passive NFFE |
34 |
Direct reporting NFFE |
LOB codes (Box 13j, selected — treaty Limitation on Benefits)
| Code |
Basis |
01 |
Individual |
02 |
Government — contracting state/political subdivision/local authority |
04 |
Tax-exempt pension trust or pension fund |
06 |
Publicly-traded corporation |
08 |
Company that meets the ownership and base-erosion test |
09 |
Company that meets the derivative-benefits test |
12 |
Company that meets the active-trade-or-business test |
Calculation rules
- Federal tax withheld (Box 7a) =
GrossIncome × applicable rate, rounded to whole dollars. Statutory NRA rate is 30%; a treaty may reduce it (e.g. 15% on dividends, 0% on certain interest/royalties).
- A chapter 4 (FATCA) 30% withholding applies first if the payee is a recalcitrant account holder or nonparticipating FFI; otherwise withholding falls under chapter 3. Box 3 (Chapter Indicator) shows which chapter the withholding was done under.
- A reduced treaty rate requires exemption code
04 (Box 3a), the recipient's treaty country (Box 13b), an applicable LOB code (Box 13j), and usually a valid Form W-8BEN/W-8BEN-E on file.
- Total withholding credit (Box 10) = Box 7a + Box 8 (withheld by other agents) + Box 9 (overwithholding repaid), per the form's arithmetic.
- Form 1042 reconciliation: Σ of all
GrossIncome and Σ of all FederalTaxWithheld across the 1042-S records must tie to the totals reported on the annual Form 1042. Flag any mismatch.
- Money fields are whole US dollars (no cents on 1042-S boxes 2/7a/10); rates are percentages with 2 decimals (
30.00, 15.00, 00.00).
- Always recompute the tax and the 1042 reconciliation; never copy an asserted total.
Worked example (end-to-end)
Withholding agent GLOBAL CUSTODY BANK (EIN 98-7654321, chapter 3 status 01, chapter 4 status 01) pays a dividend (income code 06) of $10,000 to HANS MÜLLER, an individual resident of Germany (country code DE), foreign TIN on file, chapter 3 status 16 (individual), chapter 4 status 15 (payee not subject to ch.4 withholding). Germany's treaty reduces the dividend rate to 15%, claimed under exemption code 04 with LOB code 01 (individual). Federal tax withheld = 10,000 × 15% = $1,500.
<?xml version="1.0" encoding="UTF-8"?>
<Form1042STransmission xmlns="urn:us:gov:treasury:irs:ext:form1042s">
<WithholdingAgent>
<EIN>987654321</EIN>
<Name>GLOBAL CUSTODY BANK</Name>
<USAddress>
<AddressLine>200 Park Avenue</AddressLine>
<City>New York</City>
<State>NY</State>
<ZIPCode>10166</ZIPCode>
</USAddress>
<Ch3StatusCode>01</Ch3StatusCode>
<Ch4StatusCode>01</Ch4StatusCode>
</WithholdingAgent>
<Form1042S>
<UniqueFormIdentifier>0000000001</UniqueFormIdentifier>
<IncomeCode>06</IncomeCode>
<GrossIncome>10000</GrossIncome>
<ChapterIndicator>3</ChapterIndicator>
<Ch3ExemptionCode>04</Ch3ExemptionCode>
<Ch3TaxRate>15.00</Ch3TaxRate>
<Ch4ExemptionCode>15</Ch4ExemptionCode>
<Ch4TaxRate>00.00</Ch4TaxRate>
<FederalTaxWithheld>1500</FederalTaxWithheld>
<TotalWithholdingCredit>1500</TotalWithholdingCredit>
<Recipient>
<Name>HANS MULLER</Name>
<ForeignAddress>
<AddressLine>Hauptstrasse 12</AddressLine>
<City>Munich</City>
<CountryCode>DE</CountryCode>
<PostalCode>80331</PostalCode>
</ForeignAddress>
<CountryCode>DE</CountryCode>
<Ch3StatusCode>16</Ch3StatusCode>
<Ch4StatusCode>15</Ch4StatusCode>
<ForeignTIN>DE123456789</ForeignTIN>
<LOBCode>01</LOBCode>
</Recipient>
</Form1042S>
</Form1042STransmission>
Normalisations shown: EIN 98-7654321 → 987654321 (hyphen stripped); income code dividend → 06; treaty rate 15% → 15.00; federal tax recomputed 10,000 × 15% = 1500 (whole dollars); chapter indicator 3 (withheld under chapter 3); ch.4 status 15 carries a 00.00 ch.4 rate; recipient country and LOB set to claim the Germany treaty benefit. The GrossIncome (10000) and FederalTaxWithheld (1500) feed the agent's Form 1042 reconciliation.
Validation checklist
Last updated: 2026-06-13 — verify the current IRIS Form 1042-S XML schema element names, the income/exemption/chapter-3/chapter-4 status and LOB code lists, the 10-return e-file threshold, and the Form 1042 reconciliation against the current IRS instructions and Publication 1187 before use.