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

  1. Take the nine-digit Business Number, ignoring any program-account suffix.
  2. Read the digits from the right and double every second one (positions 2, 4, 6 and 8 from the left).
  3. If a doubled value exceeds 9, subtract 9 from it.
  4. Sum all nine resulting values.
  5. 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 → valid

The 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.

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

ParameterTypeDescription
countinteger1–10000Number of records to return, 1–10000. Omitted returns a single record; set it for a batch. Costs 1 token plus a tenth per record.
edgebooleanRestrict output to valid edge cases from the rare corners of the domain.
extremebooleanReturn 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.
invalidbooleanReturn a deliberately invalid value that fails validation, for testing rejection paths.
programAccountobjectAppend 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.
programReferencestringpattern ^\d{4}$The four-digit program reference, distinguishing accounts in one program.
seedintegerInteger seed for reproducible output: the same seed always yields the same record.

Response fields

FieldTypeDescription
valuestringThe bare nine-digit BN, or the fifteen-character form when a program was asked for.
businessNumberstringThe nine-digit BN alone, always without a suffix.
checkDigitstringThe ninth digit, which satisfies the Luhn checksum.
programCodestringThe two-letter CRA program code, or null for the bare BN.
programDescriptionstringWhat the program covers, e.g. `GST/HST`. Null for the bare BN.
programReferencestringThe four-digit account reference within the program. Null for the bare BN.

Other generators for Canada

See all generators for Canada →

The same kind of identifier elsewhere

Try it

Generate a live example below — every response is valid by format and entirely synthetic.