Developer · Validator
BCP 47 language tag checker.
Check whether a language tag such as en-CA or zh-Hant-TW is well-formed under RFC 5646, see every subtag labelled, and get the recommended capitalization. Runs in your browser; nothing is sent anywhere.
Input
Result
Enter a language tag and press Check tag.
What well-formed means
RFC 5646 section 2.1 defines a language tag as language ["-" script] ["-" region] *("-" variant) *("-" extension) ["-" privateuse]. Each subtag type is recognised by its length and content alone, so a tag can be checked without any list of languages. A tag that fits that pattern is well-formed (section 2.2.9).
- Language: 2 to 3 letters (optionally followed by up to three 3-letter extended language subtags), or 4 letters (reserved), or 5 to 8 letters.
- Script: 4 letters, such as
Hant. - Region: 2 letters (
CA) or 3 digits (419). - Variant: 5 to 8 letters or digits, or a digit followed by 3 letters or digits, such as
1901. - Extension: a single letter or digit other than
x, followed by one or more subtags of 2 to 8 characters, such asu-ca-gregory. - Private use:
xfollowed by one or more subtags of 1 to 8 characters. A tag may also be private use only, such asx-whatever. - Grandfathered: the fixed list of 17 irregular and 9 regular tags from the RFC 3066 era, such as
i-klingonandzh-min-nan.
Capitalization
Case carries no meaning (section 2.1.1), but the recommended form is language in lowercase, script in Title case and region in UPPER case: zh-Hant-TW. The tool suggests that form.
What this tool does not check
Well-formed is not valid. A tag is valid only if its language, script, region and variant subtags are listed in the IANA Language Subtag Registry and there are no repeated variants or extension singletons (section 2.2.9). This tool does not have the registry, so qq-Zzzz-ZZ passes as well-formed even though none of its subtags is assigned. To look subtags up, use the IANA Language Subtag Registry. Repeated variants and singletons are flagged as a note.
Sources: RFC 5646, Tags for Identifying Languages (BCP 47), sections 2.1, 2.1.1 and 2.2.9.
Frequently asked questions
Is en_US a valid BCP 47 tag?
No. BCP 47 separates subtags with hyphens. en_US is a POSIX locale name; the BCP 47 form is en-US.
Does a pass mean the language code exists?
No. It means the tag has the right shape. The tool does not check the IANA registry, so an unassigned code such as zz still passes.
Is the canonical form the same as a registry-preferred form?
No. The tool only adjusts capitalization. It does not replace deprecated subtags or reorder anything.
Why is i-klingon accepted when it does not fit the pattern?
It is one of the grandfathered tags that RFC 5646 lists by name. They are accepted as a fixed list even though most are deprecated.
Well-formedness check only
This tool checks the syntax of a language tag against RFC 5646 section 2.1. It does not confirm that any subtag is in the IANA Language Subtag Registry, so a pass does not mean the tag is valid or that the language exists.