Utilumo
LightDarkSystem
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: userName
  • PascalCase — every word capitalized: UserName
  • snake_case — lowercase words joined by underscores: user_name
  • kebab-case — lowercase words joined by hyphens: user-name
  • CONSTANT_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

References

Questions

What is the difference between camelCase and PascalCase?

Both capitalize later words. camelCase keeps the first word lowercase (userName), while PascalCase capitalizes it too (UserName). PascalCase is typically used for classes and types.

Which case should I use for a URL?

kebab-case. Hyphenated, lowercase words such as /png-vs-jpg are readable and are the conventional, SEO-friendly style for URLs.

Does converting case change my text's meaning?

No. Case conversion only changes word boundaries and capitalization. The Utilumo Case Converter runs locally and never uploads your text.

Keep reading