What Is camelCase? A Developer's Guide to Naming Conventions
Naming conventions are one of the first things every developer learns — and one of the most debated topics in code reviews. This guide explains the four major naming conventions, when to use each one, and how to convert between them.
The Four Main Naming Conventions
camelCase
camelCase joins words together with no separator, capitalizing the first letter of each word except the first. The name comes from the "humps" formed by the capital letters, like a camel's back.
Used in: JavaScript, TypeScript, Java, C# (variables, functions, methods)
PascalCase
PascalCase (also called UpperCamelCase) is like camelCase but the first letter is also capitalized. Named after the Pascal programming language.
Used in: Class names in most languages, React components, C# methods, TypeScript types/interfaces
snake_case
snake_case separates words with underscores and uses all lowercase letters. The underscores look like a snake on the ground.
Used in: Python (everywhere), Ruby, Rust, database column names, file names
kebab-case
kebab-case separates words with hyphens and uses all lowercase. The words look like food items on a kebab skewer.
Used in: CSS property names, HTML attributes, URL slugs, npm package names
Quick Reference: Which Convention Where?
| Language/Context | Variables | Functions | Classes | Constants |
|---|---|---|---|---|
| JavaScript/TypeScript | camelCase | camelCase | PascalCase | CONSTANT_CASE |
| Python | snake_case | snake_case | PascalCase | CONSTANT_CASE |
| CSS | kebab-case | - | - | kebab-case |
| SQL/Database | snake_case | snake_case | PascalCase | CONSTANT_CASE |
| React Components | camelCase | camelCase | PascalCase | CONSTANT_CASE |
| REST API URLs | kebab-case (/api/user-profiles) | |||
Common Mistakes
- Mixing conventions in one file — pick one and stick to it
- Using camelCase in Python — Python strongly prefers snake_case for variables and functions
- Using snake_case in JavaScript — JS convention is camelCase (except for CONSTANTS)
- Inconsistent API naming — REST APIs should use kebab-case URLs consistently
How to Convert Between Conventions
Use our free online converters to switch between any naming convention instantly:
- Convert to camelCase
- Convert to PascalCase
- Convert to snake_case
- Convert to kebab-case
- Convert to CONSTANT_CASE
Or use the Convert Case Tool to access all formats in one place.
Convert Case Instantly
Switch between camelCase, snake_case, kebab-case, and more with one click.
Open Convert Case Tool →