CRA T4127, 122nd and 123rd editions, 2026
Every deduction, with its receipt.
Takehome computes Canadian payroll deductions from the CRA's own formulas: federal and provincial tax, CPP, CPP2 and EI for twelve provinces and territories plus work outside Canada. One Rust engine answers in this tab, in the API and in the packages, and it shows every factor it used.
- PDOC forms matched, default
- 8,905 / 9,002
- With the PDOC rounding arm
- 8,987 / 9,002
- Floats in the engine's money path
- 0
01 The stub
Run a paycheque. Read every line.
The calculation below runs in this tab: the Rust engine compiled to WebAssembly. No salary figure leaves the browser.
Earnings statement
Net pay
$
Employer pays
Not withheld from the employee: the employer's own CPP and EI on this pay.
No salary figure leaves the browser.
The working
Every factor the engine used, with its value and the T4127 section it comes from. Links open the CRA edition that answered this pay date.
| Factor | Value | What it is | CRA source |
|---|---|---|---|
| A | Annual taxable income | T4127 Ch. 4, Step 1 | |
| P | The number of pay periods in the year | T4127 Ch. 4, Step 1 | |
| C | Canada (or Quebec) Pension Plan contributions | T4127 Ch. 6 | |
| C2 | Second additional Canada (or Quebec) Pension Plan contributions | T4127 Ch. 6 | |
| EI | Employment insurance premiums | T4127 Ch. 7 | |
| F5 | Deductions for Canada Pension Plan additional contributions | T4127 Ch. 4, Step 1 | |
| F5A | CPP additional-contribution deduction | T4127 Ch. 4, Step 1 | |
| BPAF | Federal Basic Personal Amount | T4127 Ch. 2, Table 8.2 | |
| TC | Total claim amount reported on federal Form TD1 | T4127 Ch. 2 | |
| CEA | Canada Employment Amount | T4127 Ch. 8, Table 8.2 | |
| R | Federal tax rate | T4127 Ch. 8, Table 8.1 | |
| K | Federal constant; the tax overcharged when applying the higher federal rates to A | T4127 Ch. 8, Table 8.1 | |
| K1 | Federal non-refundable personal tax credit (lowest federal tax rate × TC) | T4127 Ch. 4, Step 2 | |
| K2 | Federal tax credit for base CPP contributions and EI premiums | T4127 Ch. 4, Step 2 | |
| K4 | Federal non-refundable tax credit calculated using the Canada employment amount | T4127 Ch. 4, Step 2 | |
| T3 | Annual basic federal tax | T4127 Ch. 4, Step 2 | |
| T1 | Annual federal tax deduction | T4127 Ch. 4, Step 3 | |
| TCP | Total claim amount reported on the provincial or territorial Form TD1 | T4127 Ch. 2 | |
| V | Provincial or territorial tax rate | T4127 Ch. 8, Table 8.1 | |
| KP | Provincial or territorial constant | T4127 Ch. 8, Table 8.1 | |
| K1P | Provincial or territorial non-refundable personal tax credit (lowest provincial rate × TCP) | T4127 Ch. 4, Step 5 | |
| K2P | Provincial or territorial tax credit for base CPP contributions and EI premiums | T4127 Ch. 4, Step 5 | |
| K4P | Territorial non-refundable tax credit calculated using the provincial or territorial Canada employment amount | T4127 Ch. 4, Step 5 | |
| K5P | Provincial supplemental non-refundable tax credit (lowest provincial tax rate) | T4127 Ch. 4, Step 5 | |
| T4 | Annual basic provincial or territorial tax | T4127 Ch. 4, Step 4 | |
| V1 | Provincial surtax calculated on the basic provincial tax (Ontario only) | T4127 Ch. 4, Step 5 | |
| V2 | Ontario Health Premium calculated on taxable income | T4127 Ch. 4, Step 5 | |
| S | Provincial tax reduction (Ontario and British Columbia) | T4127 Ch. 4, Step 5 | |
| Y | Additional Ontario tax-reduction amount based on the number of eligible dependants | T4127 Ch. 4, Step 5 | |
| T2 | Annual provincial or territorial tax deduction (except Quebec) | T4127 Ch. 4, Step 5 | |
| T | Estimated federal and provincial or territorial tax deductions | T4127 Ch. 4, Step 6 |
02 The proof
Checked against the CRA's own calculator, to the cent.
8,982 boundary forms were entered into the CRA Payroll Deductions Online Calculator (PDOC) for the July 2026 edition, plus 20 Ontario forms from January. Every PDOC line is compared with the engine on every test run. Nothing is exempted from the count.
Default arm, t4127
8,905/9,002
98.92% of forms match on all seven lines
rounding_compat: pdoc
8,987/9,002
99.83% with the CPP line in binary64, as inferred from PDOC's outputs
Before 22 October 2026
8,838/9,002
164 one-cent disagreements, cause unnamed
Three named rules close 149 of the 164 one-cent gaps
- K2 is two credits, not one. T4127 writes the CPP and EI credit as
(0.14 x CPP base) + (0.14 x EI base), and the T1 return computes them on separate lines. T4127's text does not say where to round; PDOC rounds each to the cent before adding. The engine now does too, in the default arm. - Ontario surtax is two lines.
(0.20 x (T4 - 5,818)) + (0.36 x (T4 - 7,446)), each rounded. Default arm. - PDOC's CPP line matches binary floating point, inferred from its outputs:
(500.00 - 350.00) x 0.0595is exactly8.925in decimal, which T4127 rounds to8.93. In IEEE-754 binary64 it is8.924999999999999, and PDOC shows8.92. That one rule explains all 82 CPP-line gaps. The default arm keeps decimal arithmetic for CPP;rounding_compat: pdocreproduces PDOC with integer-only binary64 emulation, so no float enters the money path.
The default arm follows T4127 plus two PDOC-matched roundings T4127's text does not specify: K2/K2P credits and Ontario surtax lines are rounded separately. The rules were chosen by inspecting the full corpus; 15 cases remain unexplained. The PDOC corpus was captured from live PDOC, last capture 2026-09-15.
| Jurisdiction | Forms | Match, t4127 | Match, pdoc | Status |
|---|---|---|---|---|
| Alberta | 732 | 726 | 732 | All match |
| British Columbia | 912 | 905 | 911 | 1 off by 1 cent |
| Manitoba | 678 | 668 | 676 | 2 off by 1 cent |
| New Brunswick | 614 | 608 | 614 | All match |
| Newfoundland and Labrador | 860 | 852 | 858 | 2 off by 1 cent |
| Nova Scotia | 670 | 662 | 668 | 2 off by 1 cent |
| Northwest Territories | 612 | 606 | 612 | All match |
| Nunavut | 602 | 594 | 600 | 2 off by 1 cent |
| Ontario | 1,100 | 1,090 | 1,096 | 4 off by 1 cent |
| Prince Edward Island | 734 | 727 | 733 | 1 off by 1 cent |
| Saskatchewan | 552 | 545 | 551 | 1 off by 1 cent |
| Yukon | 488 | 480 | 488 | All match |
| Outside Canada | 428 | 422 | 428 | All match |
The 15 forms still one cent apart, listed
Each is a period tax line where the engine's annual tax divided by the pay periods lands within a fraction of a cent of a half-cent. No published rounding rule we tested reproduces PDOC on these, so they count against both rates. Full requests and outputs are in the conformance record.
| Jurisdiction | P | Gross | Claim | Line | Engine | PDOC |
|---|---|---|---|---|---|---|
| BC | 240 | 106.55 | 1 | Federal | 3.43 | 3.44 |
| MB | 24 | 1958.33 | 0 | Federal | 245.85 | 245.84 |
| MB | 24 | 1958.33 | 1 | Federal | 149.88 | 149.87 |
| NL | 53 | 842.97 | 0 | Federal | 105.65 | 105.66 |
| NL | 240 | 930.59 | 1 | Provincial | 127.96 | 127.97 |
| NS | 22 | 2817.78 | 0 | Provincial | 314.91 | 314.90 |
| NS | 240 | 258.29 | 1 | Provincial | 24.49 | 24.50 |
| NU | 240 | 1077.00 | 0 | Provincial | 86.68 | 86.69 |
| NU | 240 | 310.82 | 1 | Provincial | 10.52 | 10.53 |
| ON | 10 | 5852.29 | 1 | Provincial | 285.28 | 285.29 |
| ON | 13 | 2769.24 | 0 | Federal | 344.39 | 344.38 |
| ON | 13 | 447.54 | 0 | Federal | 43.99 | 43.98 |
| ON | 13 | 447.55 | 0 | Federal | 43.99 | 43.98 |
| PE | 240 | 445.37 | 1 | Provincial | 51.24 | 51.25 |
| SK | 12 | 4544.33 | 1 | Provincial | 264.48 | 264.47 |
Also measured: Ontario January corpus 20/20; PDOC bonus corpus 19/20 (its own class, not in the rate). Latest PDOC capture 2026-09-15. Quebec is not supported and is not in any count.
03 How it works
One engine, every runtime.
The same Rust function answers in the browser, in the API and in the packages. Each response names the rule set and the engine build hash, so a payroll team can pin exactly what it tested.
- CRA T4127 tables. January and July 2026 editions, archived as CSV with SHA-256.
- Rule data. Effective-dated JSON per edition; July overlays January.
- takehome-core (Rust). Exact decimal money, one named rounding per step, no clock, network or IO.
- Every runtime. WebAssembly in the browser and embed widget, the Cloudflare Worker API, and npm and PyPI packages (takehome-ca, not yet published).
- Conformance gate. 9,002 PDOC forms checked on every test run.