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.
Format Alternatives
Parsed Locale
Resolved Intl Locales
Fallback Chain
Live Intl Preview
Normalized Locale Output
Use these values in HTML lang attributes, Intl APIs, Accept-Language headers, or server locale environment variables.
Locale Comparison
Compare locale formatting side by side for the same sample data.
Common Locale Conversion Examples
en_US.UTF-8
Output
en-US
Common POSIX locale from shell environments and Linux servers.
zh_Hans_CN
Output
zh-Hans-CN
ICU-style locale with explicit script and region.
sr_RS@latin
Output
sr-Latn-RS
POSIX modifier converted into a script subtag.
Accept-Language: fr-CA,fr;q=0.9
Output
fr-CA
Browser header reduced to the primary requested locale.
How to Use This Tool
- Enter a locale tag, POSIX locale string, or Accept-Language header from your app, browser, or server logs.
- Check the canonical BCP 47 locale, POSIX form, HTML lang value, and Accept-Language fallback chain.
- 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
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.
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.
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.
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.
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.
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.