Language Name to Code Converter

Enter a language name or ISO 639-1 code and pick a direction to convert.

How it is calculated

This is a dictionary lookup over all 183 ISO 639-1 languages, not a calculation. In the name-to-code direction your text is trimmed, lower-cased and has runs of spaces collapsed, then matched against a list of English names. Several alternative names point to the same code: Farsi and Persian give fa, Filipino and Tagalog give tl, and Chinese, Mandarin and Mandarin Chinese all give zh. In the code-to-name direction the two-letter code is matched without regard to case and returns the main English name. The extra "matched" line shows which language was recognised. On a page in another language, the name in that language is accepted as well. Three-letter codes (ISO 639-2) and regional tags like pt-BR are not recognised, and a name or code outside the list gives no result.

Worked example

Type Farsi with the name-to-code direction. The tool lower-cases it to "farsi", finds it in the list of alternative names and returns the code fa. The matched line shows Persian, which is the main name stored for fa. Reversing the direction and entering fa gives Persian. Looking up Mandarin Chinese gives zh, and code2name for zh returns "Mandarin Chinese" on the English page.

Try this example →

Common mistakes

  • Leaving the direction on name-to-code while typing a code such as en. The tool looks for a language called "en" and finds nothing; switch the direction to code-to-name.
  • Typing the language's own name, like Deutsch or Español. Use the English name, German or Spanish, or the name in the language of the page.
  • Entering a three-letter code such as zho or tur. Only the two-letter ISO 639-1 codes are known, so these give no result.
  • Expecting regional variants. pt-BR and zh-TW are locale tags, not language codes, while nb (Norwegian Bokmål) and nn (Nynorsk) are codes of their own; plain Norwegian maps to no.
  • Looking up a language with no two-letter code, for example Hawaiian or Serbo-Croatian. ISO 639-1 has 183 languages, so a real language outside them returns no result.

About this calculator

ISO 639-1 is the standard that assigns a two-letter code to each of the world's major languages — “en” for English, “tr” for Turkish, “ja” for Japanese, and so on — providing a compact, unambiguous identifier that doesn't depend on how a language's name is spelled in any particular language.

These codes appear everywhere in software: HTML lang attributes, browser Accept-Language headers, translation file names, and URL locale segments (like /tr/ or /de/) all rely on them. Web developers, localization engineers, and content managers use a name-to-code converter to quickly look up the right code when configuring i18n settings, naming translation files, or troubleshooting a locale that isn't rendering correctly.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    What comes back is the bare two-letter code, which is not always enough for a website. Mandarin Chinese gives zh, but hreflang and lang attributes often need a script or region as well, such as zh-Hans or zh-Hant, and you add that part yourself. Which languages missing from the list do you need for your project?

Popular calculators

All Calculators