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.

Advertisement

Input

Case does not matter. Subtags are separated by hyphens, not underscores.

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).

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.

Advertisement
Advertisement
Listening…