VOOZH about

URL: https://www.geeksforgeeks.org/javascript/javascript-string-touppercase-method/

⇱ JavaScript String toUpperCase() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

JavaScript String toUpperCase() Method

Last Updated : 16 Jan, 2026

The toUpperCase() method is used to convert all letters in a string to uppercase. It helps standardize text for comparison or display.

  • Converts all lowercase letters to uppercase.
  • Special characters and digits remain unchanged.
  • Letters that are already uppercase stay the same.

Syntax:

str.toUpperCase()

Parameters:

This method does not accept any parameter.

Return value:

The toUpperCase() method returns a modified version of the original string. It creates a new string with all letters converted to uppercase.

  • Returns a new string.
  • All lowercase letters are converted to uppercase.
  • The original string remains unchanged.

[Example 1]: In this example, we are converting the given string to uppercase.

[Example 2]: In this example, the method toUpperCase() converts all the lower case alphabets to their upper case equivalents without affecting the special characters and the digits. 

[Example 3]: In this example, we are creating an array of data with elements 'javascript', 'html', and 'css'. It uses map() and toUpperCase() to convert each element to uppercase.

Comment