Locale code lookup

Type any locale code, in whatever spelling you found it: pt_BR, zh-Hant-TW, sr-latn. Your browser's Intl APIs report what it means and how it formats, and you get the names Laravel, HTML and hreflang expect.

Common locale codes

Click a code to inspect it.

BCP 47 Laravel folder Name Native Dir Guide
ar ar Arabic العربية rtl Guide
ar-EG ar_EG Arabic (Egypt) العربية (مصر) rtl Guide
ar-SA ar_SA Arabic (Saudi Arabia) العربية (المملكة العربية السعودية) rtl Guide
bg bg Bulgarian български ltr
ca ca Catalan català ltr Guide
cs cs Czech čeština ltr Guide
da da Danish dansk ltr Guide
de de German Deutsch ltr Guide
de-AT de_AT German (Austria) Deutsch (Österreich) ltr Guide
de-CH de_CH German (Switzerland) Deutsch (Schweiz) ltr Guide
el el Greek Ελληνικά ltr Guide
en en English English ltr Guide
en-AU en_AU English (Australia) English (Australia) ltr Guide
en-CA en_CA English (Canada) English (Canada) ltr Guide
en-GB en_GB English (United Kingdom) English (United Kingdom) ltr Guide
en-IN en_IN English (India) English (India) ltr Guide
en-US en_US English (United States) English (United States) ltr Guide
es es Spanish español ltr Guide
es-419 es_419 Spanish (Latin America) español (Latinoamérica) ltr Guide
es-AR es_AR Spanish (Argentina) español (Argentina) ltr Guide
es-ES es_ES Spanish (Spain) español (España) ltr Guide
es-MX es_MX Spanish (Mexico) español (México) ltr Guide
et et Estonian eesti ltr
fa fa Persian فارسی rtl
fi fi Finnish suomi ltr Guide
fr fr French français ltr Guide
fr-BE fr_BE French (Belgium) français (Belgique) ltr Guide
fr-CA fr_CA French (Canada) français (Canada) ltr Guide
fr-CH fr_CH French (Switzerland) français (Suisse) ltr Guide
he he Hebrew עברית rtl Guide
hi hi Hindi हिन्दी ltr Guide
hr hr Croatian hrvatski ltr
hu hu Hungarian magyar ltr Guide
id id Indonesian Bahasa Indonesia ltr Guide
it it Italian italiano ltr Guide
ja ja Japanese 日本語 ltr Guide
ko ko Korean 한국어 ltr Guide
lt lt Lithuanian lietuvių ltr
lv lv Latvian latviešu ltr
ms ms Malay Bahasa Melayu ltr Guide
nb nb Norwegian Bokmål norsk bokmål ltr
nl nl Dutch Nederlands ltr Guide
nl-BE nl_BE Dutch (Belgium) Nederlands (België) ltr Guide
pl pl Polish polski ltr Guide
pt pt Portuguese português ltr Guide
pt-BR pt_BR Portuguese (Brazil) português (Brasil) ltr Guide
pt-PT pt_PT Portuguese (Portugal) português (Portugal) ltr Guide
ro ro Romanian română ltr Guide
ru ru Russian русский ltr Guide
sk sk Slovak slovenčina ltr
sl sl Slovenian slovenščina ltr
sr-Cyrl sr_Cyrl Serbian (Cyrillic) Српски (Ћирилица) ltr
sr-Latn sr_Latn Serbian (Latin) Srpski (Latinica) ltr
sv sv Swedish svenska ltr Guide
th th Thai ไทย ltr Guide
tr tr Turkish Türkçe ltr Guide
uk uk Ukrainian українська ltr Guide
ur ur Urdu اردو rtl
vi vi Vietnamese Tiếng Việt ltr Guide
zh-CN zh_CN Chinese (China) 中文(中国) ltr Guide
zh-Hans zh_Hans Chinese (Simplified) 中文(简体中文) ltr Guide
zh-Hant zh_Hant Chinese (Traditional) 中文(繁體中文) ltr Guide
zh-HK zh_HK Chinese (Hong Kong SAR China) 中文(中華人民共和國香港特別行政區) ltr Guide
zh-TW zh_TW Chinese (Taiwan) 中文(台灣) ltr Guide

Reading a locale code

Web standards spell locales as BCP 47 language tags: a language subtag (zh), an optional four-letter script (Hant), an optional region, either two letters or three digits (TW, 419), separated by hyphens. Case carries no meaning, but the canonical form writes the language in lowercase, the script in title case and the region in uppercase, which is what Intl.getCanonicalLocales() returns above. It also replaces deprecated codes, so iw comes back as he.

