Naming things is famously one of the hardest problems in programming. Picking the wrong naming convention for the wrong context is a small but persistent source of bugs and confusion.
The Main Naming Conventions
camelCase — each word starts with a capital letter except the first. Used in JavaScript variables/functions, Java, Swift, and JSON keys. Example: getUserData
PascalCase — like camelCase but the first word is also capitalized. Used for class names, React components, and C# types. Example: UserProfile
snake_case — all lowercase, words separated by underscores. Used in Python, Ruby, database columns, and file names. Example: get_user_data
SCREAMING_SNAKE_CASE — all uppercase with underscores. Used for constants and environment variables. Example: API_BASE_URL
kebab-case — all lowercase, words separated by hyphens. Used in HTML attributes, CSS classes, URL slugs, and CLI flags. Example: my-component
Quick Reference by Context
| Context | Convention |
|---|---|
| JavaScript variables | camelCase |
| JavaScript classes | PascalCase |
| Python variables | snake_case |
| CSS classes | kebab-case |
| URL slugs | kebab-case |
| Database columns | snake_case |
| Environment variables | SCREAMING_SNAKE_CASE |
| React components | PascalCase |
Convert Between Cases Instantly
Use the Anonymiz Case Converter to convert any text to camelCase, snake_case, kebab-case, PascalCase, SCREAMING_SNAKE_CASE, Title Case, or dot.notation in one click. No signup needed.