What are they?

Language tags are a way to tag digital resources to indicate in what human language they are. They are also used by software to tell an user's preference about languages.

They can express the language itself but also the writing system, the national variant and many other things.

A few examples of language tags:

They are specified in IETF RFC 5646 (available online).

Language tags are made of subtags separated by hyphens. The list of possible subtags is mostly directly copied from various ISO standards such as ISO 639.

They are used in many formats and protocols for instance in XML (through the xml:lang attribute) and in HTTP (the browser can indicate to the Web server what language the user prefers, should the Web server have several versions).