Which Case Style for Which Job
Programming languages and platforms each settled on their own naming convention, largely for historical reasons rather than technical necessity, and mixing conventions within one codebase is one of the more common style inconsistencies a linter flags.
Common Conventions
Classes (most languages): PascalCase
Python variables/functions: snake_case
URL slugs, CSS classes: kebab-case
Environment variables, constants: CONSTANT_CASE
These are conventions enforced by team style guides and linters, not language syntax — JavaScript will run a snake_case variable name without complaint. Following the convention matters for readability and for tooling that expects it, not because the alternative is invalid.
How Words Are Detected
Converting between case styles requires first breaking the text back into individual words, regardless of how those words were originally joined.
Spaces split naturally
Plain text with spaces is the simplest case — each space-separated token becomes one word, ready to be rejoined in any target style.
camelCase and PascalCase split on capital letters
Pasting in firstName or UserAccount, the converter detects the lowercase-to-uppercase boundary and splits there, recovering "first name" or "user account" before converting to the target style.
snake_case and kebab-case split on the separator
Underscores and hyphens are treated as word boundaries and removed, so user_account_id or user-account-id both recover to "user account id" before conversion.
Where Automated Conversion Gets It Wrong
Acronyms are the main source of ambiguity. Converting "userID" to snake_case can reasonably produce either user_id or user_i_d, depending on whether the tool treats "ID" as one unit or two capital letters. Most conventions favour the former, but automated detection cannot always tell an acronym from two adjacent short words.
Similarly, numbers embedded in an identifier — user2Name — can split inconsistently depending on the tool. When precision matters, particularly for a database migration or bulk rename, spot-check a sample of the converted output before applying it wholesale.