Guide
Naming conventions and text case styles
By Logappradeep · ServiceNow developer
Letter case carries meaning in both writing and code. Headlines use title case, sentences use sentence case, and programming languages each have conventions for naming variables, constants, files, and URLs. A case converter rewrites text into a chosen style in one click, saving tedious retyping and avoiding typos when renaming many identifiers.
The styles and where they belong
- UPPERCASE: acronyms, emphasis in plain-text channels, and, with underscores, constants such as
MAX_RETRIES. - lowercase: email addresses, domain names, tags, and normalizing text before comparison.
- Title Case: headings, product names, and button labels in many style guides.
- Sentence case: body text, UI messages, and headings in style guides that prefer it, such as many design systems.
- camelCase: variables and functions in JavaScript, TypeScript, Java, and JSON keys in many APIs, for example
firstName. - snake_case: Python variables and functions, Ruby, database column names, and many REST APIs, for example
first_name. - kebab-case: URLs, CSS class names, file names, HTML attributes, and command-line flags, for example
first-name.
How each conversion behaves
Knowing the exact rules prevents surprises:
- camelCase lowercases the first letter, capitalizes the start of each following word, and removes the spaces:
user account idbecomesuserAccountId. - snake_case and kebab-case lowercase everything and replace runs of whitespace with
_or-. They split on spaces, so an existing identifier likeuserAccountIdbecomesuseraccountid. Put spaces between the words first when converting from camelCase. - Title Case capitalizes the first letter of every word and leaves the remaining letters untouched, so acronyms like
APIsurvive. - Sentence case capitalizes only the very first character of the whole text and lowercases the rest. Proper nouns and acronyms, such as
LondonorNASA, need to be fixed by hand afterward.
Gotchas
- Style guides disagree on title case. AP, Chicago, and APA styles lowercase short words such as "a", "of", and "the" in certain positions. A mechanical converter capitalizes every word, so review headlines before publishing.
- Some languages have special case rules. Turkish distinguishes dotted and dotless i, and German ß uppercases to SS. Generic conversion follows default Unicode rules, which may not match local conventions.
- Case-sensitive systems. Renaming
Readme.mdtoREADME.mdcan confuse Git on case-insensitive file systems such as the macOS and Windows defaults. Usegit mvfor case-only renames. - PascalCase is different from camelCase. Class and component names usually start with a capital, as in
UserAccount; capitalize the first letter of the camelCase result if you need it.
The conversion happens in your browser, directly in the text box, so nothing you paste is uploaded.