|A telephone number associated with the object.|
|Used on these elements|
|Status: In use|
|Tools for this tag|
A telephone number associated with a POI. See also contact:phone=* for an alternative way of tagging phone numbers.
Sometimes it is useful to associate a phone number with an object, especially for business, leisure or amenities. A shop, a museum or a pub for example. The object can be on a node or a area. Clearly phone is always an additional descriptive tag to be added alongside other more important tags which denote what the object actually is.
phone=* is widely used and accepted by many mappers but verify that you are not violating data privacy laws in your country (especially for private phone numbers).
- phone=number where the number should be in international (ITU-T E.164) format
If your country does not use area codes, that part should be left out.
fax=number may be used in the same way.
Some countries have very well established national standards on how telephone numbers are written (e.g. xxx-xxx-xxxx in the US) which leads to mappers in those countries preferring that format over the aforementioned standards (but even in this case, the "+1-xxx-xxx-xxxx" format for the NANP standard should be explicit, to indicate that this phone number is callable internationally: OSM user agents should not have to guess how to perform a call according to geographic locations, or according to the value of the first 3-digit group).
Note that for phone numbers that are in international E.164 format, space (or even hyphen) separators are not significant, but the convention is to use a separator at least between the ITU-T country code and the rest of the phone number. The other groupings are optional: area codes should preferably be separated only in countries where they are still used distinctly for domestic calls; in other countries, the groupings are just kept by convenience and according to local usages in phone books or as shown in amenities (these groupings may vary for mnemonic reasons only, there's no requirement to suppress these group separators even if they are ignored when dialing).
This is true also when the phone number has additional digits for target selection (e.g. in Germany where there's a common public part, with variable size, followed by an internal short number which may be locally dialed directly without using any trunk selection code before composing the national number). For the purpose of OSM, we should assume calls are being performed from a public network and not from a private internal network, and the full number should work even when dialing this full number with the trunk selection code from a local network where the short number should also work.
The same remark about separators applies for phone numbers that are not in E.164 format (because they are not usable internationally and can be dialed only domestically, either nationwide, or only from a more specific network).
How to map
Just add the phone=number tag to any map object that has a phone, following the format described above.
The illustration shown in the top-right is a shop in the UK (code 44), in London (area 20), so could be tagged with phone=+44 20 8452 7891.
Italy does not omit the 0 in the international format like many countries do (the "0" default trunk prefix may be replaced by a "trunk selection code" in calls from within the country, but only for phone numbers that have this selection feature enabled: not all national phone numbers have a trunk selection code, and some ranges of "short" numbers, not starting with the default "0" trunk code, may also be called internationally; so this default "0" trunk code must still be used when calling from abroad). So the Milan number 02.724261 becomes phone=+39 02 724261 in OSM. A few other countries are doing the same and require dialing the national trunk selection code when calling them from abroad.
Phone numbers of telephone boxes
Even phone boxes have telephone numbers. Don't be confused. Telephone boxes must always be tagged with amenity=telephone to describe what the object is. You can add the phone=* tag to supply the extra detail of its telephone number (depending on how diligent you feel like being).
phone=+49 4721 28695 for a public phone box on the German island Neuwerk.
Parsing phone numbers
Clearly it will be dangerous to assume that mappers have followed the above format correctly. Code using this tag might defensively reject or attempt to correct possible formatting errors. Specific things to note:
- When dialling the
'-'-signs have to be omitted (mobile phones accept this character in their contact list, but ignore it when performing calls). The same is true for separating spaces or dots.
- If the
'+'-sign is not supported by the device, it has to be replaced by the local international call prefix; e.g., 00 in most countries, or 011 in US. The dialing device may have to be configured accordingly (this is normally not needed for mobile phone devices that automatically recognize the rules used by the local mobile operator and preconfigured in its SIM card or in the phone firmware).
Support for multiple countries
|This hasn't been voted and is just a documentation of use|
Some amenities provide a different phone number for different countries (mostly seen when the amenity is on a country boundary, or is an international company).
One of the possible ways to solve this is by adding the ISO 3166-1 code at the end of the key. For example (all phone numbers below are invented only for documenting this page):
- phone=+32 57 536245 for the country where the amenity is,
- phone:BE=+32 57 536245 and phone:FR=+33 6 12654478 for different national phone numbers. Note that when using country codes, the convention is to make it uppercase, so it is not confused with a language code (but some mappers use lowercase instead).
Also some amenities have a local phone number which can only be used domestically not cannot be called internationally (notably for toll free phone numbers, or abbreviated phone numbers). For international calls, they publish another phone number. For example:
- phone:FR=0 800 123 456 for standard toll free call only from France where the amenity is (note that there's NO "+" sign, it is NOT in international format),
- phone=+33 1 23 45 67 89 when calling from any other country (note that it is not always possible to use it for domestic calls, or the toll free rate will not apply: users have to use the national number instead, they will most often be instructed by an automated vocal system: the most selective applicable key should be used; this means that OSM user agents should present the list of possible phone numbers, with their restrictions encoded in the subkey, to allow users to select which phone number to call, even if these agents preselect an applicable one).
Some phone numbers can also be called toll free (or with reduced rates) only when calling from a specific operator (such as customer services of that operator). When calling from another network, another national phone number or a standard geographic phone number must be used. For example, this could be tagged like this:
- phone:FR:mobile:SFR=3000 for standard toll free call only from the SFR mobile network (operator in France), sometimes even when calling from abroad with roaming access (provided you use the same SIM card of that operator); note that there's also no "+" sign for this short number (this phone number is not valid internationally). (adjust the "FR:mobile:SFR" subkey of the tag according to the conventions used in that country).
- phone:FR=0 810 123 456 for calls with flat rates from other networks only in France (still no "+" sign).
- phone=+33 1 23 45 67 89 when calling from any other country or network (international toll rates apply according to the pricing plan of the originating operator).
Applications / Web services that display or dial the number from OSM
- Offmaps (iPhone): Displays and dials the phone number in the app's downloadable City Guides.
- OsmAnd: Displays and dials the phone number of all types of indexed POI.
- OSM Query: Displays phone numbers as 'callto' links that work with Skype for example.
- Maps.Me: Displays and dials the phone number of all types of indexed POI.
- Key:contact - an alternative way of tagging phone number and other contact information which some mappers prefer
- Proposed features/Phone - A proposal for this tag, which has been rejected
- List of country calling codes on Wikipedia
- Prefix code on Wikipedia
- Tag:amenity=telephone public telephone, phone box