Locale Code Lookup (BCP-47)

Parse, validate and canonicalise BCP-47 language tags, and search 787 language, script, region, variant and grandfathered subtags.

en-US Valid BCP-47 tag

Language
en ยท English
Script
not set
Region
US ยท United States
Variants
not set
Extensions
not set
Maximized
en-Latn-US
Number sample
1,234,567.89
Date sample
March 15, 2026

Subtag registry

Tap any row to drop that subtag into the tag box above, or use its Copy button.

787 subtags

BCP-47 subtags matching your search
Subtag Name Type Copy
No uploads. Your files stay on your device.

Free forever, no sign-up, no cookies. Buy me a coffee

How it works

Type a locale code and it is parsed live against the RFC 5646 (BCP 47) grammar: primary language, extended language, script, region, variant, extension and private-use subtags are split out, each one is looked up by name, and the tag is rewritten in the canonical casing RFC 5646 section 2.1.1 asks for (language lowercase, Script title case, REGION upper case, everything else lowercase, extension singletons sorted). Ill-formed input gets a specific reason rather than a generic "invalid" โ€” an underscore instead of a hyphen, an empty group, a subtag longer than eight characters, an extension with no subtags. The panel also shows the maximized form via Intl.Locale.maximize() and a live number and date sample from Intl.NumberFormat and Intl.DateTimeFormat, so you can see how the tag actually behaves in a browser.

The table below is a searchable subtag registry: the ISO 639-1 language codes plus the common ISO 639-2/3 additions used in real locales, ISO 15924 scripts, all ISO 3166-1 alpha-2 regions, the UN M.49 numeric regions BCP 47 allows, the widely used variant subtags and the grandfathered tags from RFC 5646 Appendix A. Click any row to drop that subtag into the tag above (a script row swaps the script slot, a region row swaps the region slot), or copy the code straight from the row. Note that this is a curated registry, not a mirror of the full IANA Language Subtag Registry, so a well-formed tag built from a rarer subtag is reported as "not in this registry" rather than as invalid. Everything is embedded in the page and runs in your browser: no lookups are sent anywhere and nothing you type is stored.

Frequently asked questions

What is a BCP-47 language tag?

BCP 47 is the IETF standard (currently RFC 5646) that defines the locale codes used by HTML lang attributes, HTTP Accept-Language headers, JavaScript Intl and almost every i18n library. A tag is a hyphen-separated sequence in a fixed order: a primary language subtag from ISO 639, then an optional extended language, an optional ISO 15924 script, an optional ISO 3166-1 alpha-2 or UN M.49 region, then any variant, extension and private-use subtags. So pt-BR is Portuguese as written in Brazil, and zh-Hant-HK is Chinese in Traditional Han script as used in Hong Kong. Paste any tag above and this tool splits it into those parts and names each one.

Should I write en-US or en_US?

In BCP 47 it is always en-US with a hyphen. The underscore form en_US is a POSIX and Java locale convention, and it also turns up in gettext .po files and Rails locale filenames, but it is not a valid language tag and will be rejected by HTML validators, Intl and Accept-Language parsers. Casing is a separate question: tags are case-insensitive when compared, but the canonical form in RFC 5646 section 2.1.1 writes the language in lowercase, the script in title case and the region in uppercase, which is why this tool rewrites zh-hant-hk as zh-Hant-HK.

Why is en-UK flagged as wrong?

Because UK is not an ISO 3166-1 code. The country code for the United Kingdom is GB, so the correct tag is en-GB. UK only exists as a top-level internet domain, and BCP 47 takes its region subtags from ISO 3166-1 alpha-2 plus the UN M.49 numeric codes. This tool marks that kind of tag as well-formed but flags the subtag and names the replacement, and does the same for deprecated codes such as iw for Hebrew (now he), in for Indonesian (now id) and CS or YU for Serbia (now RS).

Report a bug