Inspect the Arithmetic — Canada Capital Gains Tax Calculator
Version 1.0
Last updated: March 2026
Transparent arithmetic is the operating system of this calculator.
This document publishes the formulae, computational structure, and assumptions used to generate the outputs displayed on the calculator page.
No opinions. No hidden assumptions. Just arithmetic.
Purpose
This calculator estimates capital gains tax on the sale of a single asset for Canadian tax purposes. It uses user-supplied proceeds,
adjusted cost base (ACB), an inclusion rate, and a marginal tax rate to compute:
capital gain or loss, taxable capital gain, estimated tax owing, and after-tax proceeds.
It is an educational tool only. It does not replicate the full T1 return or CRA rules for loss carryovers, reserves, or special elections.
This simplified version does not subtract outlays and expenses of disposition (such as selling commissions or legal fees); users should reflect those manually in their inputs if they want a closer estimate.
Definitions
Let:
- P = proceeds of disposition (CAD)
- A = adjusted cost base (ACB) of the asset (CAD)
- rincl = capital gains inclusion rate (0–100, percent; default 50)
- tmarg = combined marginal tax rate on taxable income (0–100, percent)
- Gain = capital gain (can be negative for a loss)
- TaxableGain = portion of Gain that is taxable
- TaxOwing = estimated capital gains tax owing
- AfterTaxProceeds = net proceeds after subtracting estimated tax owing
- PRE = principal residence exemption flag (true/false)
Core Equations
1. Capital Gain or Loss
The starting point is the difference between what you received and your adjusted cost base:
Gain = P − A
If Gain ≤ 0, the calculator treats the result as a capital loss for this simplified view. No taxable gain is generated
and estimated tax owing is set to 0. The raw loss is still shown as the “Capital gain / loss” output.
2. Principal Residence Exemption (Educational Toggle)
The “Principal residence exemption (educational only)” toggle is a simple switch to illustrate how the exemption affects tax:
- If PRE is checked, then TaxableGain = 0 and TaxOwing = 0, regardless of Gain.
- The calculator still shows Gain and AfterTaxProceeds = P (no tax deducted).
Real eligibility for the principal residence exemption depends on CRA rules and your facts; this toggle does not test or enforce those rules.
It just shows the arithmetic effect of exempting the entire gain.
3. Inclusion Rate and Taxable Capital Gain
When there is a positive gain and PRE is not enabled, the calculator applies the user-supplied inclusion rate to determine the taxable amount:
If Gain ≤ 0 or PRE is true:
TaxableGain = 0
Else:
TaxableGain = Gain × (rincl / 100)
For 2025, Canadian tax rules use a 50% inclusion rate for most capital gains. The input defaults to 50 but can be adjusted to explore policy
changes or hypothetical scenarios.
4. Estimated Tax Owing
The calculator does not re-run the entire income tax system. Instead, it uses the user’s combined marginal tax rate tmarg
(federal + provincial) as a single percentage applied to the taxable gain:
If TaxableGain = 0:
TaxOwing = 0
Else:
TaxOwing = TaxableGain × (tmarg / 100)
The marginal rate is user-supplied. The calculator does not compute it from brackets or credits; instead, it expects you to bring in your own
marginal rate from a full income tax calculation (for example, using the Canada Personal Income Tax Calculator).
5. After-Tax Proceeds
After-tax proceeds are simply proceeds minus the estimated tax owing:
AfterTaxProceeds = P − TaxOwing
When Gain ≤ 0 or PRE is enabled, TaxOwing = 0 and AfterTaxProceeds = P.
How This Fits with Your Full Tax Picture
In Canada, capital gains are added to your other income via the inclusion rate and are then taxed at the same marginal rates that apply
to your employment, business, and other income. This calculator mirrors that behavior in a compressed way:
- It converts your gain into a taxable gain using rincl.
- It treats tmarg as your combined marginal rate on that taxable gain.
- It multiplies the two to estimate the incremental tax attributable to the gain.
It does not model the rest of your return (credits, other deductions, loss carryforwards, alternative minimum tax, etc.).
Those effects are implicitly rolled into the marginal rate you provide.
Inputs, Parsing, and Edge Cases
-
All numeric inputs are parsed by stripping commas and whitespace; blank inputs are treated as 0. Invalid numbers fall back to 0 or the
documented default (e.g., 50% inclusion).
-
Proceeds and ACB are treated as whole-dollar CAD values; the calculator does not model transaction fees, commissions, or foreign exchange.
-
If A > P (a capital loss), the calculator shows a negative Gain but sets TaxableGain and TaxOwing both to 0. It does not model loss
carryovers or how losses offset gains in other parts of your return.
-
Inclusion rate and marginal rate are constrained conceptually between 0 and 100; extremely high or low values may produce unrealistic
outputs but are allowed for “what if” scenarios.
Implementation Notes
-
The core arithmetic lives in a pure engine function
CapitalGainsTaxCanada.calculate(), which accepts a simple inputs object and
returns the derived values and a mathSteps object with the exact numbers used.
-
The “Show the math” section on the calculator page reads
mathSteps and renders each step (Gain, TaxableGain, TaxOwing,
AfterTaxProceeds) directly from these values.
-
The separate “How capital gains use your marginal tax rate” card uses static bracket data to display current federal and provincial
marginal rates for reference only; it does not feed back into the core calculation above.
-
All calculations are performed with JavaScript’s standard floating‑point arithmetic; any rounding is applied only at the display layer.
If any discrepancy is identified between this documentation and the live calculator engine, the engine's arithmetic
(CapitalGainsTaxCanada.calculate()) is the source of truth. This page will be updated to match the engine.