JavaScript toLowerCase(): Convert Text to Lowercase

The toLowerCase() method returns a new string with letters converted to lowercase. It does not change the original string.

const text = "Welcome To Plus2net";
const lower = text.toLowerCase();
console.log(lower); // welcome to plus2net

toLowerCase() syntax Top ↑

string.toLowerCase()

The method takes no arguments and returns a new string.

Original string is unchanged Top ↑

const original = "JavaScript";
const changed = original.toLowerCase();
console.log(original); // JavaScript
console.log(changed);  // javascript

Strings are immutable, so store the returned value when you need the converted text.

Convert user input as it is typed Top ↑

Result:

const input = document.getElementById('lowerDemo');
input.addEventListener('input', () => {
  result.textContent = input.value.toLowerCase();
});

This modernizes the original onKeyUp demo while keeping the same teaching goal. See keyboard event handling.

Case-insensitive comparisons Top ↑

const a = "JavaScript";
const b = "javascript";
console.log(a.toLowerCase() === b.toLowerCase()); // true

Normalizing both values is useful for simple case-insensitive comparisons.

Locale-sensitive case conversion Top ↑

const city = "İSTANBUL";
console.log(city.toLocaleLowerCase("tr"));

For language-sensitive casing, consider toLocaleLowerCase().

Common mistakes Top ↑

Do not expect the original variable to change automatically, and do not use lowercase conversion as a substitute for full locale-aware collation or security normalization.

Previous / String Reference Next related topic




Subscribe to our YouTube Channel here



plus2net.com







shreejith

22-09-2010

hey i have a difficultly that is i want to convert lowercase to uppercase and vice-verse without using tolowercase() or touppercase()..please help
jango

29-09-2015

Thanks for the post. Is there a way I can convert to lower case without using the javascript method "toLowerCase()"? If there is, you post that. Thanks in advance



✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer