Build the T4 / T4A Information Return XML for CRA Internet File Transfer
Skill: Convert payroll data into the T4/T4A information return XML filed via CRA Internet File Transfer
Region: Canada Category: Payroll — year-end information returns Does: Takes a year's payroll totals per employee and produces the T4 (Statement of Remuneration Paid) and T4A (Statement of Pension, Retirement, Annuity, and Other Income) information return as a single CRA XML file, with the slips and the T4/T4A Summary, submitted through Internet File Transfer (XML). System: CRA Internet File Transfer — T4/T4A XML
CRA requires electronic filing of the T4/T4A return when you file more than 5 slips of a type. The XML wraps slips inside a
Returnelement keyed to your RP payroll program account. Quebec employees also need an RL-1 (Relevé 1) filed with Revenu Québec — that is a separate XML, not part of this return. Confirm the current XML schema and box codes before generating.
When this applies
- You paid employment income (T4) or pension/other income (T4A) in a calendar year and must file by the last day of February following the year.
- You want one electronic return covering all slips plus the matching Summary.
- File via Internet File Transfer (or Web Forms for small volumes). RL-1 slips go separately to Revenu Québec.
Input data required
| Input | Use |
|---|---|
Business Number with RP program account (#########RP0001) |
Return identifier |
| Tax year | Return year |
| Employee name, address, SIN | Slip identification |
| Employment income | T4 Box 14 |
| CPP/QPP contributions | T4 Box 16 / 16A (QPP) |
| EI premiums | T4 Box 18 |
| Income tax deducted | T4 Box 22 |
| Pensionable / insurable earnings | T4 Box 26 / Box 24 |
| RPP contributions, union dues, footnote amounts | T4 Boxes 20, 44, Other Information codes (e.g., 40, 85) |
| T4A income (pension, fees, self-employed commissions, etc.) | T4A boxes 016/020/048 etc. |
Field / structure mapping (XML)
Submission
└── Return
├── T4
│ ├── T4Slip ... (one per employee)
│ │ ├── EMPE_NM (employee name)
│ │ ├── sin (social insurance number)
│ │ ├── EMPT_INCO_AMT (Box 14 employment income)
│ │ ├── CPP_CNTRB_AMT (Box 16 CPP)
│ │ ├── EI_PREM_AMT (Box 18 EI)
│ │ ├── ITX_DEDN_AMT (Box 22 income tax)
│ │ └── OTH_INFO (Other Information code/amount pairs)
│ └── T4Summary (totals of all slips + RP account)
└── T4A
├── T4ASlip ...
└── T4ASummary
Element names follow the CRA T4/T4A XML schema; the Summary totals (e.g., total employment income, total CPP, total EI, total tax) must equal the sum of the slips it contains.
Calculation rules
- T4 Summary Box 14 total = Σ slip Box 14; same per-box reconciliation for Boxes 16, 18, 22.
- Box 24 (EI insurable earnings) and Box 26 (CPP/QPP pensionable earnings) are reported even when equal to Box 14, per current CRA rules.
- For 2024+ there are second additional CPP (CPP2) amounts (Box 16A) and a corresponding Other Information code; report where applicable.
- Footnote/benefit amounts go in Other Information code/amount pairs (e.g., code 40 taxable benefits, code 85 employee-paid private health premiums), not in the numbered boxes.
- Amounts in Canadian dollars and cents.
Worked example
One T4 slip and its place in the return for tax year 2025:
<?xml version="1.0" encoding="UTF-8"?>
<Submission>
<Return>
<T4>
<T4Slip>
<EMPE_NM>
<snm>Tremblay</snm>
<gvn_nm>Marie</gvn_nm>
</EMPE_NM>
<sin>123456782</sin>
<rpp_dpsp_rgst_nbr></rpp_dpsp_rgst_nbr>
<prov_cd>ON</prov_cd>
<T4_AMT>
<empt_inco_amt>72000.00</empt_inco_amt> <!-- Box 14 -->
<cpp_cntrb_amt>4034.10</cpp_cntrb_amt> <!-- Box 16 -->
<empe_eip_amt>1077.48</empe_eip_amt> <!-- Box 18 -->
<itx_ddct_amt>11800.00</itx_ddct_amt> <!-- Box 22 -->
<ei_insu_ern_amt>65700.00</ei_insu_ern_amt><!-- Box 24 -->
<cpp_qpp_ern_amt>68500.00</cpp_qpp_ern_amt><!-- Box 26 -->
</T4_AMT>
<OTH_INFO>
<rpp_cntrb_amt></rpp_cntrb_amt>
</OTH_INFO>
</T4Slip>
<T4Summary>
<bn>123456789RP0001</bn>
<tx_yr>2025</tx_yr>
<slp_cnt>1</slp_cnt>
<tot_empt_inco_amt>72000.00</tot_empt_inco_amt>
<tot_cpp_cntrb_amt>4034.10</tot_cpp_cntrb_amt>
<tot_empe_eip_amt>1077.48</tot_empe_eip_amt>
<tot_itx_ddct_amt>11800.00</tot_itx_ddct_amt>
</T4Summary>
</T4>
</Return>
</Submission>
Validation checklist
- Business Number with correct RP payroll program account on the Summary
- One slip per employee/recipient; valid SIN on each
- Box 14 employment income, Box 16 CPP (and 16A CPP2 if applicable), Box 18 EI, Box 22 tax populated
- Box 24/26 insurable and pensionable earnings reported per current rules
- Other Information code/amount pairs used for footnotes (e.g., 40, 85), not numbered boxes
- Summary totals reconcile to the sum of the slips
- Electronic filing used when more than 5 slips of a type
- Quebec employees' RL-1 filed separately with Revenu Québec
- XML validates against the current CRA T4/T4A schema before transfer
Last updated: 2026-06-04 — confirm the active schema version, field codes, and CRA portal requirements against the current Canada Revenue Agency specifications before use.