npm package: @seethruhead/cra-payroll
Description: Calculate Canadian payroll deductions using CRA's Payroll Deductions Online Calculator
Latest version: 0.8.4

# @seethruhead/cra-payroll

Calculate Canadian payroll deductions using CRA's [Payroll Deductions Online Calculator (PDOC)](https://apps.cra-arc.gc.ca/ebci/rhpd/beta/entry).

Automates the CRA wizard via Puppeteer and returns your net pay, taxes, CPP, EI, and RRSP breakdown — per paycheck, monthly, or annually.

> **Requires Google Chrome** — uses your system Chrome, no extra browser install needed.

## Install

```bash
npm install -g @seethruhead/cra-payroll
```

## Usage

```bash
# Interactive — prompts for missing values
cra-payroll

# CLI args
cra-payroll --salary 120000 --province "British Columbia"

# Per-paycheck table for the year (tracks CPP/EI maxout)
cra-payroll --salary 150000 --table

# Annual totals
cra-payroll --salary 100000 --annual

# Monthly averages
cra-payroll --salary 100000 --monthly

# Combine them
cra-payroll --salary 150000 --table --annual --monthly
```

### Example output (`--table`)

```
Per-Paycheck Table (2026)
══════════════════════════════════════════════════════════════════════════════════════════════
  #  │     Gross │   Fed Tax │  Prov Tax │       CPP │        EI │   Net Pay │ Cum CPP/EI
──────────────────────────────────────────────────────────────────────────────────────────────
  1  │  6,250.00 │  1,028.37 │    612.45 │    382.51 │    102.08 │  4,124.59 │    484.59
  2  │  6,250.00 │  1,028.37 │    612.45 │    382.51 │    102.08 │  4,124.59 │    969.18
 ... │       ... │       ... │       ... │       ... │       ... │       ... │       ...
 11  │  6,250.00 │  1,028.37 │    612.45 │    112.50 │     19.37 │  4,477.31 │  5,353.52 ← partial
 12  │  6,250.00 │  1,028.37 │    612.45 │      0.00 │      0.00 │  4,609.18 │  5,353.52 ✓ maxed
 ... │       ... │       ... │       ... │       ... │       ... │       ... │       ...
```

## Config

Create `~/.config/cra-payroll.json`:

```json
{
  "province": "Ontario",
  "annualSalary": 100000,
  "payPeriod": "Semi-monthly (24 pay periods a year)",
  "year": 2026,
  "rrspEmployeePercent": 4,
  "rrspEmployerPercent": 4
}
```

CLI args override config file values. Missing values are prompted interactively.

### Options

| Option | CLI flag | Config key | Default |
|--------|----------|------------|---------|
| Province | `-p`, `--province` | `province` | `Ontario` |
| Annual salary | `-s`, `--salary` | `annualSalary` | _(prompted)_ |
| Tax year | `-y`, `--year` | `year` | current year |
| Pay period | `--pay-period` | `payPeriod` | `Semi-monthly (24)` |
| Employee RRSP % | `--rrsp-employee` | `rrspEmployeePercent` | `4` |
| Employer RRSP % | `--rrsp-employer` | `rrspEmployerPercent` | `4` |
| CPP maxed | `--cpp-maxed` | `cppMaxedOut` | `false` |
| EI maxed | `--ei-maxed` | `eiMaxedOut` | `false` |
| Yearly table | `-t`, `--table` | — | `false` |
| Annual totals | `-a`, `--annual` | — | `false` |
| Monthly averages | `-m`, `--monthly` | — | `false` |
| Verbose | `-v`, `--verbose` | — | `false` |
| Headless | `--headless` | — | `false` |
| Config path | `-c`, `--config` | — | — |

## How it works

1. Launches your system Chrome via Puppeteer (headed by default — CRA blocks headless)
2. Fills out the PDOC wizard: province, pay period, salary, RRSP contributions
3. Sets CPP/EI status and hits Calculate
4. Scrapes the results page for taxes, deductions, and net pay
5. For `--table` mode: runs twice (with/without CPP/EI) and simulates each paycheck using the annual maximums

## Standalone binary

If you prefer a standalone binary without Node.js, see the [GitHub releases](https://github.com/SeeThruHead/cra-payroll/releases).

## License

MIT