Why so many casing styles exist
In programming, identifiers can't have spaces or punctuation. Each community picked a convention to combine words: some use capitals as separators (camelCase, PascalCase), others use underscores (snake_case) or hyphens (kebab-case). None is "best" in the abstract — what matters is consistency with the ecosystem you work in.
When to use each
- camelCase — variables and functions in JavaScript, TypeScript, Java, C++.
- PascalCase — classes, types, React components, models.
- snake_case — variables and functions in Python, Ruby, Rust; database columns.
- kebab-case — URLs, slugs, filenames, HTML attributes, CSS classes.
- CONSTANT_CASE — global constants in nearly every language.
- Title Case — article, book and product titles in English.
- Sentence case — running prose; only the first word and proper nouns are capitalized.
Common mistakes
Mixing cases in the same project is the number one source of typo bugs. If your team
uses userId in some places and user_id in others, somebody
will eventually reference the wrong variable. Define the convention up front, ideally
backed by a linter (ESLint, Pylint, gofmt) that enforces it.
Practical use cases
- Take a SQL column name
order_total_amountand convert it to the JS object propertyorderTotalAmount. - Turn an article title "10 Tips For Your Landing Page" into the slug
10-tips-for-your-landing-page. - Take text that arrived in ALL CAPS from a poorly exported PDF and downcase to Sentence case.
- Generate a React component name (PascalCase) from a natural-language description.
Accents and special characters
UPPER, lower, Sentence and Title preserve accents and ñ. Technical modes (camel, snake, kebab, constant) strip them because most languages and filesystems don't accept accented identifiers. If you need accents in a slug, copy from Sentence/Title and replace spaces manually.
Local processing
This converter sends nothing to a server. The whole script runs in your browser, so you can paste confidential text without worrying about logs or analytics. Close the tab and it's gone.