Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

JavaScript String toLowerCase() Method

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

Javascript str.toLowerCase() method converts the entire string to lowercase. This method does not affect any of the special characters, digits, and the alphabet that are already in lowercase.

Syntax:

str.toLowerCase()

Return value: This method returns a new string in which all the upper-case letters are converted to lowercase.

Example 1: Below is an example of the String toLowerCase() Method.

JavaScript




function func() {
    let str = 'GEEKSFORGEEKS';
    let string = str.toLowerCase();
    console.log(string);
}
func();

Output: 

geeksforgeeks

Example 2: In this example, the method toLowerCase() converts all the upper case alphabets into lower case alphabets without affecting the special characters, digits, and all those characters that are already in the lower case.

JavaScript




// JavaScript Program to illustrate
//  toLowerCase() method
 
function func() {
 
    // Original string
    let str = 'It iS a Great Day.';
 
    // Converting to lower case
    let string = str.toLowerCase();
    console.log(string);
}
 
func();

Output: 

it is a great day.

Example 3: In this example, the method toLowerCase() converts all the upper case alphabets into lower case alphabets without affecting the special characters, digits, and all those characters that are already in lower case.

JavaScript




// JavaScript Program to illustrate
//  toLowerCase() method
 
function func() {
 
    //Original string
    let str = 'It iS a 5r&e@@t Day.';
 
    //Converting to lower case
    let string = str.toLowerCase();
    document.write(string);
}
 
func();

Output: 

it is a 5r&e@@t day.

We have a complete list of Javascript string methods, to check those please go through this Javascript String Complete reference article.

Supported Browser:

  • Chrome 1 and above
  • Edge 12 and above
  • Firefox 1 and above
  • Internet Explorer 3 and above
  • Opera 3 and above
  • Safari 1 and above

My Personal Notes arrow_drop_up
Last Updated : 22 May, 2023
Like Article
Save Article
Related Tutorials