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
- Search by Language Name or Code: Type a language name (e.g.,
HindiorGerman), 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. - Customize the Region Subtag (Optional): Use Optional Region Subtag to combine any primary language with a target country subtag (such as pairing
enwithINto produceen-IN). - Copy HTML / Locale Metadata or Export: Inspect ISO 639-1, ISO 639-2 (T/B), BCP 47 tag, script, and HTML
lang/dirattributes, 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:
Subtag Casing: language = lowercase (en) • Script = Titlecase (Deva) • REGION = UPPERCASE (IN)
Helpful Tips for HTML, SEO hreflang, and App Localization
- Use the Shortest Standard Language Subtag: BCP 47 prefers the 2-letter ISO 639-1 code (
hi,en) whenever one exists rather than the 3-letter code. - Include Text Direction (LTR vs. RTL) for Bidirectional Scripts: Languages written in Arabic or Hebrew scripts use right-to-left (
dir="rtl") layout direction. - Distinguish Language Codes From Country Codes: Country code
INis India, whereas language codehiis Hindi (anden-INdenotes English in India).
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".