String.prototype.toLocaleUpperCase() returns a new uppercased string using locale-specific case rules (same API as MDN String.prototype.toLocaleUpperCase()). Learn the optional locales argument, why Turkish istanbul becomes İSTANBUL, Lithuanian combining-dot rules, how it compares to toUpperCase(), five examples, and try-it labs.
01
Kind
Instance method
02
Returns
New string
03
Locale
Optional BCP 47
04
vs toUpperCase
Locale-aware
05
Mutates?
No
06
Baseline
Widely available
Fundamentals
Introduction
Need uppercase text that respects a language’s alphabet rules — not only English Unicode defaults? toLocaleUpperCase() applies locale-specific case mappings.
For everyday English or ASCII, the result usually matches toUpperCase(). For languages like Turkish, the dotted/dotless i family differs, so passing the right locales tag matters for display and comparisons.
💡
Beginner tip
Pass the UI language when casing user-facing text: city.toLocaleUpperCase("TR"). Use plain toUpperCase() only when locale rules are irrelevant.
str.toLocaleUpperCase(locales?) builds a new string where each character is uppercased according to the chosen locale’s rules (or the host default when you omit locales).
Returns a new string — the original is unchanged.
Optional locales: one BCP 47 tag or an array of tags.
Unlike Intl.Collator, there is no locale matching — the first tag wins.
Length may change (one character can become two or more when uppercased).
Most locales match toUpperCase(); Turkish is the classic exception.
Foundation
📝 Syntax
General form of String.prototype.toLocaleUpperCase:
locales(optional) — a BCP 47 language tag (e.g. "en-US", "TR") or an array of tags. After validation, only the first locale is used (or the default locale if the list is empty). There is no fallback matching like other Intl APIs.
Return value
A new string representing the calling string converted to upper case according to locale-specific case mappings.
Exceptions
RangeError if a locale identifier is structurally invalid (same family of checks as other Intl locale arguments).
i\u0307 is i plus combining dot above. Under Lithuanian rules it uppercases to plain I. The array still uses only the first tag — no Intl-style matching.
Example 5 — Normalize Titles for a Locale
Practical pattern: uppercase headings with the shop’s language.
JavaScript
function displayTitle(text, locale) {
return text.toLocaleUpperCase(locale);
}
const city = "istanbul guide";
const en = displayTitle(city, "en-US");
const tr = displayTitle(city, "TR");
console.log(en === tr); // false — İ vs I
console.log(tr.startsWith("İ")); // true
console.log("mixed".toLocaleUpperCase() === "mixed".toUpperCase()); // true
Pass the same locale you use for formatting and sorting so case, collation, and display stay consistent for that language.
Applications
🎯 Common Use Cases
Localized UI titles — ALL CAPS headings in the user’s language.
Search / filter prep — normalize case before comparing Turkish (or similar) text.
Multilingual apps — pair with toLocaleLowerCase and the same locale tag.
Not always needed — for ASCII-only codes and IDs, toUpperCase() is fine.
Not for sorting — use localeCompare / Intl.Collator for order.
🧠 How toLocaleUpperCase() Works
1
Resolve locales
Validate tags; take the first locale or the host default.
Input
2
Apply case mappings
Map each character using that locale’s uppercase rules.
Transform
3
Build a new string
Length may grow when one character maps to several code points.
Result
4
✅
Return the new string
The original string is never modified.
Important
📝 Notes
In most cases the result equals toUpperCase() — locale differences show up for specific languages.
Locale arrays do not fall back: the first tag is always chosen after validation.
Case conversion can change string length (e.g. ß → SS).
Round-trips are not always stable: x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase() can be false.
Pair with toLocaleLowerCase() when you need the matching lowercase path.
Compatibility
Browser & Runtime Support
String.prototype.toLocaleUpperCase() is Baseline Widely available — supported across modern browsers since July 2015.
✓ Baseline · Widely available
String.toLocaleUpperCase()
Safe for production in browsers and runtimes (Node.js, Deno, Bun). Pass locales when language-specific casing matters.
UniversalWidely available
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
toLocaleUpperCase()Excellent
Bottom line: Use String.toLocaleUpperCase() for locale-aware uppercasing. Remember the first locale in a list wins, and prefer toUpperCase() only when locale rules do not matter.
Wrap Up
Conclusion
String.prototype.toLocaleUpperCase() is the right tool when uppercasing must follow a language’s alphabet — especially Turkish dotted İ. For simple ASCII, toUpperCase() remains fine.
Use the same locale for compare and case normalize
Prefer this over toUpperCase for Turkish and similar
Keep ASCII IDs / codes on toUpperCase if locale is irrelevant
Expect length changes for characters like ß
❌ Don’t
Expect locale array fallback / matching
Assume English and Turkish always match
Assume upper → lower always restores the original
Use case methods to sort — use localeCompare
Forget invalid locale tags can throw RangeError
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about String.toLocaleUpperCase()
Locale-aware uppercase — first locale wins, length may grow.
5
Core concepts
📝01
Returns
new string
API
🌐02
Locales
optional BCP 47
Arg
🔢03
Array
first wins
Rule
🇺🇸04
Turkish
i → İ
Classic
⚡05
Length
may grow
Unicode
❓ Frequently Asked Questions
String.prototype.toLocaleUpperCase(locales?) returns a new string with characters uppercased using locale-specific case mappings. Without locales, the host default locale is used.
For most Latin text they match. toLocaleUpperCase respects language rules (for example Turkish dotted İ). Prefer toLocaleUpperCase when the UI language can change case mapping.
A BCP 47 language tag such as "tr" or "en-US", or an array of tags. Unlike Intl.Collator, toLocaleUpperCase does not do locale matching — it uses the first locale in the list (or the default if the list is empty).
In Turkish, lowercase i uppercases to İ (U+0130), while English produces plain I. So "istanbul".toLocaleUpperCase("TR") is "İSTANBUL".
Yes. Some characters expand to two or more when uppercased (for example German ß → SS). Conversion is not always a 1:1 mapping, so length can change.
No. Strings are immutable. The method returns a new uppercased string.
Did you know?
Uppercasing is not always reversible. MDN notes that x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase() can return false because some characters expand when converted to upper case.