Complete User Guide to ISO 639-1, ISO 639-2, and BCP 47 Language & Locale Tags

How ISO 639 Language Codes and BCP 47 Locale Tags Work Together

Software localization (i18n), HTML lang attributes, HTTP Accept-Language headers, subtitle tracks, and SEO hreflang tags all rely on standardized language codes rather than free-text language names. The ISO 639-1 standard defines concise two-letter codes for major world languages (such as en for English, hi for Hindi, es for Spanish, fr for French, and ar for Arabic), while ISO 639-2 provides three-letter codes—including both Terminological (639-2/T) and Bibliographic (639-2/B) variants where they differ (such as deu vs. ger for German, or fra vs. fre for French). To specify regional spelling, script, or formatting conventions, IETF BCP 47 combines the primary language subtag with optional script (ISO 15924) and region (ISO 3166-1) subtags—such as en-US, en-GB, or hi-IN. A browser-based Language Code Mapper runs 100% locally in your browser using JavaScript—with zero server uploads.

How to Map a Language Code or Build a BCP 47 Tag in 3 Easy Steps

  1. Search by Language Name or Code: Type a language name (e.g., Hindi or German), 2-letter code (hi, de), 3-letter code (hin, deu, ger), or locale tag (hi-IN, en-US) into Search Language or Tag, pick from the dropdown, or click a quick preset chip.
  2. Customize the Region Subtag (Optional): Use Optional Region Subtag to combine any primary language with a target country subtag (such as pairing en with IN to produce en-IN).
  3. Copy HTML / Locale Metadata or Export: Inspect ISO 639-1, ISO 639-2 (T/B), BCP 47 tag, script, and HTML lang/dir attributes, then click Copy Language Mapping or Download .txt.

BCP 47 Language Tag Syntax

According to RFC 5646 (BCP 47), subtags follow a canonical order and casing convention:

language[-Script][-REGION]  (e.g., en-US, hi-IN, zh-Hans-CN, ar-SA)
Subtag Casing: language = lowercase (en) • Script = Titlecase (Deva) • REGION = UPPERCASE (IN)

Helpful Tips for HTML, SEO hreflang, and App Localization

Worked Example: Looking up Hindi maps to ISO 639-1 hi, ISO 639-2 hin, default BCP 47 locale tag hi-IN, script Deva (Devanagari), and HTML attributes lang="hi-IN" dir="ltr".

Popular Language Codes, ISO 639-1/639-2 & BCP 47 Reference Table (16 Rows)

Use this reference table to verify 2-letter, 3-letter, script, and default locale codes.

Language ISO 639-1 ISO 639-2 (T / B) Default BCP 47 & Script
Hindi hi hin / hin hi-IN • Deva (LTR)
English en eng / eng en-US • Latn (LTR)
Spanish es spa / spa es-ES • Latn (LTR)
French fr fra / fre fr-FR • Latn (LTR)
German de deu / ger de-DE • Latn (LTR)
Arabic ar ara / ara ar-SA • Arab (RTL)
Bengali bn ben / ben bn-IN • Beng (LTR)
Portuguese pt por / por pt-BR • Latn (LTR)
Russian ru rus / rus ru-RU • Cyrl (LTR)
Japanese ja jpn / jpn ja-JP • Jpan (LTR)
Chinese (Mandarin) zh zho / chi zh-CN • Hans (LTR)
Korean ko kor / kor ko-KR • Kore (LTR)
Region Subtag Builder Combine any primary language code with custom region subtags (e.g., en-IN, en-GB)
Client-Side Engine Browser JavaScript ISO 639 & BCP 47 Mapper — Zero Server Latency
Server Uploads None — All language lookups run locally in your browser
Privacy Status 100% Local Processing — Your queries stay strictly on your device

Looking up country codes, ASCII character codes, or converting Hindi text? Explore our companion client-side tools:

Frequently Asked Questions

ISO 639-1 defines two-letter base language codes (such as en or hi), whereas BCP 47 builds on them by adding regional or script subtags (such as en-US, en-GB, or hi-IN) for localization and HTML lang attributes.
ISO 639-2 includes Terminological (639-2/T, derived from the native language name, like deu or fra) and Bibliographic (639-2/B, derived from English library cataloging traditions, like ger or fre).
Never. All language code mapping runs 100% client-side inside your browser.
Yes! It is completely free with no sign-up required.