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.

Pay details

Claim code 1 is the basic personal amount. Codes 2 to 10 use the CRA's claim-code table for the pay date. Code 0 claims nothing; E exempts income tax. Quebec is refused, never guessed.

Earnings statement

Federal tax
Provincial tax
CPP
CPP2
EI
Total deductions

Net pay

$

Employer pays

Not withheld from the employee: the employer's own CPP and EI on this pay.

Employer CPP
Employer CPP2
Employer EI
Employer cost (gross + premiums)

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.

FactorValueWhat it isCRA source
AAnnual taxable incomeT4127 Ch. 4, Step 1
PThe number of pay periods in the yearT4127 Ch. 4, Step 1
CCanada (or Quebec) Pension Plan contributionsT4127 Ch. 6
C2Second additional Canada (or Quebec) Pension Plan contributionsT4127 Ch. 6
EIEmployment insurance premiumsT4127 Ch. 7
F5Deductions for Canada Pension Plan additional contributionsT4127 Ch. 4, Step 1
F5ACPP additional-contribution deductionT4127 Ch. 4, Step 1
BPAFFederal Basic Personal AmountT4127 Ch. 2, Table 8.2
TCTotal claim amount reported on federal Form TD1T4127 Ch. 2
CEACanada Employment AmountT4127 Ch. 8, Table 8.2
RFederal tax rateT4127 Ch. 8, Table 8.1
KFederal constant; the tax overcharged when applying the higher federal rates to AT4127 Ch. 8, Table 8.1
K1Federal non-refundable personal tax credit (lowest federal tax rate × TC)T4127 Ch. 4, Step 2
K2Federal tax credit for base CPP contributions and EI premiumsT4127 Ch. 4, Step 2
K4Federal non-refundable tax credit calculated using the Canada employment amountT4127 Ch. 4, Step 2
T3Annual basic federal taxT4127 Ch. 4, Step 2
T1Annual federal tax deductionT4127 Ch. 4, Step 3
TCPTotal claim amount reported on the provincial or territorial Form TD1T4127 Ch. 2
VProvincial or territorial tax rateT4127 Ch. 8, Table 8.1
KPProvincial or territorial constantT4127 Ch. 8, Table 8.1
K1PProvincial or territorial non-refundable personal tax credit (lowest provincial rate × TCP)T4127 Ch. 4, Step 5
K2PProvincial or territorial tax credit for base CPP contributions and EI premiumsT4127 Ch. 4, Step 5
K4PTerritorial non-refundable tax credit calculated using the provincial or territorial Canada employment amountT4127 Ch. 4, Step 5
K5PProvincial supplemental non-refundable tax credit (lowest provincial tax rate)T4127 Ch. 4, Step 5
T4Annual basic provincial or territorial taxT4127 Ch. 4, Step 4
V1Provincial surtax calculated on the basic provincial tax (Ontario only)T4127 Ch. 4, Step 5
V2Ontario Health Premium calculated on taxable incomeT4127 Ch. 4, Step 5
SProvincial tax reduction (Ontario and British Columbia)T4127 Ch. 4, Step 5
YAdditional Ontario tax-reduction amount based on the number of eligible dependantsT4127 Ch. 4, Step 5
T2Annual provincial or territorial tax deduction (except Quebec)T4127 Ch. 4, Step 5
TEstimated federal and provincial or territorial tax deductionsT4127 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

  1. 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.
  2. Ontario surtax is two lines.(0.20 x (T4 - 5,818)) + (0.36 x (T4 - 7,446)), each rounded. Default arm.
  3. PDOC's CPP line matches binary floating point, inferred from its outputs: (500.00 - 350.00) x 0.0595 is exactly 8.925 in decimal, which T4127 rounds to 8.93. In IEEE-754 binary64 it is 8.924999999999999, and PDOC shows 8.92. That one rule explains all 82 CPP-line gaps. The default arm keeps decimal arithmetic for CPP; rounding_compat: pdoc reproduces 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.

PDOC agreement by jurisdiction, July 2026 queue (8,982 compared forms)
JurisdictionFormsMatch, t4127Match, pdocStatus
Alberta732726732All match
British Columbia9129059111 off by 1 cent
Manitoba6786686762 off by 1 cent
New Brunswick614608614All match
Newfoundland and Labrador8608528582 off by 1 cent
Nova Scotia6706626682 off by 1 cent
Northwest Territories612606612All match
Nunavut6025946002 off by 1 cent
Ontario1,1001,0901,0964 off by 1 cent
Prince Edward Island7347277331 off by 1 cent
Saskatchewan5525455511 off by 1 cent
Yukon488480488All match
Outside Canada428422428All 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.

JurisdictionPGrossClaimLineEnginePDOC
BC240106.551Federal3.433.44
MB241958.330Federal245.85245.84
MB241958.331Federal149.88149.87
NL53842.970Federal105.65105.66
NL240930.591Provincial127.96127.97
NS222817.780Provincial314.91314.90
NS240258.291Provincial24.4924.50
NU2401077.000Provincial86.6886.69
NU240310.821Provincial10.5210.53
ON105852.291Provincial285.28285.29
ON132769.240Federal344.39344.38
ON13447.540Federal43.9943.98
ON13447.550Federal43.9943.98
PE240445.371Provincial51.2451.25
SK124544.331Provincial264.48264.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.

Takehome architectureCRA T4127 tables become effective-dated rule data. The Rust core reads it and compiles to WebAssembly for the browser, to the Worker API, and to npm and PyPI packages. A conformance gate checks the core against 9,002 PDOC forms.CRA T4127 tablesJanuary and July 2026 editionsCSV archived with SHA-256Rule dataEffective-dated JSON per editionJuly overlays Januarytakehome-core (Rust)Exact decimal money, no floatsOne named rounding per stepNo clock, network or IOWebAssemblyBrowser and embed widgetCloudflare Worker API/v1/deductions, meterednpm and PyPI packagestakehome-ca, not yet publishedConformance gate9,002 PDOC forms, every test run
  1. CRA T4127 tables. January and July 2026 editions, archived as CSV with SHA-256.
  2. Rule data. Effective-dated JSON per edition; July overlays January.
  3. takehome-core (Rust). Exact decimal money, one named rounding per step, no clock, network or IO.
  4. Every runtime. WebAssembly in the browser and embed widget, the Cloudflare Worker API, and npm and PyPI packages (takehome-ca, not yet published).
  5. Conformance gate. 9,002 PDOC forms checked on every test run.
Hard problems, solved in code: exact decimal money (ADR-001); rounding that follows T4127 step by step, with a PDOC arm (ADR-003, ADR-007); effective-date versioning, so a pay date picks its edition; metering that fails closed, so a meter outage refuses the request instead of serving it unmetered (ADR-005).