impotsqc: Québec and federal tax returns, line by line
Tax calculators are usually web forms: you can’t script them, and you can’t see where a number comes from. impotsqc computes the federal T1 and Québec TP-1 returns line by line, with the official line numbers and labels, the rule applied to each line, and the official document behind every parameter. Describe a fictional taxpayer, and a script or an AI agent gets every line of every form as structured data (JSON) that it can explain.
It also computes child support under the Québec model, line by line on the official Formulaire de fixation.
What it covers
- Years 2025 and 2026, one more each year; a published year never changes.
- Employees: employment income, QPP, EI and QPIP contributions, RRSP deduction, investment income.
- Retirees: RRIF and RRSP withdrawals, QPP, OAS and its clawback, age, pension, living-alone and career-extension credits.
- Dividends, capital gains and the alternative minimum tax.
- Schedules as separate official forms (T691, TP-1 schedules B, E, F and K, TP-752.PC, TP-776.42).
- Child support: every custody section of the Québec model, the annual tables, and the ability-to-pay limit.
Not covered yet: self-employment, couples and transfers between spouses, credits for children, medical expenses, donations, refundable credits and instalments.
Where the numbers come from
Parameters come only from official publications (Canada Revenue Agency, Revenu Québec, Retraite Québec, RAMQ, the finance ministries), each value with its source. The results were checked line by line on 32 fictional taxpayers per year against an independent calculator; the two remaining differences are documented interpretation points.
Try it
In your browser, without installing anything: the Québec income tax calculator.
In Python 3.11 or newer, no dependencies:
pip install "git+https://github.com/plcharbonneau/impotsQC.git"from impotsqc import Taxpayer, compute
r = compute(Taxpayer(year=2026, age=66, rrif_income=30_000, oas_pension=8_900))
r.forms["T1"]["23600"].amount # federal net income
r.forms["TP-1"]["275"].amount # Québec net income
r.total_payable # federal and Québec tax, contributions included
r.to_dict() # every line as JSON, for an agentThe documentation is in French, the API in English.
Limits
This is an alpha (version 0.3). It is not tax advice, and its results don’t bind the Canada Revenue Agency or Revenu Québec. Until the 2026 forms are published, 2026 uses the 2025 line numbering with 2026 parameters.
The code is free software under the GNU AGPL 3.0 license.