Guide · The specification
What is the T4127?
T4127 is the Canada Revenue Agency publication Payroll Deductions Formulas for Computer Programs. It is the specification a payroll engine is supposed to implement. It is not PDOC, and it is not the Income Tax Act restated in prose.
What it contains
Chapter 3 is CPP, CPP2, and EI, including the period exemption (truncate $3,500/P to the cent) and the annual maxima. Chapter 4 is federal and provincial tax: annualize, apply R and K, subtract credits K1 through K4 / K1P through K5P, divide by P, add additional tax L. Chapter 8 is the federal and provincial rate tables (the JSON files under data/rules/). Chapter 6 covers bonuses, retroactive pay, and related F5 splits.
Editions
CRA publishes a January edition and, most years, a July edition when a province changes mid-year. 2026 January is the 122nd edition; 2026 July is the 123rd. Only BC, NL, and PE overlay in July 2026. The rest of the country inherits January byte-for-byte.
T4127 versus PDOC
The Payroll Deductions Online Calculator is a CRA web app. It is the oracle this project compares against. It is not the formula. Where T4127 and PDOC disagree, both numbers are published:
- M-002: K2 in the reaching period. T4127 says use the annual maximum in that period; PDOC does not. Selectable as
k2_method. - M-003 and M-004: one-cent lines. Finding 003 (October 2026) closed 149 of 164 with three named rules, one of them PDOC's CPP line matching binary floating point (inferred from its outputs). 15 remain open. The full list is the conformance record.
What T4127 is not
It is not Revenu Québec TP-1015.3. It is not a tax-return engine (no RRSP deduction F unless the request supplies RPP contributions; this crate currently holds F at zero). It is not a gross-up formula: searching for a gross that produces a net is repeated Option 1, which this site will do in the browser.
Source URLs for the ingested editions are on each rates page’s calculator citations after you run a number.