UnixEpoch

Locale Converter

Normalize locale identifiers between BCP 47, POSIX, ICU and Accept-Language, preview formatting with browser Intl, and copy the right tag for HTML or JS.

Paste a locale tag, POSIX locale string, or Accept-Language header.

Common Locale Conversion Examples

Input en_US.UTF-8 Output en-US

Common POSIX locale from shell environments and Linux servers.

Input zh_Hans_CN Output zh-Hans-CN

ICU-style locale with explicit script and region.

Input sr_RS@latin Output sr-Latn-RS

POSIX modifier converted into a script subtag.

Input Accept-Language: fr-CA,fr;q=0.9 Output fr-CA

Browser header reduced to the primary requested locale.

How to Use This Tool

  1. Enter a locale tag, POSIX locale string, or Accept-Language header from your app, browser, or server logs.
  2. Check the canonical BCP 47 locale, POSIX form, HTML lang value, and Accept-Language fallback chain.
  3. Use the preview cards to confirm how Intl resolves dates, numbers, relative time, and sorting for that locale.

What This Page Answers

  • How do I convert en_US.UTF-8 into a browser locale tag?
  • What locale should I put in an HTML lang attribute or Intl API call?
  • How does an Accept-Language header map to a primary requested locale?
  • Which locale does the browser actually resolve for numbers, dates, and sorting?

Frequently Asked Questions

What does this locale converter normalize?

It normalizes common locale inputs such as en_US.UTF-8, zh_Hans_CN, sr_RS@latin, and Accept-Language headers into cleaner locale formats for browser and application use.

What is the difference between BCP 47 and POSIX locale formats?

BCP 47 uses dash-separated tags like en-US for web and Intl APIs, while POSIX locale strings often use underscores and charsets such as en_US.UTF-8 for servers and shell environments.

Can I parse an Accept-Language header here?

Yes. Paste a full header such as Accept-Language: fr-CA,fr;q=0.9 and the tool extracts the primary locale and shows a fallback chain.

Why do resolved locales differ from the requested locale?

Browser Intl APIs can fall back to a supported parent locale or canonical variant. The resolved locale cards show what NumberFormat, DateTimeFormat, ListFormat, RelativeTimeFormat, and Collator actually use.

Is this locale converter online only or does it call a server API?

The parsing and preview logic run in the browser, so you can inspect locale behavior instantly without sending the locale input to a conversion API.

Does the site remember my previous inputs and settings?

Yes. The timestamps, dates, unit choices, and other options you enter — such as converter values, time zones, date formats, and countdown targets — are kept only in your own browser's local storage on this device. Reload the page or come back later and your last configuration is restored instantly, with no account and no upload: nothing is stored on any server, and a different device or browser keeps its own separate memory. Clearing a field removes it from memory immediately, and emptying every field makes the tool forget everything. Only plain inputs and settings are remembered locally, and you can change or clear them at any time.

Related Tools

About

UnixEpoch.net

Built for developers who need to normalize locale tags, validate browser Intl behavior, and switch between BCP 47, POSIX, and Accept-Language formats.

References & Resources

Locale-aware formatting is standardized by BCP 47 language tags and the Unicode CLDR data set, then exposed to the web through the JavaScript Intl API. These sources define how dates, numbers, and calendars vary across locales.