BCP 47 Language Tags Explained – Examples & How They Work

BCP 47 Language Tags Explained – Examples & How They Work

A BCP 47 language tag is a standardised way of identifying languages, scripts and regional variants, using codes such as en-AU, fr-CA or zh-Hans. These tags are used across websites, apps and APIs to tell software which language (and sometimes which country or script) a piece of content is written in. This guide explains how BCP 47 works, how tags are structured, and where to find official technical references.

BCP 47 language tags are defined in an IETF Best Current Practice document and combine information from several standards, including ISO language codes (ISO 639), country codes (ISO 3166) and other registered subtags.


BCP 47 in Simple Terms

In simple terms, a BCP 47 language tag is a structured code like en-US or es-MX that tells software:

  • What language is being used (for example English, Spanish, Japanese)
  • Optionally, what region or country variant (for example US English vs UK English)
  • Optionally, what script is used (for languages with multiple writing systems)
  • Optionally, extra variants or extensions for special cases

These tags help browsers, apps and services choose the most appropriate content, spelling, formatting and fonts for users around the world.


Basic Structure of a BCP 47 Language Tag

A BCP 47 tag is made up of subtags separated by hyphens. A common pattern looks like this:

<language>-<script>-<region>-<variants>

In everyday use, most tags only include the first one or two parts:

  • Language subtag – usually a two-letter ISO 639-1 code (e.g. en, fr, de)
  • Region subtag – usually a two-letter ISO 3166-1 alpha-2 country code (e.g. AU, US, GB)

Examples of simple and common tags:

  • en – English (no region specified)
  • en-AU – English as used in Australia
  • en-GB – English as used in the United Kingdom
  • fr-CA – French as used in Canada
  • es-MX – Spanish as used in Mexico

Examples including scripts and more detail:

  • zh-Hans – Chinese written in Simplified script
  • zh-Hant-TW – Chinese written in Traditional script as used in Taiwan
  • sr-Cyrl – Serbian written in Cyrillic script
  • sr-Latn – Serbian written in Latin script

How BCP 47 Tags Are Used

BCP 47 language tags appear in many different technologies and contexts, including:

  • Web pages: the lang attribute in HTML, such as <html lang="en-AU">
  • Search & SEO: hreflang attributes that tell search engines which language and region a page targets
  • Operating systems & apps: language and region settings for user interfaces
  • APIs & HTTP headers: the Accept-Language header sent by browsers to servers
  • Media & subtitles: describing the language of audio tracks, captions and subtitle files

Using valid BCP 47 tags helps keep multilingual websites and applications consistent, and makes it easier for users to see content in their preferred language and regional variant.


Relationship to ISO Language & Country Codes

BCP 47 does not invent completely new codes. Instead, it reuses and combines codes from other standards, such as:

  • ISO 639 (language codes): e.g. en for English, fr for French, de for German
  • ISO 3166 (country codes): e.g. AU for Australia, US for United States, GB for United Kingdom
  • Script codes and other registries: used for subtags such as Hans and Hant

In practice, this means that:

  • Your language codes (ISO 639) explain the language part of tags like en-AU
  • Your country codes (ISO 3166) explain the region part of tags like en-AU

BCP 47 defines the rules for combining these subtags into a single, machine-readable tag.


Examples of BCP 47 Tags in Real Use

Some typical examples you might see on websites and in applications include:

  • en-US – English (United States)
  • en-AU – English (Australia)
  • en-NZ – English (New Zealand)
  • fr-FR – French (France)
  • fr-CA – French (Canada)
  • de-DE – German (Germany)
  • es-ES – Spanish (Spain)
  • es-AR – Spanish (Argentina)
  • pt-BR – Portuguese (Brazil)
  • pt-PT – Portuguese (Portugal)

More detailed tags may specify script or other subtags when needed for clarity, especially in systems that support many languages and writing systems.


Where to Read the Official Specification

For developers and technical readers who need the full standard, you can refer to the official IETF and IANA resources:


Important Disclaimer

This page is provided for general information and educational purposes only. It does not reproduce or replace the official BCP 47 specification, any associated RFCs or any standards maintained by ISO, IANA or the IETF. It does not create, maintain or update any registry of language tags.

For authoritative, complete and up-to-date information on BCP 47 and language subtags, always refer to:

  • The official IETF BCP 47 documents and related RFCs
  • The IANA Language Subtag Registry and other recognised technical standards bodies

Do not rely on this page alone for decisions involving regulatory compliance, critical localisation workflows, safety-related systems or other core business processes.