Programmers misconceptions about telephone numbers

Original author: David Yonge-Mallo, Google
  • Transfer
The list was compiled by developers of Java, C ++ and JavaScript libphonenumber libraries for parsing, formatting and checking telephone numbers.

Telephone numbers have been used universally and for quite some time. Therefore, it is very surprising how many misconceptions remain with programmers regarding them.

1. Phone numbers that are valid now will always be valid. Telephone numbers of a certain type (for example, mobile) will never change type .

A phone number connected today can be disconnected tomorrow. Toll-free number today may be paid tomorrow. The service provider can expand the range of available numbers by adding an additional digit and increasing the length of the number.

hint. Do not save phone number properties such as validity or type. Check this information with the library when necessary.

2. The phone number uniquely identifies the person .

Not so long ago, when mobile phones did not exist, it was considered quite normal to have one home telephone for the whole family. In some parts of the world, this is still the case when relatives (or even friends) use a common telephone number.

3. A person has only one phone number .

Obviously, this is not always the case.

4. Phone numbers cannot be reused .

Old numbers are reintroduced and distributed to other people.

5.Each country code corresponds to exactly one country .

The United States, Canada, and several Caribbean islands have the same +1 code. Russia and Kazakhstan share the code +7. And these are not the only examples!

6. Each country has only one code .

At the moment (March 2016), phones in the disputed and not universally recognized territory of Kosovo can be reached through the national codes of Serbia (+381), Slovenia (+386) or Monaco (+377), depending on where and when the number was issued.

Hint . Use the phone widget to encourage users to enter a phone number in an international format.

7. A phone number can be dialed from anywhere .

Some numbers can only be dialed domestically. Some are dialed from a certain group of countries, for example, as international numbers 00800. Some are dialed only if the subscriber is served by a particular telecom operator.

8. There are only two ways to dial: internationally or locally .

Some numbers require different prefixes, depending on where the number is being dialed; from which device and to which device you are calling; Whether you are inside or outside a specific geographic region.


  • In Brazil, for domestic calls within certain geographic boundaries, you must explicitly specify the code of the operator through whom you want to call.
  • In Nepal, the prefix "0" is omitted, depending on whether you are calling from a mobile or landline phone.
  • In New Zealand you need to dial the region code (for example, 03), even if the number is in the same region as you, except for the “close” number (usually the city / district border), for which the region code cannot be dialed.

Hint . Use formatForMobileDialling to get the specific number that the user must dial from their mobile phone.

9. To make the number available for dialing, just change the prefix .

In Argentina, for internal calls, you must insert the numbers "15" after the area code, but before the local number, and the number "9" after the country code (54) must be deleted. So the international number +54 9 2982 123456 turns into a local number 02982 15 123456.

10. Not a single prefix of a real phone number can be a real phone number .

In some countries, it is possible to get to another subscriber by dialing additional numbers after the telephone number. So, number 12345678 can belong to one person, and number 123456 - to another.

11. It is not possible to reach the wrong number .

In some countries or on some devices, excess numbers are discarded. For example, 1-800-MICROSOFT is the wrong number, but it will still connect to Microsoft, because extra numbers are discarded. You can also call numbers like 911 in some countries by dialing 911123, but not in all countries.

In other countries, the operator “corrects” the wrong number, for example, adding a mobile code if he knows that it is a mobile number.

12.All valid telephone numbers comply with ITU specifications .

ITU specifications contain standards like this: “National numbers cannot be more than 16 digits”, but in Germany they gave out valid telephone numbers longer than this.

13. All valid phone numbers belong to a country .

There are many “national codes” that were issued to organizations without a geographic reference, such as “800” or satellite services.

14. The phone number contains only numbers .

In Israel, some ad numbers begin with "*".

15. Phone numbers are always written in ASCII .

In Egypt, telephone numbers are usually recorded in local numbers.

See also
Errors of programmers regarding time.
Errors of programmers about names.

Also popular now: