Locale Code Converter

Convert language and locale codes between BCP 47, POSIX, ISO 639-1/2/3, Android resource folders, iOS .lproj and .NET cultures.

BCP 47, POSIX, Android and iOS folder names, ISO 639-2/3 codes.

Platform formats

BCP 47 / IETF
HTML lang, JavaScript Intl, Flutter
zh-Hans-CN
POSIX / Java
Linux locales, java.util.Locale
zh_Hans_CN
Android
res/ folder name
values-b+zh+Hans+CN
iOS / macOS
Xcode localization folder
zh-Hans-CN.lproj
.NET culture
CultureInfo name
zh-Hans-CN

Language and region

Language
zh
Script
Hans
Region
CN
Variant
n/a
ISO 639-1
zh
ISO 639-2
zho
ISO 639-3
zho
Language name (English)
Simplified Chinese (China)
Language name (native)
简体中文(中国)
Country (English)
China
Country (local)
中國 / 中国 / Zhōngguó
Text direction
ltr (left to right)

Runs in your browser. Files are not uploaded unless the tool says otherwise.

One language, five naming conventions

Every platform spells locale identifiers slightly differently. The web, Flutter and .NET use BCP 47 tags with hyphens (pt-BR). Linux, Java and gettext use POSIX names with underscores and an optional charset (pt_BR.UTF-8). Android names resource folders values-pt-rBR, and switches to the values-b+ form when a script or a numeric region is involved (values-b+zh+Hans+CN, values-b+es+419). Xcode expects pt-BR.lproj. Mixing them up is a classic source of "translations exist but the app shows English".

Subtags explained

  • Language: ISO 639-1 two-letter code when one exists (en), otherwise ISO 639-2/3 (fil, haw).
  • Script: four letters, title case (Hans, Hant, Latn, Cyrl). Needed when the same language is written in more than one script, such as Chinese or Serbian.
  • Region: ISO 3166-1 alpha-2 country (US) or a UN M.49 area code (419 for Latin America).
  • Variant: rare, for orthography variants such as de-CH-1996.

Tips for naming translation files

  • Store translations under BCP 47 codes and derive the platform-specific folder name at export time. This is what the SimpleLocalize CLI does with the {lang} placeholder in file paths.
  • Do not add a region unless you actually maintain a separate translation for it. fr is a better fallback for a French-speaking Canadian than a missing fr-CA.
  • For Chinese, always include the script: zh-Hans and zh-Hant are different translations, and zh-CN vs zh-TW hides that fact.
  • Right-to-left languages (Arabic, Hebrew, Persian, Urdu) need dir="rtl" in HTML and mirrored layouts, not just translated text.

SimpleLocalize accepts any BCP 47 language key and exports files under the naming convention of the chosen file format. See the CLI download documentation for the {lang} and {ns} placeholders.

More translation tools

Manage translations with SimpleLocalize

  • Import the same file formats you just converted or checked
  • Auto-translate with DeepL, Google, OpenAI, Claude or Gemini using your own API keys
  • Free plan for small projects, no credit card required
Start for free
No credit card required5-minute setup