In JavaScript, String.prototype.toUpperCase() returns a new uppercased string using Unicode default case mappings. The original string never changes. Ideal for simple case-insensitive checks paired with toLowerCase().
Remember
str.toUpperCase() → new UPPERCASE string
original string → unchanged
no arguments → none needed
locale rules matter? → use toLocaleUpperCase()
Syntax
Call toUpperCase on the string you already have. It takes no arguments.
JavaScript
str.toUpperCase()
Call
What it does
str.toUpperCase()
Returns a new string with letters converted to uppercase.
"hi".toUpperCase()
Works on string literals too — result is "HI".
Built into JavaScript. Call toUpperCase() on a string — no import needed. For language-specific rules (for example Turkish), prefer toLocaleUpperCase().
Library declarations
JavaScript
str.toUpperCase()
Parameters
This method takes no parameters.
Return Value
Return Value
Description
string
A new string with characters converted to uppercase.
JavaScript Examples
Example 1 — Basic Uppercase
Convert mixed-case text with Unicode default mappings.
JavaScript
const text = "Hello World";
console.log(text.toUpperCase());
console.log(text);
Default path.toUpperCase() uses Unicode defaults (no locale).
Locale path.toLocaleUpperCase("tr") applies Turkish rules for i → İ.
ASCII is simple. Everyday Latin text often matches on both APIs.
Compatibility
Browser & Runtime Support
String.prototype.toUpperCase() has been available since the earliest JavaScript engines. Safe everywhere.
✓ Baseline · Widely available
String.toUpperCase()
Supported in all modern browsers and Node.js. No polyfill needed for everyday use.
100%Modern browser support
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
toUpperCase()Excellent
Bottom line: Safe for every environment. Prefer toLocaleUpperCase() when language-specific case rules matter.
Frequently Asked Questions
String.prototype.toUpperCase() returns a new string with characters converted to uppercase using Unicode default case mappings. It takes no arguments.
No. Strings are immutable. toUpperCase() returns a new uppercased string; the original stays unchanged.
toUpperCase always uses Unicode default mappings. toLocaleUpperCase can follow language-specific rules (for example Turkish i → İ). Prefer toLocaleUpperCase for user-facing text in a known language.
Normalize both sides: a.toUpperCase() === b.toUpperCase(). For Turkish and similar locales, use toLocaleUpperCase with the same locale on both sides.
Use toLowerCase when you need lowercase text. The APIs are mirrors of each other for default Unicode mappings.