Generator · Canadian data
Canadian Business Number
Endpoint GET /v1/ca/business-number
What it covers
Returns a synthetic CRA Business Number: nine digits with a **Luhn checksum**, so unlike the US EIN it is genuinely verifiable. `programAccount` appends the CRA suffix for the fifteen-character form `123456789RC0001`. Mind the distinction: the BN identifies the **business**, while a program account identifies one of its dealings with the CRA — so `…RC0001` and `…RT0001` are the *same* company, and code treating all fifteen characters as the identity will double-count.
The Business Number is the CRA’s identifier for a business: nine digits protected by the Luhn (mod-10) checksum, so — unlike the US EIN, which has none — it is genuinely verifiable.
Optionally it carries a program account suffix: a two-letter program code plus a four-digit reference, giving the familiar fifteen-character form 123456789RC0001. The distinction matters when validating. The BN identifies the BUSINESS; the program account identifies which of its dealings with the CRA the number refers to. Common codes are RC (corporate income tax), RT (GST/HST), RP (payroll deductions), RM (import/export), RR (registered charity) and RZ (information returns).
How it’s calculated
The ninth digit is a Luhn (mod-10) check digit over the preceding eight; the optional program-account suffix is outside the checksum.
Algorithm
- Take the nine-digit Business Number, ignoring any program-account suffix.
- Read the digits from the right and double every second one (positions 2, 4, 6 and 8 from the left).
- If a doubled value exceeds 9, subtract 9 from it.
- Sum all nine resulting values.
- The number is valid when that sum is ≡ 0 (mod 10).
Worked example
123456782
d₁=1 kept → 1
d₂=2 doubled → 4
d₃=3 kept → 3
d₄=4 doubled → 8
d₅=5 kept → 5
d₆=6 doubled → 12, and 12 − 9 = 3
d₇=7 kept → 7
d₈=8 doubled → 16, and 16 − 9 = 7
d₉=2 kept → 2
sum = 1+4+3+8+5+3+7+7+2 = 40
40 mod 10 = 0 → validThe Luhn sum is 40, which clears mod 10, so 123456782 is a well-formed Business Number. Appending RT0001 gives 123456782RT0001 — the same business, viewed through its GST/HST account.
References
Edge cases
- One business holds ONE Business Number and may hold several program accounts on it — so 123456789RC0001 and 123456789RT0001 are the same company, filing corporate income tax and GST/HST respectively.
- The four-digit reference is 0001 for nearly every business; a value above it means a second account within the same program, which breaks code assuming one account per program.
Gotchas
- Code that treats all fifteen characters as the business identity will DOUBLE-COUNT companies that hold more than one program account. Match on the nine-digit Business Number, not the suffixed form — which is why this generator returns the bare BN by default.
- The checksum covers the nine digits only. The program code and reference are not part of the Luhn calculation.
Parameters
| Parameter | Type | Description |
|---|---|---|
| count | integer1–10000 | Number of records to return, 1–10000. Omitted returns a single record; set it for a batch. Costs 1 token plus a tenth per record. |
| edge | boolean | Restrict output to valid edge cases from the rare corners of the domain. |
| extreme | boolean | Return a correct value wrapped in a hostile encoding (untrimmed whitespace, invisible/zero-width characters, BOM, or bidi/combining marks). Homoglyphs are excluded so the value stays machine-parseable; it still validates after normalisation. |
| invalid | boolean | Return a deliberately invalid value that fails validation, for testing rejection paths. |
| programAccount | object | Append a CRA program account: `true` for a random one, or a specific code (RC corporate tax, RT GST/HST, RP payroll, RM import/export, RR charity, RZ returns). Omitted returns the bare nine-digit BN. |
| programReference | stringpattern ^\d{4}$ | The four-digit program reference, distinguishing accounts in one program. |
| seed | integer | Integer seed for reproducible output: the same seed always yields the same record. |
Response fields
| Field | Type | Description |
|---|---|---|
| value | string | The bare nine-digit BN, or the fifteen-character form when a program was asked for. |
| businessNumber | string | The nine-digit BN alone, always without a suffix. |
| checkDigit | string | The ninth digit, which satisfies the Luhn checksum. |
| programCode | string | The two-letter CRA program code, or null for the bare BN. |
| programDescription | string | What the program covers, e.g. `GST/HST`. Null for the bare BN. |
| programReference | string | The four-digit account reference within the program. Null for the bare BN. |
Other generators for Canada
The same kind of identifier elsewhere
Try it