JavaScript String toLowerCase() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Method

Definition

String.prototype.toLowerCase() returns a new lowercased string using Unicode default case mappings. Ideal for simple case-insensitive checks. The original string is never changed.

Pass the required arguments shown below. Check return values and browser support before you rely on the result.

Syntax

Call string.toLowerCase. Start with this line.

JavaScript
str.toLowerCase()
CallWhat it does
str.toLowerCase()Primary signature.
string.toLowerCase(...)Call with the arguments your case needs.

Built into JavaScript. Call toLowerCase(...) on a string (or String instance) — no import required.

Library declarations
JavaScript
str.toLowerCase()

Parameters

This member has no parameters beyond those shown in the signature.

Return Value

Return ValueDescription
*New lowercased string

JavaScript Examples

Example 1 — Basic Lowercase

Convert mixed-case text with Unicode default mappings.

JavaScript
const text = "Hello World";

console.log(text.toLowerCase());
// "hello world"

console.log(text);  // "Hello World" (unchanged)
Try It Yourself

How It Works

  1. Start with text. text holds mixed-case letters.
  2. Call the method. toLowerCase() applies Unicode default mappings.
  3. Get a new string. Result is "hello world".
  4. Original stays put. Strings are immutable.

Example 2 — Case-Insensitive Compare

Lowercase both sides before checking equality.

JavaScript
const a = "JavaScript";
const b = "javascript";

console.log(a.toLowerCase() === b.toLowerCase());
// true
Try It Yourself

How It Works

  1. Different casing. a and b look different as written.
  2. Normalize both. Call toLowerCase() on each side.
  3. Compare equals. Both become "javascript" → true.
  4. Common pattern. Useful for tags, commands, and simple matching.

Example 3 — toLowerCase vs toLocaleLowerCase

Default mapping ignores locale; Turkish rules can differ for İ.

JavaScript
const city = "İstanbul";

console.log(city.toLowerCase());
console.log(city.toLocaleLowerCase("tr"));

console.log("HELLO".toLowerCase() === "HELLO".toLocaleLowerCase());
// true for simple Latin text
Try It Yourself

How It Works

  1. Default path. toLowerCase() uses Unicode defaults (no locale).
  2. Locale path. toLocaleLowerCase("tr") applies Turkish rules for İ.
  3. ASCII is boring. Simple Latin often matches on both APIs.
  4. Rule of thumb. User-facing multilingual text → locale method; simple ASCII → toLowerCase is fine.

Browser & Runtime Support

String.prototype.toLowerCase() has been available since the earliest JavaScript engines. Safe everywhere.

✓ Baseline · Widely available

String.toLowerCase()

Supported in all modern browsers and Node.js. No polyfill needed for everyday use.

100% Modern browser support
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
toLowerCase() Excellent

Bottom line: Safe for every environment. Prefer toLocaleLowerCase() when language-specific case rules matter.

Frequently Asked Questions

String.prototype.toLowerCase() returns a new string with characters converted to lowercase using Unicode default case mappings. It takes no arguments.
No. Strings are immutable. toLowerCase() returns a new lowercased string; the original stays unchanged.
toLowerCase always uses Unicode default mappings. toLocaleLowerCase can follow language-specific rules (for example Turkish İ). Prefer toLocaleLowerCase for user-facing text in a known language.
Normalize both sides: a.toLowerCase() === b.toLowerCase(). For Turkish and similar locales, use toLocaleLowerCase with the same locale on both sides.
No. If you need locale-aware lowercasing, use toLocaleLowerCase(locales).
Use toUpperCase when you need uppercase text. The APIs are mirrors of each other for default Unicode mappings.

Next: trim()

Learn how to remove whitespace from both ends of a string.

trim() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

10 people found this page helpful