camelCase, snake_case & More: A Text Case Guide
camelCase, snake_case, PascalCase and kebab-case are naming styles for code and text. Learn what each looks like, where it is used, and how to convert.
Text cases are conventions for joining words without spaces, mainly used in programming. For example, "user name" becomes userName (camelCase) or user_name (snake_case).
The common cases
- camelCase — first word lowercase, later words capitalized:
firstName - PascalCase — every word capitalized:
FirstName - snake_case — lowercase words joined by underscores:
first_name - kebab-case — lowercase words joined by hyphens:
first-name - Title Case / UPPER CASE — for headings and constants
Where each is used
JavaScript and Java favor camelCase for variables and PascalCase for classes; Python and databases prefer snake_case; CSS and URLs use kebab-case. Consistency within a project matters more than the choice itself.
Convert instantly
Paste text into the case converter to switch between all of these at once. For web addresses specifically, see What is a URL slug.