String.prototype.toUpperCase()

Returns the calling string converted to uppercase.

Since ES1 Spec ↗

Syntax

str.toUpperCase()

Returns

string — A new uppercase string.

Examples

console.log('Hello'.toUpperCase());
Output
HELLO
console.log('abc123'.toUpperCase());
Output
ABC123

Notes

Uses locale-independent Unicode case mappings. For locale-aware conversion (e.g. Turkish dotted I) use `toLocaleUpperCase`. Does not mutate the original.

Browser & runtime support

EnvironmentSince version
chrome 1.0
firefox 1.0
safari 1.0
edge 12
node 0.10

See also