Lodash _.lowerFirst() Method

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

What You’ll Learn

By the end of this tutorial, you’ll confidently use Lodash’s _.lowerFirst() method in real JavaScript projects.

01

Core syntax

Call _.lowerFirst(string) for camelCase.

02

First char only

Rest of string unchanged.

03

Identifiers

Convert PascalCase to camelCase.

04

API keys

Normalize object property names.

05

vs lowerCase

Single char vs full string.

06

Pair upperFirst

Round-trip casing helpers.

What Is _.lowerFirst()?

It lowercases the first character of a string and leaves all other characters unchanged.

💡
Beginner tip

Import only what you need: import lowerFirst from "lodash/lowerFirst" keeps bundles small.

📝 Syntax

javascript
_.lowerFirst([string=''])
javascript
import lowerFirst from "lodash/lowerFirst";

const original = "HelloWorld";
const result = lowerFirst(original);

console.log(result);
// -> "helloWorld"

⚡ Quick Reference

TaskCode patternResult
PascalCase fix_.lowerFirst('HelloWorld')helloWorld
Label to key_.lowerFirst('UserName')userName
Map object keys_.mapKeys(obj, (_, k) => _.lowerFirst(k))camelCase keys
Array of namesnames.map(_.lowerFirst)Batch convert
Opposite_.upperFirst(str)HelloWorld
Full lower_.lowerCase(str)hello world
Mutates?
No

Returns new string

Scope
First char

Rest unchanged

Style
camelCase

JS identifiers

Opposite
_.upperFirst()

Capitalize first

🧰 Parameters

Every argument to _.lowerFirst() and what it controls:

stringOptional

The string to transform. When omitted or empty, returns an empty string.

_.lowerFirst('HelloWorld')
return valueNew string

First character lowercased; all following characters unchanged. The original string is not mutated.

// -> 'helloWorld'
scopeImportant

Only index 0 is modified. Internal capitals like jOhN stay as-is after the first character.

_.lowerFirst('jOhN')
pair withmapKeys

Combine with _.mapKeys to rename PascalCase API keys to camelCase in one pass.

_.mapKeys(obj, (_, k) => _.lowerFirst(k))

For spaced lowercase words, use _.lowerCase(). For full identifier restructuring, use _.camelCase().

Examples Gallery

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

📚 Getting Started

Lowercase the first character while preserving the rest.

Example 1 — Basic PascalCase to camelCase

Convert a capitalized identifier to camelCase style.

javascript
const original = "HelloWorld";
const result = _.lowerFirst(original);

console.log(result);
// -> "helloWorld"
Try It Yourself

How It Works

Only H changes; elloWorld stays the same.

📈 Practical Patterns

Format labels, user input, and object keys.

Example 2 — Format a property name

Turn a label-style name into a camelCase object key.

javascript
const label = "UserName";
const key = _.lowerFirst(label);

console.log(key);
// -> "userName"
Try It Yourself

How It Works

Common when mapping UI labels to JavaScript property names.

Example 3 — Transform API request keys

Convert PascalCase keys from an external API to camelCase.

javascript
const requestData = {
  UserName: "john_doe",
  EmailAddress: "john@example.com"
};

const formatted = _.mapKeys(requestData, (_, key) =>
  _.lowerFirst(key)
);

console.log(formatted);
// -> { userName: "john_doe", emailAddress: "john@example.com" }
Try It Yourself

How It Works

Combine with _.mapKeys to reshape objects in one step.

Example 4 — Batch transform with map

Apply lowerFirst to every item in an array of field names.

javascript
const fields = ["FirstName", "LastName", "EmailAddress"];
const camelFields = fields.map(_.lowerFirst);

console.log(camelFields);
// -> ["firstName", "lastName", "emailAddress"]

How It Works

Pass _.lowerFirst directly as a callback to map.

🚀 Beyond the Basics

Edge cases and comparison with related helpers.

Example 5 — Already lowercase first character

Strings that already start lowercase are returned effectively unchanged.

javascript
const input = "jOhN";
const result = _.lowerFirst(input);

console.log(result);
// -> "jOhN" (first char already lower)

How It Works

Only the first character is considered; other capitals remain.

Example 6 — Pair with _.upperFirst()

See lowerFirst and upperFirst as inverse first-character operations.

javascript
import lowerFirst from "lodash/lowerFirst";
import upperFirst from "lodash/upperFirst";

const camel = "helloWorld";
const pascal = "HelloWorld";

console.log(upperFirst(camel));   // -> "HelloWorld"
console.log(lowerFirst(pascal));  // -> "helloWorld"

// Round-trip:
console.log(lowerFirst(upperFirst(camel)));  // -> "helloWorld"

How It Works

Use together when normalizing identifiers from different sources.

🧠 How _.lowerFirst() Works

1

Receive input string

Lodash coerces null/undefined to empty string.

Input
2

Read first character

Only the initial code unit is targeted.

First
3

Lowercase if needed

Uppercase first letter becomes lowercase.

Transform
=

Concatenate remainder

Original tail is appended unchanged.

Output

📝 Notes

  • _.lowerFirst() affects only the first character.
  • For full camelCase from arbitrary strings, use _.camelCase().
  • Surrogate pairs (some emoji) may need extra care—test edge cases.
  • Pair with _.upperFirst() for round-trip formatting.
  • Empty strings return empty strings.
  • Does not insert or remove spaces between words.

Conclusion

_.lowerFirst() is the precise tool when you need camelCase identifiers from PascalCase names—only the first letter changes, so UserName becomes userName without touching internal capitals.

For full string restructuring or search normalization, use _.camelCase() or _.lowerCase() instead.

💡 Best Practices

✅ Do

  • Use for PascalCase to camelCase conversion
  • Map API keys with _.mapKeys and lowerFirst
  • Pass as callback to Array.map for batch work
  • Keep identifier formatting in one utility
  • Test empty strings and single-character input

❌ Don’t

  • Use when you need full lowerCase word spacing
  • Expect it to lowercase every capital letter
  • Confuse with _.camelCase for arbitrary strings
  • Assume it handles multi-code-point graphemes always
  • Mutate strings in place (strings are immutable)

Key Takeaways

Knowledge Unlocked

Five things to remember about _.lowerFirst()

5
Core concepts
02

camelCase

JS identifiers.

Pattern
03

mapKeys

API normalization.

Object
04

lowerCase

Full string style.

Compare
05

upperFirst

Opposite helper.

Related

❓ Frequently Asked Questions

It lowercases the first character of a string and leaves all other characters unchanged.
_.lowerCase() lowercases the entire string and inserts spaces between words. _.lowerFirst() only affects the first character.
When converting PascalCase or capitalized names to camelCase JavaScript identifiers or JSON keys.
The string is returned with no effective change to the first character.
Yes. An empty string is returned unchanged.
Yes. _.upperFirst() uppercases only the first character.
Did you know?

_.lowerFirst() is the inverse of _.upperFirst()—both touch only the first character. For full camelCase from arbitrary strings (with word splitting), use _.camelCase() instead.

Practice _.lowerFirst() in the Live Editor

Open the Try It editor and run the examples with your own input.

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