The eight cases and when to use them
Every case has a natural home. Picking the right one keeps your writing readable and your code consistent:
- UPPERCASE — short labels, warnings, acronyms and headlines where you want maximum emphasis without any formatting.
- lowercase — casual writing, email addresses, usernames and domain names, which are treated as case-insensitive by convention.
- Title Case — headings, article titles, book names and menu labels. Each major word starts with a capital letter.
- Sentence case — everyday prose. Only the first word of each sentence and proper nouns take a capital, which is easiest to read in long paragraphs.
- camelCase — variable and function names in JavaScript, Java and TypeScript:
getUserName,handleClick. - snake_case — variables and functions in Python, Ruby and SQL:
user_name,total_price. - kebab-case — URLs, page slugs, file names and CSS classes:
my-blog-post.html,.main-nav. - CONSTANT_CASE — fixed values in code that should never be reassigned:
MAX_RETRIES,API_KEY.
Title Case vs Sentence case
Headings usually look best in Title Case because the repeated capitals create visual rhythm and help scanning readers spot key terms. Body text belongs in sentence case — long passages in Title Case slow reading down noticeably. Style guides split on headlines: AP uses sentence case, Chicago prefers Title Case, so there is no single rule. What matters most is consistency — pick one convention per context (one style for headings, another for prose) and apply it everywhere. Converting between them takes a single click above, so experimenting costs nothing.