Whether you are drafting an editorial headline, cleaning up dirty customer spreadsheet data, or declaring programming variables in Python and TypeScript, applying the correct text casing convention is vital for readability and code syntax rules.
Using the wrong casing can break API routes, violate corporate style guides, or trigger compilation errors in programming languages.
In this guide, we break down every standard text casing format, compare editorial headline conventions, and explain standard developer naming practices.
🚀 Try the Live Utility: Convert text instantly between 12 distinct styles with one-click copy using our free Text Case Converter.
1. Complete Casing Conventions Taxonomy
Text casing conventions fall into two primary categories: Human Editorial Styles and Developer / Code Variable Styles.
| Convention Name | Example Output | Primary Use Case |
| :--- | :--- | :--- |
| Sentence case | The quick brown fox jumps. | Standard prose, body paragraphs, UI labels |
| Title Case | The Quick Brown Fox Jumps | Book titles, blog headers, major UI buttons |
| UPPERCASE | THE QUICK BROWN FOX | Acronyms, emergency warnings, legal clauses |
| lowercase | the quick brown fox | Search queries, email addresses, informal text |
| camelCase | theQuickBrownFox | JavaScript / TypeScript variables, JSON keys |
| PascalCase | TheQuickBrownFox | React components, C# / Java class definitions |
| snake_case | the_quick_brown_fox | Python variables, PostgreSQL / SQL columns |
| kebab-case | the-quick-brown-fox | Web URLs, CSS class names, package names |
| CONSTANT_CASE | THE_QUICK_BROWN_FOX | Environment variables (.env), global constants |
| dot.case | the.quick.brown.fox | Configuration keys, package domain names |
2. Editorial Title Case Rules: AP vs. Chicago Style
Converting text into proper Title Case is surprisingly complex because style guides differ on which minor words should remain lowercase:
Standard Rules for Title Case:
- Always capitalize the first word and the last word of the title, regardless of what part of speech they are.
- Capitalize all major words: Nouns, Verbs, Adjectives, Adverbs, and Pronouns.
- Keep minor words lowercase, including:
- Articles: a, an, the
- Coordinating Conjunctions: and, but, for, or, nor, so, yet
- Short Prepositions: at, by, for, in, of, on, to, up, with
Example Comparison:
- Incorrect Basic Capitalization:
How To Clear The Cache On A Phone(over-capitalizing minor articles and prepositions) - Correct AP / Chicago Title Case:
How to Clear the Cache on a Phone
3. Developer Naming Conventions Explained
In programming languages where spaces are illegal in variable identifiers, different casing standards have evolved:
camelCase (Lower Camel Case)
- First letter is lowercase; each subsequent concatenated word begins with a capital letter.
- Standard in: JavaScript, TypeScript, Swift, Kotlin, and Go.
- Example:
userAccountBalance,fetchArticleById
PascalCase (Upper Camel Case)
- Every word begins with a capital letter, including the first word.
- Standard in: React components, C# classes, TypeScript types & interfaces.
- Example:
UserProfileCard,ArticleDetailPage
snake_case (Underscore Separation)
- All words lowercase, separated by underscores.
- Standard in: Python (PEP 8 standard), Ruby, SQL database tables and column names.
- Example:
user_account_balance,created_at
kebab-case (Hyphen Separation)
- All words lowercase, separated by hyphens (also known as spinal-case or slug-case).
- Standard in: Web URLs (
/tools/text-case-converter), CSS selectors (.article-header), and npm package names. - Example:
download-time-calculator
4. How to Convert Casing in JavaScript / TypeScript
```typescript
// To Title Case (handling minor words):
const toTitleCase = (str: string) => {
const minor = new Set(['a', 'an', 'the', 'and', 'but', 'or', 'for', 'nor', 'on', 'at', 'to', 'by']);
return str.toLowerCase().replace(/\b\w+/g, (word, index) => {
if (index === 0 || !minor.has(word)) {
return word.charAt(0).toUpperCase() + word.slice(1);
}
return word;
});
};
// To camelCase:
const toCamelCase = (str: string) => {
return str
.replace(/[^a-zA-Z0-9]+/g, ' ')
.trim()
.split(/\s+/)
.map((w, i) => i === 0 ? w.toLowerCase() : w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
.join('');
};
```
Transform your text across all 12 formats instantly with our interactive Text Case Converter.