
Topics Covered:
What is CamelCase? PascalCase, Snake_Case and Kebab-Case Explained
A pull request is blocked due to a linter's complaints about messy case.A total of three variables in one file have three distinct styles of writing. It is possible for a case converter to resolve one file's case inconsistency problem instantly but will never inform you about why there is a case inconsistency or what exactly is camelCase, PascalCase, snake_case and kebab-case.
This article aims to help you understand each of these naming conventions and the usage of these conventions.
Fast answer:camelCase combines words together without space with the first word being lowercase (taskTitle). PascalCase does the same except that the first letter is capitalized (TaskTitle).snake_case combines words in lowercase with an underscore in between (task_title).kebab-case is similar except it uses a hyphen instead of an underscore (task-title).
What Is camelCase?
camelCase takes two or more words and squishes them into one with no spaces at all.The first word stays lowercase.Every word after that starts with a capital letter.That's the whole rule.

JavaScript, Java, and C# all use camelCase by default for variables and functions. If you've ever written something like userAge or calculateTotal, you were already using it. Since there are no extra characters between words, camelCase names stay shorter than the other styles, which helps in code that already has a lot going on.
What Is PascalCase?
PascalCase is almost the same as camelCase.The only difference is that the very first letter is capital too.So taskTitle becomes TaskTitle.It sounds like a small change,but it means a lot once you're reading through a big file.

C#, Java, and TypeScript all use PascalCase for classes and types. So the moment you see TaskItem, you already know it's a class, before reading a single line inside it.
Frameworks like React and Vue take this a step further. Component files get named in PascalCase too, like TaskCard.jsx instead of taskCard.jsx. That way, components stand out from the regular functions sitting in the same folder.
What Is snake_case?
snake_case keeps every letter lowercase and adds an underscore wherever camelCase would add a capital letter. taskTitle becomes task_title.

Python's official style guide, called PEP 8, tells developers to use snake_case for variables and functions. Almost every Python project follows this pattern because of it. Ruby follows the same rule.
Databases usually go with snake_case too no matter what language sits on top of them.Column names like task_id or created_at are everywhere.It's actually a common source of backend-to-frontend bugs: a Python or Ruby API sends back snake_case, but the JavaScript app on the other end expects camelCase.
What Is kebab-case?
kebab-case is a lot like snake_case but it swaps the underscore for a hyphen task_title becomes task-title.
You can't actually use kebab-case for variable names in most programming languages, because the language reads the hyphen as a minus sign. So instead, it shows up in URLs, file names, CSS class names, and command-line flags like --dry-run.
There's one place where kebab-case isn't optional, though. The rule for building custom HTML elements says every custom tag needs at least one hyphen in its name like <task-card>.No exceptions.Vue and Angular write component tags in kebab-case for exactly this reason even when the component's own file sits in PascalCase

Other Naming Styles Worth Knowing
SCREAMING_SNAKE_CASE (also called CONSTANT_CASE): same as snake_case, but every letter is capital. Mostly used for constants, like MAX_LOGIN_ATTEMPTS.
Train-Case: kebab-case, but every word is capitalized. Shows up sometimes in HTTP headers like Content-Type.
dot.case: words separated by periods. Common in config files and some npm packages.
You don't really need to make a separate decision for any of these.They follow the same basic rule as the styles above just with a different letter case or a different symbol between words.
Everything above is about naming things in codeIf you want the rule for regular writing instead, like how to capitalize a headline or a sentence, check out What Is Sentence Case?
Naming Styles by Programming Language
| Language / Context | Variables & Functions | Classes & Types | Constants |
|---|---|---|---|
| JavaScript | camelCase | PascalCase | SCREAMING_SNAKE_CASE |
| Python | snake_case | PascalCase | SCREAMING_SNAKE_CASE |
| Java | camelCase | PascalCase | SCREAMING_SNAKE_CASE |
| C# | camelCase (local) | PascalCase | PascalCase |
| CSS | kebab-case | N/A | N/A |
| URLs & file names | kebab-case | N/A | N/A |
| Ruby | snake_case | PascalCase | SCREAMING_SNAKE_CASE |
None of this is forced on you by the language itself.Code that ignores every rule above still runs fine.What actually enforces it is the linter almost every setup uses plus the style guide that companies like Google and Airbnb publish and expect people to follow.
Common Mistakes to Avoid
- Switching styles halfway through a file.One function called fetchTasks the next one called fetch_tasks. Pick one style per language and stick with it the whole way through.
- Writing a constant in PascalCase. MaxRetries should be MAX_RETRIES instead.
- Being inconsistent with acronyms.taskID, taskId and taskld all show up in real code.Most style guides, including Google's, say to treat an acronym like a normal word: taskId, not taskID.
- Starting a class name with a lowercase letter. A class called taskItem instead of TaskItem loses the whole point of using PascalCase in the first place.
How to Switch Between Naming Styles
Renaming a bunch of variables from snake_case to camelCase by hand is slow and it's easy to make a typo along the way. This comes up more than you'd think: a Python API sending back snake_case while a JavaScript app wants camelCase is one of the most common headaches in full-stack work.
The Free Case Converter tool linked above switches text between camelCase, PascalCase, snake_case and kebab-case with one click. It runs right in your browser too, so nothing you paste gets sent anywhere.
Working in a spreadsheet instead of code? Check out how to convert case in Excel. And if you need a different tool altogether, the full tools page has all eight, from word counters to keyword density checkers.
Why This Actually Matters
A consistent naming style basically turns a name into a clue.PascalCase means you're looking at a class,before you've even read a line inside it.SCREAMING_SNAKE_CASE means that value isn't supposed to change ever.
camelCase usually just means a variable or a function. You get all of that without reading any actual logic, just from how the name is written.
Break the pattern and your tools stop helping you too.Autocomplete, search, and refactoring tools all treat getUserName and get_user_name as two completely different strings even though they mean the exact same thing. On a team, that turns into slower code reviews, duplicate variables nobody notices and bugs that trace back to two names that should have matched but didn't.
There's actual research behind this too not just opinions.A 2010 eye-tracking study by Sharif and Maletic presented at a conference on program comprehension, found that programmers recognized underscore-style names faster than camelCase ones. On average, camelCase names took 932 milliseconds longer to recognize.
FAQs
Is snake_case the same as underscore case?
Yes, they're the same thing. Lowercase letters, with an underscore between each word.
What naming style does Python use?
Python's style guide, PEP 8, says to use snake_case for variables and functions, and PascalCase for classes.
Can I mix styles in one project?
The code will still run either way, since casing is a style choice, not something the language forces on you. But mixing styles fails most linter checks and makes the code harder to read, so it's worth staying consistent anyway.
What's the actual difference between camelCase and PascalCase?
Just the first letter. camelCase starts lowercase, like taskTitle. PascalCase starts with a capital, like TaskTitle. Every word after the first one is capitalized the same way in both.
Is there a standard naming style for JSON?
Not really. camelCase is more common in JavaScript APIs.snake_case shows up a lot in APIs built with Python or Ruby.
Bottom Line
The camelCase, PascalCase, snake_case, and kebab-case notations all address the same issue of writing a multiword name without space.The selection of a specific notation is more influenced by the programming language in which one works rather than personal preference since the majority of these decisions have been made years ago.It is better to stick to the style guide that is already used in the particular language and be consistent in applying it throughout the project and use converters rather than retype everything manually.For better experience, use our free Case Converter.