Programmers argue about naming with the passion usually reserved for editors and indentation — but underneath the tribalism, each case convention survives because it signals something about where an identifier lives. Learn what each style signals and you can read unfamiliar codebases faster, name things your teammates will accept on sight, and convert between styles without mangling the words inside.
The nine styles you will actually meet
- camelCase — first word lowercase, the rest capitalised, no separators:
monthlyActiveUsers. The default for variables and functions in JavaScript, Java and much of the C family. - PascalCase — every word capitalised:
MonthlyActiveUsers. Reserved, by broad agreement, for classes, types and components — so the case itself tells you "this is a type". - snake_case — lowercase words joined by underscores:
monthly_active_users. Python, Ruby, C, and nearly every database column ever named. - CONSTANT_CASE (screaming snake) — snake_case in capitals:
MAX_RETRY_COUNT. Constants and environment variables; the shouting is intentional, meaning "fixed at runtime, do not mutate". - kebab-case — words joined by hyphens:
monthly-active-users. URLs, CSS classes, file names and CLI flags — the places where underscores are unwelcome or invisible in underlined links. - UPPERCASE and lowercase — the blunt instruments, for acronyms, keywords and single-word labels.
- Title Case — every word capitalised with spaces kept: headlines and UI labels, where humans, not parsers, are the audience.
- Sentence case — only the first word and proper nouns capitalised: body text, buttons and messages written to be read as language.
Why ecosystems picked differently
Some choices are historical accidents hardened into lint rules, but a few have real mechanics behind them. Hyphens cannot appear in identifiers in most languages — the parser reads a-b as subtraction — so kebab-case was never available to programming languages and colonised URLs and CSS instead, where it also survives being read aloud and typed from print. Underscores stay visible when text is underlined, which is why snake_case beats kebab-case for anything likely to appear as a link in documentation. And case itself is free metadata: when a codebase keeps classes in PascalCase and values in camelCase, a reader gets type information from shape alone, before any lookup.
Two honourable mentions
SQL style deserves a footnote: keywords are traditionally written in full capitals (SELECT name FROM users WHERE id = 1) while identifiers stay lowercase snake_case — a convention from the language's mainframe era that survives because it makes queries scannable at a glance. And Hungarian notation, which prefixed names with type codes (strName, intCount), is the one convention the industry has largely retired: modern editors show types on hover, and a prefix that can drift out of sync with the real type became a liability. Knowing it exists explains a generation of Windows-era code — and why nobody writes new code that way.
Converting without mangling
The trap in programmatic conversion is word boundaries. A naive find-and-replace turns monthlyActiveUsers into rubble, because the boundary between "monthly" and "Active" exists only as a capital letter. A correct splitter first cuts on the transitions that are already there — camel humps, underscores, hyphens, spaces — and lowercases the pieces; then any target style is just a joining rule applied to clean words. Acronyms are the remaining hazard (parseHTTPResponse wants to become parse_http_response, not parse_h_t_t_p_response), so a good splitter also breaks an acronym run before its last capital when a lowercase letter follows. Get those two rules right and all nine styles are one click apart.
Try the tool behind this article: Case Converter runs entirely in your browser — nothing you paste is uploaded.