Comparison1 min readUpdated June 25, 2026
camelCase vs snake_case vs kebab-case
Short answer
camelCase joins words with capital letters (firstName), snake_case joins them with underscores (first_name), and kebab-case joins them with hyphens (first-name). Each is conventional in different languages and contexts.
The main styles
camelCase— first word lowercase, later words capitalized:userNamePascalCase— every word capitalized:UserNamesnake_case— lowercase words joined by underscores:user_namekebab-case— lowercase words joined by hyphens:user-nameCONSTANT_CASE— uppercase words joined by underscores:USER_NAME
Where each is conventional
- camelCase: JavaScript and Java variables and functions
- PascalCase: class and type names, and React components
- snake_case: Python and Ruby variables, and many database columns
- kebab-case: URLs, CSS classes, and file names
- CONSTANT_CASE: configuration constants and environment variables
Why kebab-case is not used for variablesMost languages read a hyphen as the minus operator, so
user-name would mean user minus name. That is why hyphens are reserved for URLs, CSS, and file names rather than code identifiers.Try it: Case ConverterConvert text between camelCase, snake_case, kebab-case, and more locally.Open tool