JavaScript String toLocaleUpperCase() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Method

Definition

String.prototype.toLocaleUpperCase(locales?) returns a new uppercased string using locale-specific case rules. For most Latin text it matches toUpperCase(); languages like Turkish can differ.

Pass the required arguments shown below. Check return values and browser support before you rely on the result.

Syntax

Call string.toLocaleUpperCase. Start with this line.

JavaScript
str.toLocaleUpperCase(locales?)
CallWhat it does
str.toLocaleUpperCase(locales?)Primary signature.
string.toLocaleUpperCase(...)Call with the arguments your case needs.

Built into JavaScript. Call toLocaleUpperCase(...) on a string (or String instance) — no import required.

Library declarations
JavaScript
str.toLocaleUpperCase(locales?)

Parameters

ParameterDescription
localesOptional. BCP 47 tag or array; default = host locale

Return Value

Return ValueDescription
*New uppercased string

JavaScript Examples

Example 1 — Basic Locale Uppercase

Uppercase a string with the host default locale (or a simple Latin locale).

JavaScript
const text = "hello";

console.log(text.toLocaleUpperCase());
// "HELLO"

console.log(text);  // "hello" (unchanged)
Try It Yourself

How It Works

  1. Start with text. text is lowercase "hello".
  2. Call the method. No locale arg → host default case mapping.
  3. Get a new string. Result is "HELLO".
  4. Original stays put. Strings are immutable.

Example 2 — Turkish vs English Locale

Pass a BCP 47 tag when language-specific case rules matter.

JavaScript
const city = "istanbul";

console.log(city.toLocaleUpperCase("tr"));
// "İSTANBUL"

console.log(city.toLocaleUpperCase("en-US"));
// "ISTANBUL"
Try It Yourself

How It Works

  1. Start with i. Plain Latin small letter i.
  2. Turkish mapping. "tr" uppercases it to dotted İ (U+0130).
  3. English mapping. "en-US" produces plain I.
  4. Pass the UI language. Case folding for display should match the user’s locale.

Example 3 — toLocaleUpperCase vs toUpperCase

They often match; choose locale-aware when language rules can differ.

JavaScript
const city = "istanbul";

console.log(city.toLocaleUpperCase("tr"));
console.log(city.toUpperCase());

console.log("hello".toLocaleUpperCase() === "hello".toUpperCase());
// true for simple Latin text

console.log("straße".toLocaleUpperCase("de"));
// "STRASSE"  (length grows)
Try It Yourself

How It Works

  1. Locale-aware path. toLocaleUpperCase("tr") applies Turkish rules.
  2. Default Unicode path. toUpperCase() does not take a locale.
  3. ASCII is boring (in a good way). Simple Latin often matches on both APIs.
  4. Watch expansions. Characters like ß can become two letters when uppercased.

Browser & Runtime Support

String.prototype.toLocaleUpperCase() is widely available. The optional locales argument is supported in modern browsers and Node.js.

✓ Baseline · Widely available

String.toLocaleUpperCase()

Supported in modern browsers and Node.js. Prefer an explicit locales tag when your app must behave the same across hosts.

98% Modern browser support
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: Safe for modern web apps. For ASCII-only pipelines, toUpperCase() is fine; for multilingual UI, pass the active locale explicitly.

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.

Next: toLowerCase()

Learn the simple Unicode default lowercasing method.

toLowerCase() tutorial →

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.

10 people found this page helpful