Favorites

JavaScript String.prototype.toUpperCase() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
String.prototype.toUpperCase()
JavaScript String Instance methodThis method is supported by all modern browsers.
Updated 28th November 2026

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

console.log('hello'.toUpperCase());
const word = 'javascript';
console.log(word[0].toUpperCase() + word.slice(1));
console.log('straße'.toUpperCase());

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.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee