How to lowercase string - JavaScript

Mo Ibra

Mo Ibra

Jan 5, 2023

In this article we will learn how to lowercase a string in JavaScript.

It is very common to lowercase a string in JavaScript in JavaScript.


Now we have a problem which is that we want to lowercase a string.

Now let's imagine that we have an string like this:


And want to lowercase this string to became like this:

"hello world!"

How to solve this problem?

The solution to this problem is easy, especially since there is a built-in function that does this called toLowerCase().

lowercase a string using toLowerCase

As we said before, we can use toLowerCase method to lowercase our string.

Let's see an example:

// String
const string = "HELLO WORLD!";

// lowercase your string
const lowercase = string.toLowerCase();

// Result:


hello world!

Thank you for reading

Thank you for reading my blog. 🚀

Suggestions For More Articles: