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

Category: Web. This tool runs in your browser.

Open the interactive tool: https://www.devkult.com/tools/web/locale-converter

## FAQ

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

## More Web tools

- [HTML Viewer](https://www.devkult.com/tools/web/html-viewer.md): Preview and render HTML in a live sandbox.
- [HTML Minifier](https://www.devkult.com/tools/web/html-minifier.md): Strip whitespace and comments from HTML to reduce file size.
- [HTTP Status Checker](https://www.devkult.com/tools/web/http-status-checker.md): Check HTTP status codes and response headers for multiple URLs in bulk.