devkult_
tools30converters34
home/tools/web/Locale Converter

Locale Converter

Convert locale codes between BCP 47 (en-US), POSIX (en_US.UTF-8), ICU, Android and Accept-Language, with live previews of numbers, dates and plurals.

Loading tool…

Frequently Asked Questions

What is the difference between en-US and en_US?

They name the same locale in two conventions. en-US, with a hyphen, is a BCP 47 language tag, used by HTML, HTTP, JavaScript and most web APIs. en_US, with an underscore, is the POSIX and ICU style used by Linux locales, Java, Python and gettext. Convert at the boundary rather than mixing them.

What does .UTF-8 mean in en_US.UTF-8?

It's the character encoding (the POSIX codeset) the program should use for text. BCP 47 tags have no encoding part, so it's dropped when converting to en-US. Old locales like ar_EG.ISO-8859-6 used other encodings; today UTF-8 is the right choice almost everywhere.

How do I read an Accept-Language header?

Split it on commas. Each entry is a language tag with an optional q-value from 0 to 1 (1 when missing), and higher values are preferred. Paste a full header into the converter to see the entries sorted by preference.

Why does Android use values-b+zh+Hant+TW?

Android's original resource qualifiers (values-zh-rTW) can only express a language and a region. Since Android 7.0, the b+ form accepts a full BCP 47 tag with + instead of -, which is needed for scripts like Hant or Latn.

Are zh-TW and zh-Hant-TW the same?

In practice, yes: Traditional Chinese is the likely script for Taiwan, so zh-TW expands to zh-Hant-TW. The script matters when it isn't the default — zh-Hant-CN or sr-Latn-RS, for example.

Does this tool send my input anywhere?

No. Parsing and formatting use your browser's built-in Intl APIs.