48

I have been tasked to "verify" the length of a U.S. Banking Institution ACCOUNT NUMBER for a web app I'm developing. I cannot find anything through SOF, Google, Fed reserve etc that outlines an account number standard length that we have in the United States. For the record I believe this is futile.

If someone could point me to any official documentation on the web, or has an example regular expression, or knows if there is a standard that exists, I would appreciate it greatly.

ADDED:

What would interest me even more since the response is overwhelming that their is no standard....has anyone ever run into a bank account number that is not completely "numeric"\

ADDED:

Thanks to everyone and their responses. Due to having no standard in the US, we are not going to enforce a length check, and we are going to store the number as a varchar due to the fact that it may be possible that a bank may assign alpha characters in their account numbers. Seems 99.999999% unrealistic in our view, but no standard means we will accept alpha characters and run the check on the account number to verify if it works or not. Thanks again all!

3
  • I checked a few credit cards + online direct deposit registration. All seem to allow a max of 17 characters. I didn't actually submit anything to see what would fail on the server side, but there was a 17 character limit.
    – NerdFury
    Commented Oct 8, 2009 at 20:52
  • If you check Pascal's answer, you'll see that IBANs use letters and numbers.
    – T.E.D.
    Commented Oct 8, 2009 at 21:15
  • 1
    Another reason to store it as a string and not a numeric is that it's an identifier - not a quantity, and account numbers have no numeric relationship to each other. (storage space considerations notwithstanding) Commented Jun 11, 2015 at 20:54

8 Answers 8

40

There is no standard for US banks' account numbers.

IBAN is not used in the US.

There is a limit for ACH transactions (4-17 digits), but not all transactions have to be ACH.

And yes, the US banking system is antiquated.

I'm looking at a DW (Data Warehouse) of 38 different systems at a bank and the length of account varies widely depending on the product. Several of the systems have alphabetic characters in the account numbers. This is probably irrelevant since they are special types of customer accounts like brokerage accounts and other things which aren't accessible through ACH - you need to specify what kind of account you're interested in. If you restrict yourself to accounts which you can get to through ACH, you can simply restrict to numeric digits.

You can get a lot more information about ACH at: http://www.nacha.org/

4
  • 1
    +1 This is correct. I've personally seen bank account numbers as low as account # 12, so I'm assuming banks are free to start at 1 and go up from there. I'd say a regex just to ensure it is a whole number should work. ^/d{?}$ Or limit it based on the size of the database field you're using as in ^/d{1,15}
    – David
    Commented Oct 8, 2009 at 20:48
  • It's amazing that yet another international standard (IBAN) is just being totally ignored in the US ..... makes sending money from Europe to the US just such a hassle.....
    – marc_s
    Commented Oct 9, 2009 at 5:23
  • Thank you for this! I'm writing some ACH generation right now and finding specs on this stuff can be a real pain. I know this is super old but have an upvote and a thanks!
    – Giovanni B
    Commented Jul 27, 2012 at 14:46
  • There are definitely some credit union accounts that have non-numeric chars, so I would be wary of doing that sort of validation. Commented Jul 16, 2018 at 16:10
10

Good luck with that, because you can't.

Banks are free to use just about anything as an account number. I think the only validation you can do is whether or not they're numeric (as they all are).

The most common length for bank account numbers is 9, 12, or 10 digits. Although they range from 4 to 17 digits long. I have a large database of valid numbers and there's no pattern that I can see to the "account number".

A "routing number" defines the bank (pretty much) but even within a particular routing number, the account numbers can be of different lengths.

This is why payroll services often require an extra day (or two) before initiating Direct Deposit in order to "prenote" the account (validate it by performing a no-op ACH transaction) because you really can't verify it otherwise.

4
  • Ah ok, i added this to my post. It would be ok to assume it has to be completely "numeric" you are saying? Commented Oct 8, 2009 at 21:01
  • 2
    Every one I've ever seen is numeric, and I've seen them for a few thousand banks. Normally they're printed on the check in MICR which is numeric only (and a few symbols) so I think this is a safe assumption. Of course, this doesn't mean that some bank somewhere isn't using smileys and dingbats as account identifiers. :) Commented Oct 8, 2009 at 22:56
  • 1
    Agreed. I have never personally seen an non numeric character in an account number, but I cant design this system assuming that all account numbers are numeric. No standards are fun! Commented Oct 9, 2009 at 11:32
  • Kinda like an email address? :-)
    – Greg Bacon
    Commented Jan 22, 2010 at 18:58
6

You can validate the routing number (or ABA) by downloading the DB (fixed field width text format) from the federal reserve bank. The data is here: https://www.frbservices.org/EPaymentsDirectory/fpddir.txt and the layout describing the data is here: https://www.frbservices.org/EPaymentsDirectory/fedwireFormat.html

There are companies (lyonslive.com) that offer a webservice to validate account numbers but they charge per validation (volume based pricing starting @ 60 cents per check - if volume is high enough it can be as low as 24 cents).

3
  • 3
    The links are dead now... :-(
    – J. Bruni
    Commented Jul 24, 2015 at 14:52
  • These are routing numbers, not account numbers. It says right in the file format that they are all 9 digits.
    – Noumenon
    Commented Feb 9, 2017 at 21:19
  • Great find, link is still good as of 12/15/2017 but they will retire public downloads in Q4 2018 and instead you need to sign up for email updates.
    – drew010
    Commented Dec 15, 2017 at 21:32
4

In Addition to the other great answers here, i think its helpful to know that routing numbers in the United States include a checksum digit which can be helpful for quick validation that the user typed it in correctly

http://www.brainjar.com/js/validation/

basically all US routing numbers should pass the following test:

3 * (digits[0] + digits[3] + digits[6]) +
7 * (digits[1] + digits[4] + digits[7]) +
(digits[2] + digits[5] + digits[8]) % 10 === 0
3

Don't you mean International Bank Account Number? If yes, this is a regex for IBAN (all IBANs):

[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{4}[0-9]{7}([a-zA-Z0-9]?){0,16}

UPDATE: Actually, according to Wikipedia: Banks in the United States do not provide IBAN format account numbers. Any adoption of the IBAN standard by U.S. banks would likely be initiated by ANSI ASC X9, the U.S. financial services standards development organization but to date it has not done so. Hence payments to U.S. bank accounts from outside the U.S. are prone to errors of routing.

2

Very interesting. It seems like all routing/transit numbers are 9 digits.

I just checked American Express's online bill pay, for bank accounts they limit their field to 15 numerics. Chase limits theirs to 17. I would probably continue checking and maybe start to call a few banks to find out what their specifications are. It doesn't seem like there is a standard.

Another potential way to determine the length would be to ask the company that performs the transaction. Where does the account number get used? They should have specifications on what they will accept.

1
  • It alsoseems to be 17 on federal tax forms and those of the state of California.
    – Tommy
    Commented Jan 30, 2013 at 7:00
1

I don't think there is a standard - different institutions seem to use different lengths of account number. There probably is an upper limit - it is unlikely to be less than 20.

0
1

There is no standard for a bank account number in the US. There is a standard for the routing number, because that's shared between banks; the account number, however, is only of use internally by the bank itself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.