Generator · US data
US ABA routing transit number
Endpoint GET /v1/us/routing-number
What it covers
Returns a US ABA routing transit number — the nine-digit code identifying the financial institution on a cheque, ACH transfer, or wire. Unlike the SSN and EIN it carries a **real checksum**: the ninth digit makes the `3-7-1` weighted sum of all nine digits congruent to zero mod 10. The first two digits identify the Federal Reserve district (`01`–`12`), thrift (`21`–`32`), electronic (`61`–`72`), or traveler’s cheques (`80`). Set `realBank=true` (or pin `bankName`) to draw a genuine published number from the bundled registry — routing numbers are public information. `invalid=true` breaks the checksum or uses an unallocated prefix.
An ABA routing transit number is the nine-digit code identifying a financial institution on a cheque, ACH transfer, or wire. Unlike the SSN and EIN — which carry no checksum at all — it is genuinely verifiable: the ninth digit makes a weighted sum of all nine digits congruent to zero modulo 10. The standard is administered by Accuity as the ABA’s registrar.
The first two digits are meaningful too. They identify the Federal Reserve district serving the institution, through four allocated bands: 01–12 are the primary Federal Reserve routing symbols (district = the prefix itself), 21–32 are thrift institutions (district = prefix − 20), 61–72 are electronic-only transactions (district = prefix − 60), and 80 is traveler’s cheques, which belong to no district. Every other two-digit value is unallocated.
How it’s calculated
The ninth digit makes the 3-7-1-3-7-1-3-7-1 weighted sum of all nine digits congruent to 0 modulo 10.
Algorithm
- Take all nine digits d₁…d₉.
- Multiply them by the repeating weights 3, 7, 1, 3, 7, 1, 3, 7, 1 respectively.
- Sum the nine products.
- The number is valid when that sum is ≡ 0 (mod 10).
- To derive the check digit from the first eight: because d₉ carries weight 1, it solves directly as d₉ = (10 − (Σ₁..₈ wᵢ·dᵢ mod 10)) mod 10 — no search, no lookup table.
Worked example
021000021 (JPMorgan Chase, New York — a real, published number)
0×3 = 0
2×7 = 14
1×1 = 1
0×3 = 0
0×7 = 0
0×1 = 0
0×3 = 0
2×7 = 14
1×1 = 1
sum = 0+14+1+0+0+0+0+14+1 = 30
30 mod 10 = 0 → valid
Deriving instead from the first eight: their weighted sum is 29, so d₉ = (10 − (29 mod 10)) mod 10 = (10 − 9) mod 10 = 1 — which is the actual ninth digit.The weighted sum is 30, which clears mod 10, so 021000021 validates. Its prefix 02 is a primary Federal Reserve routing symbol, placing it in the 2nd district — New York.
Edge cases
- Prefix 80 (traveler’s cheques) belongs to no Federal Reserve district, so `federalReserveCity` is absent for it — a real routing point that a “must map to a district” assumption breaks on.
- The thrift (21–32) and electronic (61–72) bands are rejected outright by a naive “must be 01–12” check, even though both are entirely valid.
- With `realBank: true` the number is drawn from a registry of genuine published institutional routing numbers, so it survives a lookup against a real routing directory.
Gotchas
- The checksum runs over ALL NINE digits, with the check digit carrying its own weight of 1 — it is not a sum over eight digits with a ninth appended. Implementations that weight only the first eight and compare will reject every real routing number.
- A correct checksum is not sufficient: a number whose prefix falls outside the allocated bands is rejected by a real directory even though the arithmetic clears. That is why `isValidRoutingNumber` checks both, and `hasValidRoutingChecksum` is exported separately for the arithmetic alone.
Parameters
| Parameter | Type | Description |
|---|---|---|
| bankName | string | Pin the institution by name, e.g. `Wells Fargo Bank`. Implies `realBank`. |
| 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. |
| prefix | stringpattern ^\d{2}$ | Pin the two-digit Federal Reserve prefix (01-12, 21-32, 61-72, or 80). |
| realBank | boolean | Draw a real, published routing number from the bundled registry of US institutions. |
| seed | integer | Integer seed for reproducible output: the same seed always yields the same record. |
Response fields
| Field | Type | Description |
|---|---|---|
| value | string | The nine-digit routing number. |
| digits | string | The canonical nine digits (clean even when `extreme`). |
| prefix | string | The two-digit Federal Reserve prefix. |
| checkDigit | string | The ninth digit, which satisfies the ABA 3-7-1 checksum. |
| federalReserveCity? | string | The Federal Reserve district city, absent for the traveler’s-cheque prefix `80`. |
| bankName? | string | The institution, when drawn from the real-bank registry; absent when synthetic. |
Other generators for United States
The same kind of identifier elsewhere
Try it