JavaScript String toLocaleUpperCase() Method

Beginner
⏱️ 9 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Instance method

What You’ll Learn

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

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.

This page is part of JavaScript String Methods. Related topics include toLocaleLowerCase() and localeCompare().

Understanding the toLocaleUpperCase() Method

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.

📝 Syntax

General form of String.prototype.toLocaleUpperCase:

JavaScript
str.toLocaleUpperCase()
str.toLocaleUpperCase(locales)

Parameters

  • 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).

Common patterns

JavaScript
"alphabet".toLocaleUpperCase();           // "ALPHABET"
"istanbul".toLocaleUpperCase("en-US");    // "ISTANBUL"
"istanbul".toLocaleUpperCase("TR");       // "İSTANBUL"
"Gesäß".toLocaleUpperCase();              // "GESÄSS"
"hello".toLocaleUpperCase() === "hello".toUpperCase(); // usually true

⚡ Quick Reference

GoalCode
Uppercase (host locale)str.toLocaleUpperCase()
Uppercase for a languagestr.toLocaleUpperCase("TR")
Prefer first of a liststr.toLocaleUpperCase(["lt", "en"])
Unicode default mappingstr.toUpperCase()
Locale-aware lowercasestr.toLocaleLowerCase(locales)

🔍 At a Glance

Four facts to remember about String.toLocaleUpperCase().

Returns
string

New uppercased text

Locales
first wins

No locale matching

vs toUpperCase
usually =

Differs for some langs

Length
may grow

Not always 1:1

📋 toLocaleUpperCase() vs toUpperCase()

toLocaleUpperCase()toUpperCase()
Case rulesLocale-specific mappingsUnicode default mappings
Optional arglocales (BCP 47)None
English / ASCIISame result usuallySame result usually
Turkish iİ with "TR"Usually plain I
Best forUser-facing text in a languageSimple / locale-agnostic code

Examples Gallery

Examples follow MDN String.toLocaleUpperCase() patterns. Use View Output or Try It Yourself for each case.

📚 Getting Started

Default uppercasing and the classic Turkish city demo.

Example 1 — Basic toLocaleUpperCase()

MDN-style demo: uppercase a simple ASCII word with the host locale.

JavaScript
"alphabet".toLocaleUpperCase();
// "ALPHABET"
Try It Yourself

How It Works

With no locales argument, the engine uses the default locale. For Latin letters like these, the result matches toUpperCase().

Example 2 — istanbul in English vs Turkish

MDN Try it demo: the same city name uppercases differently by locale.

JavaScript
const city = "istanbul";

console.log(city.toLocaleUpperCase("en-US"));
// Expected output: "ISTANBUL"

console.log(city.toLocaleUpperCase("TR"));
// Expected output: "İSTANBUL"
Try It Yourself

How It Works

English maps i → plain I. Turkish maps i → dotted capital İ (U+0130), which is what Turkish readers expect.

🔧 Locale Details

Length changes and locale arrays.

Example 3 — German ß Expands

MDN demo: uppercasing is not always one character to one character.

JavaScript
"Gesäß".toLocaleUpperCase();
// "GESÄSS"

console.log("Gesäß".length);                 // 5
console.log("Gesäß".toLocaleUpperCase().length); // 6
Try It Yourself

How It Works

German sharp s (ß) uppercases to SS, so the result string is longer. Round-tripping with lower/upper is not always stable.

Example 4 — Lithuanian and Locale Lists

MDN demo: combining-dot i under Lithuanian, plus a locale array (first wins).

JavaScript
"i\u0307".toLocaleUpperCase("lt-LT");
// "I"

const locales = ["lt", "LT", "lt-LT", "lt-u-co-phonebk", "lt-x-lietuva"];
"i\u0307".toLocaleUpperCase(locales);
// "I"
Try It Yourself

How It Works

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
Try It Yourself

How It Works

Pass the same locale you use for formatting and sorting so case, collation, and display stay consistent for that language.

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

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

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.

Universal Widely available
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · 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.

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.

Continue with toLocaleLowerCase(), replace(), or the String methods hub.

💡 Best Practices

✅ Do

  • Pass the UI language when casing user-facing text
  • 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

Key Takeaways

Knowledge Unlocked

Five things to remember about String.toLocaleUpperCase()

Locale-aware uppercase — first locale wins, length may grow.

5
Core concepts
🌐 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.

More String Methods

Return to the hub for slice, trim, replace, and more.

String methods hub →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful