Lodash _.toLower() Method

Beginner
⏱️ 7 min read
📚 Updated: Jul 2026
🎯 6 Examples + 3 Try It
String utilities

What You’ll Learn

By the end of this tutorial, you’ll use Lodash’s _.toLower() confidently in real string workflows.

01

Core Syntax

Call _.toLower(string) on any string value.

02

Non-Mutating

Returns a new lowercase string; the source stays unchanged.

03

Normalize Input

Standardize user input and external data before storage.

04

Case-Insensitive

Pair with comparisons to ignore letter casing.

05

Unicode Aware

Understand locale edge cases vs native methods.

06

Production Tips

Know when native toLowerCase() is enough.

What Is _.toLower()?

_.toLower() is a Lodash string helper that converts every character in the input string to lowercase. It is the string counterpart to _.toUpper() and a convenient choice when you already import other Lodash utilities in a module.

💡
Beginner tip

Think of _.toLower(userInput) as “make this text safe for case-insensitive matching or storage.” The original variable keeps its original casing.

📝 Syntax

javascript
_.toLower(string)

Syntax Rules

  • string — The value to convert. Non-strings are coerced with String().
  • Return value — A new string with all characters lowercased.
  • Immutable — The input string reference is never modified.
  • Empty string — Returns "" unchanged.
javascript
import toLower from "lodash/toLower";

const original = "Hello World";
const result = toLower(original);
// -> "hello world"

⚡ Quick Reference

TaskCode patternResult
Basic conversion_.toLower("Hello")"hello"
User input_.toLower(input)Normalized text
Compare_.toLower(a) === _.toLower(b)Case-insensitive
Map arrayitems.map(_.toLower)Batch normalize
Native altstr.toLowerCase()No Lodash needed
Opposite_.toUpper(str)Uppercase output
Mutates?
No

Returns new string

Coerces?
Yes

Non-strings → string

Pair with
_.toUpper()

Opposite casing

Native
toLowerCase()

Built-in equivalent

🧰 Parameters

string Required

The input to convert. Lodash coerces arrays and numbers to strings before lowercasing.

_.toLower(userInput)
return value New string

A lowercase copy of the input. Original value unchanged.

const key = _.toLower(name)
coercion Automatic

Passing null or undefined yields string forms like "null" / "undefined".

_.toLower(null) // "null"
Unicode Important

Most Latin letters map predictably; test locale-sensitive inputs separately.

// Turkish İ edge cases

Examples Gallery

Practical _.toLower() patterns with copy-ready code and interactive Try It Yourself labs.

📚 Getting Started

Convert a simple string and verify the original stays intact.

Example 1 — Basic lowercase conversion

Convert Hello World to all lowercase.

javascript
const original = "Hello World";
const lower = _.toLower(original);

console.log(lower);
// -> "hello world"

console.log(original);
// still "Hello World"
Try It Yourself

How It Works

_.toLower() walks the string and returns a new lowercase copy. The original string is immutable.

📈 Practical Patterns

Normalize text for matching, search, and user input handling.

Example 2 — Case-insensitive comparison

Compare two strings without caring about letter casing.

javascript
const input = "HeLLo";
const target = "hello";

const match = _.toLower(input) === _.toLower(target);
console.log(match);
// -> true
Try It Yourself

How It Works

Lowercasing both sides removes casing differences before strict equality.

Example 3 — Normalize user input

Lowercase email-style identifiers before saving to a database.

javascript
const raw = "  User@Example.COM  ";
const normalized = _.toLower(_.trim(raw));

console.log(normalized);
// -> "user@example.com"
Try It Yourself

How It Works

Chain with _.trim() to strip whitespace, then lowercase for consistent storage.

Example 4 — Batch normalize tags

Map an array of mixed-case tags to lowercase slugs.

javascript
const tags = ["JavaScript", "LODASH", "Node"];
const slugs = tags.map(_.toLower);
// -> ["javascript", "lodash", "node"]

How It Works

Pass _.toLower directly to Array.prototype.map for concise batch processing.

🚀 Beyond the Basics

Native alternatives and when Lodash adds value.

Example 6 — Native toLowerCase() alternative

For a single plain string, the built-in method works without Lodash.

javascript
const text = "Hello World";
const native = text.toLowerCase();
const lodash = _.toLower(text);
// both -> "hello world"

How It Works

Prefer native toLowerCase() when Lodash is not already imported. Use _.toLower for consistent chaining with other Lodash helpers.

📋 Related string operations

Topic_.toLower_.toUppertoLowerCase()_.trim()
PurposeLowercase all charsUppercase all charsNative lowercaseRemove edge whitespace
MutatesNoNoNoNo
Coerces inputYesYesNo (TypeError if not string)Yes
Best forNormalize casingDisplay labelsSimple one-offClean user input

🧠 How _.toLower() Works

1

Receive input

Lodash coerces the value to a string if needed.

Input
2

Map characters

Each character is converted using Unicode lowercase rules.

Transform
3

Build result

Characters are joined into a new string value.

Output
=

Return string

The original input is unchanged; you get a lowercase copy.

Done

📝 Notes

  • _.toLower() is non-mutating—strings are immutable in JavaScript.
  • Non-string values are coerced to strings before conversion.
  • For case-insensitive equality, lowercase both operands.
  • Unicode edge cases (Turkish İ) may differ from locale-aware APIs.
  • Chain with _.trim() when normalizing form input.
  • Opposite helper: _.toUpper().

Conclusion

_.toLower() is a small but essential Lodash helper for normalizing text casing. Use it when you need consistent lowercase output alongside other Lodash string utilities, especially in pipelines that already depend on the library.

💡 Best Practices

✅ Do

  • Assign the return value—strings are immutable
  • Combine with related helpers when building normalization pipelines
  • Validate user input types before transforming
  • Test Unicode and locale-sensitive strings when relevant
  • Use native string.toLowerCase() when Lodash is not already imported

❌ Don’t

  • Expect the original string variable to change in place
  • Assume behavior matches locale-aware toLocaleLowerCase without testing
  • Trim or change casing before checking for empty input when order matters
  • Import all of Lodash for a single call if tree-shaking a tiny bundle
  • Forget to handle null/undefined coercion edge cases

Key Takeaways

01

New string

Non-mutating lowercase copy.

Basics
02

Normalize

Standardize user input.

Pattern
03

Compare

Case-insensitive matching.

Search
04

Coerce

Handles non-string input.

Edge case
05

toUpper

Opposite casing helper.

Next step

❓ Frequently Asked Questions

_.toLower() converts every character in a string to lowercase and returns the new string. The original string is not modified.
For plain strings they usually agree. Lodash coerces non-string values to strings first and keeps a consistent API alongside other _.string helpers.
No. Strings are immutable in JavaScript. _.toLower() always returns a new string value.
Yes. Compare _.toLower(a) === _.toLower(b) when you want to ignore casing differences.
Lodash uses Unicode-aware case mapping for many scripts, but edge cases like Turkish dotted I may still differ from locale-specific APIs.
Use _.toUpper() when you need uppercase output—for labels, codes, or display formatting that requires all caps.
Did you know?

_.toLower returns a new string and leaves the original untouched. For uppercase output see _.toUpper(), and for whitespace cleanup pair it with _.trim().

Practice _.toLower() in the Live Editor

Open Try It, run the examples, and experiment with your own strings.

Open Try It editor →

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.

6 people found this page helpful