The "likely subtags" row is what CLDR assumes when parts are missing: plain pt maximizes to pt-Latn-BR, and zh-TW to zh-Hant-TW. That is why browsers format pt the Brazilian way unless you say pt-PT.

Hyphens on the web, underscores in Laravel

Laravel does not validate the locale string: App::setLocale() accepts anything without a slash, and the translator then loads lang/{locale}/*.php and lang/{locale}.json. The underscore spelling (pt_BR) is the convention because other parts of the stack match on it: Carbon's locale files are named pt_BR.php and zh_Hant_TW.php, and the plural table behind trans_choice() lists exact strings such as pt_BR. A locale missing from that table, hyphenated or not, falls back to the first form for every number, which the tool points out above.

Laravel also does not fall back from a regional locale to its language: with pt_BR active, a key missing from lang/pt_BR goes straight to your fallback locale, not to lang/pt. Your HTML is the other way round: the lang attribute and hreflang values need the hyphenated tag, which is why Laravel's starter kit layouts print str_replace('_', '-', app()->getLocale()).

A worked example: Brazilian Portuguese

Say a ticket asks for "pt-br support". Typing it here gives the canonical tag pt-BR and the Laravel name pt_BR. So the translations go in lang/pt_BR/ (or lang/pt_BR.json), your middleware calls App::setLocale('pt_BR') when the URL segment is pt-br, and the layout prints lang="pt-BR". The plural row shows three CLDR categories, where one covers 0 and 1, unlike European Portuguese, and the formatting rows show the comma decimal separator your number and currency output should use. Share the result with #pt-BR on the URL.

Direction and plurals

Direction comes from the script, not the language alone: Arabic, Hebrew, Persian and Urdu are right to left, but uz-Arab is right to left while plain uz is not. When the browser supports Intl.Locale text info the tool asks it directly; otherwise it checks the likely script against a list of RTL scripts. Set it on the page with dir="rtl" next to lang; see the RTL glossary entry and RTL in Laravel and Tailwind for the CSS side.

The plural categories are the CLDR set your browser uses, with sample numbers for each. They tell you how many forms a translator has to write, which can differ from what Laravel's pipe syntax resolves; the pluralization tester checks any number, and the language guides cover each language's Laravel setup in detail. Building language versions of a site? The hreflang generator validates the codes for search engines.

Frequently asked questions

Should a Laravel lang folder be pt_BR or pt-BR?

Laravel loads whatever folder matches the locale string you set, but pt_BR is the convention. Carbon names its locale files with underscores, and the plural table behind trans_choice() matches exact strings such as pt_BR, so a hyphenated pt-BR falls back to the first form. Use hyphens only where web standards require them: the HTML lang attribute and hreflang.

Does Laravel fall back from pt_BR to pt?

No. When a key is missing for the current locale, the translator tries the configured fallback locale next and nothing in between. If you want pt_BR to borrow from pt, copy the keys or make pt your fallback locale.

What is the difference between zh-Hant and zh-TW?

zh-Hant names the script, Traditional Chinese characters, wherever they are used. zh-TW names the region, Taiwan, and implies Traditional script. zh-Hant-TW states both. Pick the script form when one translation serves Taiwan, Hong Kong and Macau, and the region form when content differs per market.

How do I know if a language is right to left?

Direction follows the script. Arabic, Hebrew, Persian and Urdu are written right to left, and so is any language written in Arabic or Hebrew script, such as uz-Arab. The tool asks your browser where it supports Intl.Locale text info and otherwise checks the likely script against a list of RTL scripts.

Why do the results differ between browsers?

Everything on the page comes from your browser's built-in Intl implementation and its copy of the CLDR data. Display names, date patterns and newer features such as week information can vary with the browser and its version. Nothing is looked up on a server.

Useful? Link to it

The tool is free and stays free. Paste this into a README, a wiki page or a forum answer.

<a href="https://langsyncer.com/tools/locale-code-lookup">Locale Code Lookup</a> by LangSyncer

Add a locale without the busywork

Pick the code, and LangSyncer does the rest: it creates the language in your project, translates every key with AI using your existing translations as context, and publishes the files live without a deploy.

We'd like to use analytics and marketing cookies to understand how the site is used. They stay off unless you accept them. Cookie Policy