Convert String to Lowercase JavaScript

To convert a string into lowercase in JavaScript use the toLowerCase() function.

 

toLowerCase() Syntax

Pass the string to convert before the toLowerCase() function using a . (dot).

 

string.toLowerCase()

 

toLowerCase() accepts no arguments and does not modify the original string, so you'll need to store the result in a variable or use it immediately.

 

JavaScript Lowercase Example

Here is an example of converting a string containing letters in mixed casing to lowercase.

 

var  hello = 'hElLo WoRlD!';

console.log(hello.toLowerCase());
hello world!