← Back to Blog·

ABA Routing Number Validation: How the Check Digit Actually Works

NACHAACHABA Routing NumberError Fixes

A routing number that has nine digits is not necessarily valid. The NACHA generator checks both conditions: the value must be exactly nine digits after spaces and hyphens are removed, and its ninth digit must agree with the ABA check-digit calculation. A mismatch stops the file before any NACHA records are generated.

What the nine routing-number digits represent

An ABA routing number is a nine-digit identifier. Its first digits identify the Federal Reserve routing region and bank identifier; the ninth digit is the check digit. The implementation treats the number as a nine-digit string, not a number: this is important when the value begins with 0.

The exact check-digit formula used by the generator

For the first eight digits d1 through d8, the code calculates this weighted total:

weighted =
  3 * (d1 + d4 + d7) +
  7 * (d2 + d5 + d8) +
  1 * (d3 + d6)

check digit = (10 - (weighted mod 10)) mod 10

The resulting digit makes the full nine-digit weighted sum divisible by 10. The validator then compares that calculated value with the supplied ninth digit; it does not replace the supplied digit.

Worked example: 091000019

Using the first eight digits 09100001:

3 * (0 + 0 + 0) = 0
7 * (9 + 0 + 1) = 70
1 * (1 + 0)     = 1

weighted total  = 71
check digit     = (10 - (71 mod 10)) mod 10
                = (10 - 1) mod 10
                = 9

The supplied ninth digit is 9, so this value passes the implementation's check. Changing only the final digit to 8 fails with the expected digit in the error message.

Why one typo blocks the entire generation

The converter validates routing numbers in the row schema and validates them again while mapping rows for generation. If a value is empty, not exactly nine digits, or has a checksum mismatch, generation throws a NACHA Data Error naming the row and reason. It does not send a warning, create a partial file, or silently calculate a replacement check digit.

  • Missing value: reported as required.
  • Wrong length or non-digit character: reported as “must be exactly 9 digits.”
  • Wrong ninth digit: reported as an ABA check-digit failure with the expected final digit.

The same validation function also protects the file-level ODFI routing number in Company Settings. The generator rejects an invalid ODFI routing number before building the file.

Routing number versus account number validation

FieldImplemented checkNot implemented
Receiving routing numberRequired; spaces/hyphens removed; exactly 9 digits; ABA check digit must match.No fabricated routing number or check digit.
Receiving account numberRequired and limited to the 17-character Entry Detail field width before generation.No account-number checksum, bank-specific format check, or routing lookup.

That difference is intentional: the product has an audited ABA algorithm for routing numbers, but it does not claim to determine whether a receiving account number exists or belongs to the named receiver.

Excel preparation: preserve the leading zero

The common spreadsheet failure is a routing number such as 021000021 being imported as a number and losing its leading zero. Store the routing-number column as text before entering or importing data. If Excel removes the leading zero, the converter catches the resulting eight-digit value rather than padding it. It only ignores visual separators: spaces and hyphens are removed before the nine-digit and checksum checks run.

  1. Format the routing-number column as Text before pasting values.
  2. Keep the full nine digits, including a leading zero.
  3. Map routing number and account number to separate columns.
  4. Resolve the reported row-level validation error before regenerating; do not edit the fixed-width output manually.

Building a payroll batch?

Salary Mode helps prepare payroll data; validate routing numbers before generating the NACHA file.

Try Salary Mode

Ready to generate bank-compliant SEPA XML files?

Stop struggling with manual formatting. Generate compliant ISO 20022 XML files in seconds directly in your browser.

Start Converting Now (Free)