A Tag consists of 'Key' and a 'Value'. Each tag describes a specific feature of a data element (nodes, ways and relations) or changesets. Both the key and value are free format text fields. In practice, however, there are agreed conventions of how tags are used for most common purposes.
Keys and values
Each tag has only a key and value. Tags are written in OSM documentation as
- The key describes a broad class of features (for example, highways or names).
- The value details the specific feature that was generally classified by the key (e.g. highway=motorway). If multiple values would be needed for one key the semi-colon value separator may be used in some situations.
Here are a few examples of how keys and values are used in practice:
- highway=residential a tag with a key of 'highway' and a value of 'residential' which should be used on a way to indicate a road along which people live.
- name=* a tag for which the value field is used to convey the name of the particular street
- maxspeed=* a tag whose value is a numeric speed in km/h (or in miles per hour if the suffix 'mph' is provided). Metric units are the default (and do not need to be mentioned explicitly). Other units, such as miles per hour, knots, yard or pounds must be stated after the value. Where a regulation is specified in a particular unit then that unit should be used within the value field.
- maxspeed:winter=* a key that includes a namespace for 'maxspeed' identifies a different value for maxspeed that applies only in winter.
- name:de:1953-1990="Ernst-Thälmann-Straße" name key with suffixed namespaces to specify the German name of a street which was valid from 1953 to 1990,
Finding your tag
The following resources are often used to find an appropriate tag or explore tag usage:
- Map Features – an extensive list of the the most commonly used tags. Or the different alphabetic real-world objects list approach at how to map a.
- Taginfo – an site to explore current tag usage in the OSM database, including tag values that are not necessarily documented (but it includes links to this wiki if there is a documentation for a tag)
- Search this wiki or browse its category "tags"
- Look how a similar object at another place is mapped (if you know where it might also exist)
- Read any tags you like
- Search the tagging mailinglist archive or questions about "tagging" at the help site or forum.openstreetmap.org. Of course you also could ask at all three sites (but please only one at a time).
- OSM Semantic Network – a machine-readable structure containing the OSM tags
Use in an editor
Some OSM editors (for example iD, Potlatch 2) hide the tags of objects by default, making them not directly editable; instead users fill-in a form. However, likely all tags can be displayed and edited by entering an "advanced" mode of your editor. For the example editors this feature is named "All tags" (bottom left), in iD, respectively "Advanced", in Potlatch 2.