What is the difference between camelCase, PascalCase, snake_case, and kebab-case?
camelCase starts lowercase with each subsequent word capitalised (myVariableName) — standard in JavaScript and Java. PascalCase capitalises every word (MyClassName) — used for class and component names. snake_case uses underscores (my_variable_name) — standard in Python and database columns. kebab-case uses hyphens (my-variable-name) — standard for URLs, CSS class names, and HTML attributes. CONSTANT_CASE (MY_CONSTANT) is snake_case in all-caps, used for constants and environment variables.
Instantly format your text or code into 11 different cases including uppercase, lowercase, Title Case, camelCase, snake_case, and more. Featuring real-time word counting, one-click copy, and text file downloads.
Plain Text Input
Words: 0Chars: 0Lines: 0
Converted Output
Select Formatting Options
Which case convention belongs where
Convention
Example
Used in
camelCase
getUserById
JavaScript/TypeScript variables and functions, JSON keys in APIs
PascalCase
UserProfile
React components, TypeScript interfaces/types, class names
The most common bug pattern: a REST API returns user_id (snake_case), your frontend code expects userId (camelCase), and the value silently becomes undefined. No error, no warning — just missing data. JavaScript property access is case-sensitive: obj.userId and obj.user_id are different keys.
CSS has the same issue in the opposite direction: className="userProfile" won't match a stylesheet rule for .user-profile. Establish a convention per layer — API responses, database columns, frontend variables, CSS classes — and enforce it with a linter or code review checklist rather than relying on memory.