Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the minimum length of a valid international phone number?

Tags:

validation

People also ask

How many digits is an international number?

E. 164 permits a maximum length of 15 digits for the complete international phone number consisting of the country code, the national routing code (area code), and the subscriber number.

What is the length of phone number?

The total length of the Subscriber Trunk Dialing code and the phone number is 10 digits. The Subscriber Trunk Dialing code can be from 2 digits (11 or 011) up to 4 digits long. Mobiles: Written as AAAAA-BBBBB for ease of remembering (though the prefix is either 2-digits or 4-digits in the numbering plan).

How many digits should a US phone number have?

Phone numbers in the United States typically consist of 11 digits — the 1-digit country code, a 3-digit area code and a 7-digit telephone number.

What is a valid phone number format us?

Since the U.S. and Canada both use the North American Numbering Plan, the commonly accepted formatting of phone numbers is (NPA) NXX-XXXX, NPA-NXX-XXXX or 1-NPA-NXX-XXXX, where 'NPA' is the area code, 'NXX' is the central office code and 'XXXX' is the remaining subscriber number personal to each phone number.


As per different sources, I think the minimum length in E-164 format depends on country to country. For eg:

  • For Israel: The minimum phone number length (excluding the country code) is 8 digits. - Official Source (Country Code 972)
  • For Sweden : The minimum number length (excluding the country code) is 7 digits. - Official Source‎ (country code 46)

  • For Solomon Islands its 5 for fixed line phones. - Source (country code 677)

... and so on. So including country code, the minimum length is 9 digits for Sweden and 11 for Israel and 8 for Solomon Islands.

Edit (Clean Solution): Actually, Instead of validating an international phone number by having different checks like length etc, you can use the Google's libphonenumber library. It can validate a phone number in E164 format directly. It will take into account everything and you don't even need to give the country if the number is in valid E164 format. Its pretty good! Taking an example:

String phoneNumberE164Format = "+14167129018"
PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
try {
    PhoneNumber phoneNumberProto = phoneUtil.parse(phoneNumberE164Format, null);
    boolean isValid = phoneUtil.isValidNumber(phoneNumberProto); // returns true if valid
    if (isValid) {
        // Actions to perform if the number is valid
    } else {
        // Do necessary actions if its not valid 
    }
} catch (NumberParseException e) {
    System.err.println("NumberParseException was thrown: " + e.toString());
}

If you know the country for which you are validating the numbers, you don;t even need the E164 format and can specify the country in .parse function instead of passing null.


The minimum length is 4 for Saint Helena (Format: +290 XXXX) and Niue (Format: +683 XXXX).


EDIT 2015-06-27: Minimum is actually 8, including country code. My bad.

Original post

The minimum phone number that I use is 10 digits. International users should always be putting their country code, and as far as I know there are no countries with fewer than ten digits if you count country code.

More info here: https://en.wikipedia.org/wiki/Telephone_numbering_plan