JavaScript String.prototype.toUpperCase() Method
The toUpperCase() method returns a copy of a string with all letters converted to upper case.
Description
The toUpperCase() method returns the string converted to upper case. Some characters change length: the German "ß" becomes "SS". To capitalize only the first letter, combine it with slice().
Upper-casing follows Unicode's default rules; for language-specific behavior, such as Turkish, use toLocaleUpperCase() with the language code. Because some characters expand into several, the result can be longer than the original string.
For display purposes, the CSS text-transform: uppercase property changes how text looks without changing the underlying text, which is better for accessibility and copying. Use toUpperCase() when the data itself needs to be in capitals, such as codes and identifiers.
Syntax
string.toUpperCase()Return Value
A new string converted to upper case.
Example
Browser Support
The following information will show you the current browser support for the String.prototype.toUpperCase() method. Hover over a browser icon to see the version that first introduced support for this method.
Desktop





Tablets & Mobile





