Lodash _.startCase() 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 _.startCase() confidently in real JavaScript projects.

01

Core syntax

_.startCase(string)

02

Title words

Capitalize each word

03

UI labels

Keys to headings

04

snake input

Underscore boundaries

05

vs capitalize

One word vs all words

06

Production tips

Acronym caveats

What Is _.startCase()?

_.startCase() transforms strings into Start Case—each word capitalized and separated by spaces. It turns machine-friendly keys like product_description into readable labels like Product Description.

💡
Beginner tip

Use _.startCase('hello world') for display text, not for variable names—use _.camelCase() for identifiers.

📝 Syntax

javascript
_.startCase([string=''])

Syntax Rules

  • string — Input to transform (defaults to empty string).
  • Word split — Splits on spaces, underscores, hyphens, and case transitions.
  • Casing — First char of each word upper; rest lower.
  • Separator — Output words joined with single spaces.
  • Return — New string; input unchanged.
javascript
import startCase from "lodash/startCase";

const originalString = "hello world";
const formatted = startCase(originalString);
// -> "Hello World"

⚡ Quick Reference

TaskCode patternResult
Plain phrase_.startCase('hello world')Hello World
snake_case_.startCase('foo_bar')Foo Bar
camelCase_.startCase('fooBar')Foo Bar
UI label_.startCase(fieldKey)Readable heading
vs capitalize_.capitalize('hello world')Hello world
Empty_.startCase('')''
Mutates?
No

New string

Output sep
space

Between words

vs capitalize
all words

First char only

Input
any

snake, camel, spaces

🧰 Parameters

string Required

Value to convert. Handles mixed case and delimiter-separated words.

_.startCase('foo_bar')
return value Start Case

Space-separated title words.

-> 'Foo Bar'
acronyms Caveat

Short uppercase tokens may be lowercased incorrectly.

// usa -> Usa
empty/null Safe

Missing input yields empty or default handling.

_.startCase('')

Examples Gallery

Practical _.startCase() patterns with sample output and interactive Try It Yourself labs.

📚 Getting Started

Capitalize each word in a simple phrase.

Example 1 — Basic phrase formatting

Turn a lowercase greeting into title-style words.

javascript
const originalString = "hello world";
const formattedString = _.startCase(originalString);

console.log(formattedString);
// -> "Hello World"
Try It Yourself

How It Works

Each word gets an initial capital letter; remaining letters are lowercased.

📚 Practical Patterns

Format keys and identifiers for display.

Example 2 — snake_case and kebab-case input

Convert database-style keys to human-readable labels.

javascript
const key = "first_name last-name";
const label = _.startCase(key);

console.log(label);
// -> "First Name Last Name"
Try It Yourself

How It Works

Underscores and hyphens become word breaks before title-casing.

Example 3 — Dynamic UI label

Render a form label from a config key.

javascript
const fieldKey = "customer_firstname";
const label = _.startCase(fieldKey);

console.log(label);
// -> "Customer Firstname"
Try It Yourself

How It Works

Pair with i18n when you need translations; startCase is a quick English default.

Example 4 — Acronym caveat

See how acronyms are affected.

javascript
const text = "united states of america (usa)";
const formatted = _.startCase(text);
// -> "United States Of America (Usa)"

Example 5 — vs _.capitalize()

Compare single-word vs per-word capitalization.

javascript
const s = "hello world";

console.log(_.capitalize(s));  // Hello world
console.log(_.startCase(s));   // Hello World

📚 Beyond the Basics

Edge cases and defaults.

Example 6 — Empty input handling

Provide a fallback when the source string is empty.

javascript
const emptyString = "";
const display = _.startCase(emptyString || "default");
// -> "Default" (when using || fallback before call)

How It Works

Validate input before formatting; lodash treats empty string as empty output.

📋 Related operations

Topic_.startCase_.capitalize_.camelCase
ScopeEvery wordFirst char onlyIdentifier style
SeparatorSpacesUnchangedNone
Use caseLabels, titlesSentence startJS properties
snake inFoo Barfoo_bar unchanged*fooBar

🧠 How _.startCase() Works

1

Split words

Identify word boundaries from case changes and delimiters.

Parse
2

Lowercase rest

Lowercase all characters in each word first.

Normalize
3

Capitalize

Uppercase the first character of each word.

Case
=

Join

Combine words with spaces into the final string.

📝 Notes

  • Designed for display text, not variable naming.
  • Acronyms and abbreviations may need manual fixes after formatting.
  • Underscores and hyphens in input become spaces in output.
  • Compare with _.capitalize() for sentence-level casing.
  • Import lodash/startCase for bundle-friendly usage.

Conclusion

_.startCase() is a practical Lodash string helper. Use the patterns above in your projects and explore the next method in the series.

❓ Frequently Asked Questions

It converts a string to start case: the first letter of each word is uppercase, remaining letters in each word are lowercase, words are separated by spaces.
_.capitalize() only uppercases the first character of the entire string. _.startCase() treats each word separately.
Yes. Underscores and hyphens are treated as word boundaries, so first_name becomes First Name.
Not reliably. USA may become Usa because each word is title-cased. Post-process acronyms if needed.
Similar visually, but _.startCase() returns a new string you can store or bind—not a CSS style.
UI labels, table headers, human-readable titles from machine keys, and formatting user-facing text from slugs.
Did you know?

_.startCase() capitalizes the first letter of each word and lowercases the rest—perfect for turning customer_first_name into display text.

Practice _.startCase() in the Live Editor

Open the Try It editor and run the examples from this tutorial.

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