Guides / Text case
Text Case Styles Explained
Capitalization changes how a title or heading reads. In code, the case style also signals what a name means. Here is when to use each common style.
Writing styles
- UPPERCASE is for short emphasis, acronyms and warning labels. Long passages in capitals are harder to read.
- lowercase is often used in informal writing and in some brand names.
- Title Case capitalizes most words in a headline. Style guides differ on which small words, such as "a", "of" and "the", stay lowercase. Pick one guide and be consistent.
- Sentence case capitalizes only the first word and proper nouns. Many news sites and product interfaces use it because it is easier to read.
Code naming styles
- camelCase:
userName. Common for variables and functions in JavaScript and Java. - PascalCase:
UserName. Common for classes and React components. - snake_case:
user_name. Common in Python and in database column names. - kebab-case:
user-name. Common in URLs, CSS class names and file names.
Watch out for the small details
Converting between styles can be tricky with acronyms and numbers. "XMLHttpRequest" becomes "xml_http_request" in snake_case, and "version 2 beta" becomes "version_2_beta". Always scan the result for words that split in unexpected places.
Try it yourself
Paste text into the Case Converter and click any style to see the result. You can then copy it or use it as the input for another conversion.