What is an ISO 639-1 language code?

ISO 639-1 gives the world's major languages a code of two small letters: en for English, fr for French, de for German, ja for Japanese, zh for Chinese. These codes show up in web addresses like /fr/, in the lang attribute of web pages, in app translation files, in subtitle file names and at the start of locale codes such as en-US. ISO sets the codes, and the Library of Congress publishes them in its list of the three-letter ISO 639-2 codes.

Developers, translators and content editors check a code before it goes into a translation file, a language menu or a database, since a slip such as a country code in place of a language code quietly breaks the language setting.

Tool description

Type or paste a code into the ISO 639-1 language code field, and the result shows as you type: "ISO 639-1 language code is valid" or "ISO 639-1 language code is not valid". Spaces and line breaks around the code are ignored. The page has no settings.

What passes and what fails

  • Two small letters from the ISO 639-1 list: fr, es, or el for Greek
  • Capital letters fail: FR and Fr don't pass, though some systems write codes that way
  • Country codes that aren't language codes fail: dk (Danish is da), jp (Japanese is ja), cz (Czech is cs)
  • Withdrawn codes fail, such as iw for Hebrew (now he), in for Indonesian (now id) and ji for Yiddish (now yi), which some older software still writes
  • Three-letter codes from ISO 639-2 and ISO 639-3, such as eng or fil for Filipino, fail
  • Codes with a region, such as en-US, fail: check those with the Locale Code Validator

Good to know

  • A code that passes is in the copy of the ISO 639-1 list that comes with validator.js. The page can't tell which language a text is written in.
  • Some country codes are codes of other languages, so they pass: se is Northern Sami (Swedish is sv), kr is Kanuri (Korean is ko), and uk is Ukrainian, not the United Kingdom.
  • For the script part of a locale code, such as Latn, use the ISO 15924 Script Code Validator.

Features

  • Checks two-letter ISO 639-1 codes against the list
  • Rejects withdrawn codes and three-letter codes
  • Results as you type, with no button to press
  • Runs in your browser, so nothing you type is sent anywhere