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.
Fundamentals
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.
Foundation
📝 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"
Cheat Sheet
⚡ Quick Reference
Task
Code pattern
Result
Basic conversion
_.toLower("Hello")
"hello"
User input
_.toLower(input)
Normalized text
Compare
_.toLower(a) === _.toLower(b)
Case-insensitive
Map array
items.map(_.toLower)
Batch normalize
Native alt
str.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
Reference
🧰 Parameters
stringRequired
The input to convert. Lodash coerces arrays and numbers to strings before lowercasing.
_.toLower(userInput)
return valueNew string
A lowercase copy of the input. Original value unchanged.
const key = _.toLower(name)
coercionAutomatic
Passing null or undefined yields string forms like "null" / "undefined".
_.toLower(null) // "null"
UnicodeImportant
Most Latin letters map predictably; test locale-sensitive inputs separately.
// Turkish İ edge cases
Hands-On
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"
_.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.
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
Summary
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().