curatedapi
Browse the docs

Guides

Finance

Excel functions

Late payments

E-invoices

Accounting

Number checks

VAT and GST

Billing and pricing

Money and currencies

Dates and time

Math

Unit conversion

Everyday

Health

US bank routing number check API

Check the check digit and the first two digits of a US ABA routing number.

POST https://api.curatedapi.com/v1/calc/check/us-routing-number

Checks a nine-digit ABA routing transit number: the first two digits must be in a range the American Bankers Association uses, and the ninth digit must be the check digit the first eight give with the weights 3, 7, 1.

Formula

3·(d₁ + d₄ + d₇) + 7·(d₂ + d₅ + d₈) + (d₃ + d₆ + d₉) must be a multiple of 10
  • The number is checked by arithmetic alone. Nothing is looked up, so a valid result means the number is well formed, not that the account, company or security exists.

Inputs

Send numbers as strings to keep every digit. options sets precision and rounding (see numbers and rounding).

InputTypeDescription
number required string The nine-digit routing number. Spaces, dots, hyphens and slashes are ignored, and lower-case letters are read as upper case. At most 64 characters.

Result

Under result in the answer, next to exactness, precision, inputs, formula, references and warnings.

ResultTypeDescription
validbooleanWhether the routing number passes every check.
normalizedstringThe number as it was checked: separators removed, letters in upper case.
problemstringWhat is wrong, when valid is false: CHARACTERS: a character that cannot appear in this kind of number; LENGTH: the wrong number of characters; COUNTRY: an unknown or unsupported country code; FORMAT: the right length but the wrong structure; CHECK_DIGIT: the check digit or check characters do not match the rest of the number.
messagestringThe result in a sentence, naming the rule that failed.
prefix_meaningstringWhat the first two digits stand for.
check_digitstringThe ninth digit.
expected_check_digitstringThe check digit the first eight digits give.

Examples

A New York routing number

Requestcurl
curl https://api.curatedapi.com/v1/calc/check/us-routing-number \
  -H "Authorization: Bearer $CURATEDAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "number": "021000021"
  }'
200 OKResponse
{
  "calculator": "check/us-routing-number@1",
  "result": {
    "valid": true,
    "normalized": "021000021",
    "message": "A well-formed routing number (Federal Reserve district 2).",
    "prefix_meaning": "Federal Reserve district 2",
    "check_digit": "1",
    "expected_check_digit": "1"
  },
  "exactness": {},
  "precision": null,
  "inputs": {
    "number": "021000021"
  },
  "formula": "3·(d₁ + d₄ + d₇) + 7·(d₂ + d₅ + d₈) + (d₃ + d₆ + d₉) must be a multiple of 10",
  "references": [
    {
      "title": "American Bankers Association: ABA routing number",
      "url": "https://www.aba.com/about-us/routing-number"
    },
    {
      "title": "ABA routing transit number: check digit and number ranges",
      "url": "https://en.wikipedia.org/wiki/ABA_routing_transit_number"
    }
  ],
  "warnings": []
}

One digit wrong

Requestcurl
curl https://api.curatedapi.com/v1/calc/check/us-routing-number \
  -H "Authorization: Bearer $CURATEDAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "number": "021000022"
  }'
200 OKResponse
{
  "calculator": "check/us-routing-number@1",
  "result": {
    "valid": false,
    "normalized": "021000022",
    "problem": "CHECK_DIGIT",
    "message": "The last digit is 2, but the first eight digits give 1.",
    "prefix_meaning": "Federal Reserve district 2",
    "check_digit": "2",
    "expected_check_digit": "1"
  },
  "exactness": {},
  "precision": null,
  "inputs": {
    "number": "021000022"
  },
  "formula": "3·(d₁ + d₄ + d₇) + 7·(d₂ + d₅ + d₈) + (d₃ + d₆ + d₉) must be a multiple of 10",
  "references": [
    {
      "title": "American Bankers Association: ABA routing number",
      "url": "https://www.aba.com/about-us/routing-number"
    },
    {
      "title": "ABA routing transit number: check digit and number ranges",
      "url": "https://en.wikipedia.org/wiki/ABA_routing_transit_number"
    }
  ],
  "warnings": []
}

References

Results follow each calculator's documented rules and the sources listed. They are not financial, tax or legal advice. Check that the rules fit your case before you rely on a result. See the terms.

Errors share one format; see errors. Billing, retries and batches work the same for every endpoint.