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; IANA Language Subtag Registry for checking that a subtag is assigned. Links last checked 2026-10-26.
Worked example
Check zh-hant-tw. It is well-formed, and the tool splits it into 3 subtags: zh (Language (ISO 639 code)), hant (Script (ISO 15924, 4 letters)), tw (Region (ISO 3166-1, 2 letters)). The suggested capitalization is zh-Hant-TW.
Check en_US. It is not well-formed: "Underscore is not allowed. Replace it with a hyphen." Hyphens separate subtags, not underscores. "en_US" style is a POSIX locale, not a BCP 47 tag; use "en-US".
Common mix-ups
-
Often assumeden-UK is the language tag for British English.
What the source saysThe IANA registry has a region subtag GB for the United Kingdom and no UK entry. RFC 5646 section 2.2.4 notes that UK, an exceptionally reserved ISO 3166-1 code and a synonym of GB, was left out of the registry. The tag is en-GB. [1]
-
Often assumediw is the right code for Hebrew because it is the old ISO code.
What the source saysThe registry marks the language subtag iw as deprecated since 1989-01-01 with the preferred value he, so new tags should use he. [2]
- RFC 5646: Tags for Identifying Languages (RFC Editor)
- IANA Language Subtag Registry (file date 2026-09-17)
Checked against these sources on .
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.