# Aba routing validate

`aba-routing-validate` · version 1.0.0 · Identifiers & check digits · free, no key needed

Validate a 9-digit US ABA routing number's 3-7-1 weighted check digit and classify its 2-digit Federal Reserve prefix.

**Use when you need to: validate a us bank routing number · check an aba routing number's check digit · what federal reserve district is this routing number.**

## Decide before calling

Read the [versioned contract](/v1/tools/aba-routing-validate/versions/1.0.0) and the supported scope below. Reuse `aba-routing-validate@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `aba-routing-validate@1.0.0` for validate a us bank routing number. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- validate a us bank routing number
- check an aba routing number's check digit
- what federal reserve district is this routing number
- is this a thrift or electronic routing number
- verify a wire transfer routing number
- בדיקת מספר ניתוב בנק אמריקאי

## Not supported

- looking up the bank name for a routing number (no bank directory is pinned)
- account-number validation (routing numbers have no relation to the account number)
- IBAN or CLABE validation

## Behavior

- routing_number is taken exactly as given; no spaces or hyphens are stripped, no case folding.
- If routing_number.length is not 9, valid:false, reason:'wrong_length', prefix_type:null, federal_reserve_district:null, check_digit:null.
- If routing_number does not match ^[0-9]{9}$, valid:false, reason:'invalid_character', same fields null.
- Otherwise check_digit = routing_number[8], always populated from here on. prefix2 = routing_number[0:2] as an integer.
- Classification: 0 -> government (no district); 1-12 -> primary (district = prefix2); 21-32 -> thrift (district = prefix2-20); 61-72 -> electronic (district = prefix2-60); 80 -> traveler_cheque (no district); anything else is unassigned.
- If prefix2 is unassigned, valid:false, reason:'invalid_prefix', prefix_type:null, federal_reserve_district:null (check_digit still populated).
- Otherwise weighted checksum: the 9 digits multiplied by fixed positional weights [3,7,1,3,7,1,3,7,1], summed. If the sum mod 10 is not 0, valid:false, reason:"check_digit_mismatch". Otherwise valid:true, reason:null.

## Input

- `routing_number` (string, required): min length 1; max length 20

## Output

- `valid` (boolean, required)
- `reason` (one of null, "wrong_length", "invalid_character", "invalid_prefix", "check_digit_mismatch", required)
- `prefix_type` (one of null, "government", "primary", "thrift", "electronic", "traveler_cheque", required)
- `federal_reserve_district` (integer or null, required): min 1; max 12
- `check_digit` (string or null, required): pattern `^[0-9]$`

## Limits

- max routing number bytes: 20

## Example

Request input:

```json
{
  "routing_number": "021000021"
}
```

Response:

```json
{
  "result": {
    "valid": true,
    "reason": null,
    "prefix_type": "primary",
    "federal_reserve_district": 2,
    "check_digit": "1"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "aba-routing-validate",
  "version": "1.0.0",
  "input": {
    "routing_number": "021000021"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/aba-routing-validate/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"routing_number":"021000021"}'
```

The machine-readable contract is at [/v1/tools/aba-routing-validate/versions/1.0.0](/v1/tools/aba-routing-validate/versions/1.0.0).

### CLI

```sh
node cli.mjs run aba-routing-validate 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Iban validate](/tools/iban-validate): Validate an IBAN's country, registry length, BBAN structure and MOD 97-10 check digits, and parse its bank/branch code.
- [Imei validate](/tools/imei-validate): Validate a 15-digit IMEI's Luhn check digit or accept a 16-digit IMEISV, and split the TAC from the serial.
- [Isin validate](/tools/isin-validate): Validate a 12-character ISIN's ISO 6166 Luhn check digit and parse its country prefix, NSIN and NSIN scheme.
- [Npi validate](/tools/npi-validate): Validate a 10-digit US National Provider Identifier using the Luhn formula with the constant 80840 healthcare prefix.
- [Uk nhs number validate](/tools/uk-nhs-number-validate): Validate a 10-digit NHS number's modulus 11 check digit (NHS Data Dictionary); 11 minus remainder = 10 is never valid.
- [Upu s10 validate](/tools/upu-s10-validate): Validate a 13-char UPU S10 postal identifier's weighted mod-11 check digit, split service indicator and country.
