Title Case, Sentence Case, camelCase: When to Use Each

Capitalization choices seem trivial until they aren't. Wrong case in a URL breaks links. Wrong case in code causes runtime errors. Wrong case in a headline signals carelessness to editors and readers alike. Here's a complete guide to every major case style and exactly where each one belongs.

Title Case: The Headline Convention

Title case capitalizes the first letter of most words in a phrase, with short function words (prepositions, articles, conjunctions) left lowercase unless they start the title. Example: The Quick Brown Fox Jumps Over the Lazy Dog.

The trouble is that "most words" is where style guides disagree. The two dominant standards are:

AP Style (Associated Press)

Capitalize all words of four letters or more, plus shorter words that are verbs, adjectives, or adverbs. Articles (a, an, the), coordinating conjunctions (and, but, or, for, nor), and prepositions under four letters (at, by, in, of, on, to, up) are lowercase unless they open or close the title. AP style is standard in journalism and news media.

Chicago Style

The Chicago Manual of Style follows a similar framework but treats all prepositions as lowercase regardless of length. This means "throughout," "beneath," and "against" stay lowercase in Chicago style but may be capitalized in AP. Chicago style is standard in books, academic writing, and many editorial contexts.

For web content, consistency matters more than picking the "right" style. Pick one, document it in a style guide, and apply it everywhere.

Sentence Case: The UI Default

Sentence case capitalizes only the first word of a phrase and any proper nouns, treating the rest as regular prose. Example: The quick brown fox jumps over the lazy dog.

Sentence case has become the dominant convention for digital interfaces. Apple, Google, Microsoft, and most major software companies use sentence case for button labels, menu items, dialog titles, and form field labels. The reasoning is accessibility and naturalness: sentence case is what readers are conditioned to in running text, so it reduces cognitive friction in UI contexts.

If you're writing for a web app, mobile app, or SaaS product, sentence case is almost certainly the right choice for interface text — even if your blog posts use title case.

ALL CAPS: Warnings, Acronyms, and Not Much Else

ALL CAPS communicates urgency or importance, but overuse dilutes both effects. Appropriate uses include:

ALL CAPS in body text is generally considered shouting — avoid it for anything longer than a few words.

camelCase and PascalCase in Programming

These two cases look similar but serve different purposes in code.

camelCase

camelCase starts with a lowercase letter and capitalizes the first letter of each subsequent word. Examples: getUserData, totalItemCount, isLoggedIn. It is the standard convention for variable names and function names in JavaScript, Java, C#, and Swift.

PascalCase (UpperCamelCase)

PascalCase capitalizes the first letter of every word, including the first. Examples: UserProfile, HttpRequest, MainController. PascalCase is standard for class names and component names across virtually all object-oriented languages, and for React component names specifically.

The distinction matters: in many languages, calling a function GetUserData() when the convention is getUserData() won't cause an error — but it signals to every other developer that the code was written by someone unfamiliar with the conventions of that language or team. Consistency with naming conventions is part of writing maintainable code.

snake_case: Python and Databases

snake_case uses all lowercase letters with underscores as word separators. Examples: user_profile, total_count, get_all_records. Snake_case is the official convention for:

Database column names in snake_case matter practically: SQL is case-insensitive in most implementations, and mixing case conventions in column names causes confusion and errors when those column names are referenced in application code that is case-sensitive.

kebab-case: URLs and CSS

Kebab-case (also called spinal-case or slug-case) uses all lowercase letters with hyphens as word separators. Examples: user-profile, main-navigation, how-to-calculate-bmi.

Kebab-case is the standard for:

title

Convert Text Case Instantly

Switch between Title Case, sentence case, camelCase, snake_case, kebab-case, and more in one click.

arrow_forward Convert Text Case

SCREAMING_SNAKE_CASE: Constants

SCREAMING_SNAKE_CASE combines the all-caps convention with underscores. Examples: MAX_RETRIES, DEFAULT_TIMEOUT_MS, API_BASE_URL. This convention is used for constants — values that are defined once and never changed — in most languages: JavaScript (by convention), Python, Java, C, and C++. The ALL CAPS signals to any reader of the code that this value is fixed, not mutable.

Train-Case: HTTP Headers

Train-Case capitalizes the first letter of each word and uses hyphens as separators. Examples: Content-Type, Accept-Encoding, X-Api-Key. It appears almost exclusively in HTTP headers. If you're working with HTTP APIs and writing header names manually, Train-Case is the expected format.

Comparison Table

Case Style Example Primary Use
Title CaseThe Quick Brown FoxHeadlines, book titles
Sentence caseThe quick brown foxUI text, body copy
ALL CAPSTHE QUICK BROWN FOXAcronyms, warnings, constants
camelCasetheQuickBrownFoxJS/Java/Swift variables and functions
PascalCaseTheQuickBrownFoxClass names, React components
snake_casethe_quick_brown_foxPython, database columns
kebab-casethe-quick-brown-foxURLs, CSS classes, HTML attributes
SCREAMING_SNAKE_CASETHE_QUICK_BROWN_FOXConstants in most languages
Train-CaseThe-Quick-Brown-FoxHTTP headers

When Wrong Case Breaks Things

Capitalization mistakes aren't always cosmetic. They can break functionality:

Getting case right is not just a style preference — it's defensive programming and defensive writing. Use consistent conventions, enforce them with linters in code and style guides in writing, and use a case converter when you need to transform text between conventions quickly.