The same idea, "user login count", has to be written three different ways in three different places: userLoginCount in a JavaScript file, user_login_count in a Python file and user-login-count in a web address. The styles have jokey names, camelCase, snake_case and kebab-case, but each one is a strict rule about capitals and separators, and using the wrong one in the wrong place causes real confusion and sometimes real errors.
This guide explains the three styles in plain terms, where each one belongs, and how to convert a phrase into any of them with the free Case Converter on Ovatly. It also covers the two close relatives you will meet in the same codebases, PascalCase and CONSTANT_CASE, and one honest limit: the converter applies the rules perfectly, but it cannot tell you which style your project expects. That choice stays yours.
Contents
- Quick answer
- Why names need cases at all
- camelCase: capitals do the joining
- snake_case: underscores do the joining
- kebab-case: hyphens do the joining
- The close relatives: PascalCase and CONSTANT_CASE
- How to convert a phrase, step by step
- Worked example: one phrase, five cases
- Going the other way: splitting an existing name
- Limitations and honest notes
- Common mistakes
- FAQs
- Conclusion
Quick answer
camelCase joins words with no separator and capitalizes every word except the first: theQuickBrownFox. snake_case lowercases everything and joins the words with underscores: the_quick_brown_fox. kebab-case lowercases everything and joins the words with hyphens: the-quick-brown-fox. To convert any phrase, paste it into the Case Converter, click the case you need, and copy the result. The conversion happens in your browser and nothing is uploaded.
Why names need cases at all
Variable names, file names and web addresses cannot contain spaces. A name written as one unbroken string of lowercase letters, userlogincount, is legal in most places but hard to read and easy to mistype. So programmers mark the word boundaries some other way: with a capital letter, an underscore or a hyphen. Each style is just a different answer to the same problem, and each community of programmers has settled on its favourite. The styles are conventions, not laws of computing, which is why the same phrase legitimately appears in three different shapes in three different files.
camelCase: capitals do the joining
In camelCase, the words are written back to back with no separator at all. The first word stays lowercase, and every word after it starts with a capital letter. The capitals in the middle of the word are the humps that give the style its name. the quick brown fox becomes theQuickBrownFox.
This is the house style of JavaScript and Java, where variables and functions are normally written this way. It is compact and needs no special characters, which makes it comfortable to type. Its weakness is readability at a glance: the word boundaries depend entirely on spotting the capitals, so very long names take a moment to unpick.
snake_case: underscores do the joining
In snake_case, every letter is lowercase and the words are joined with underscores: the_quick_brown_fox. Nothing is capitalized, ever.
This is the house style of Python and Ruby, and it is also common for database column names. Because there are no capitals at all, the name survives systems that treat upper and lower case inconsistently, and the underscores make the word boundaries obvious even in a long name. The trade-off is length: the underscores add characters, and a long snake name can sprawl.
kebab-case: hyphens do the joining
In kebab-case, every letter is lowercase and the words are joined with hyphens: the-quick-brown-fox. The words strung on a hyphen are meant to look like food on a skewer, which is where the name comes from.
You will meet this style in web addresses, file names and CSS class names. One hard limit explains where it does not appear: in most programming languages a hyphen is read as a minus sign, so user-login-count inside code would be read as subtraction, not as a name. Kebab-case is for the places outside the code itself. For web file names and URLs it is the safest default of the three, because it stays readable and avoids the case-sensitivity problems that appear when files move between systems.
The close relatives: PascalCase and CONSTANT_CASE
Two more styles from the same family turn up constantly. PascalCase is camelCase with the first word capitalized as well: TheQuickBrownFox. It is the usual style for class names in many languages, so the first capital becomes a signal: this name refers to a type or a component, not a variable. CONSTANT_CASE is snake_case shouted: every letter uppercase, words joined with underscores, as in THE_QUICK_BROWN_FOX. It marks values that are set once and never change, such as a maximum retry count in a configuration file. Both are buttons in the same Case Converter, alongside the everyday UPPER, lower, Title and Sentence cases.
How to convert a phrase, step by step
- Open the Case Converter and type or paste your text in the first box.
- Choose the case you need from the buttons:
camelCase,snake_case,kebab-case, or any of the other eight. - Read the converted text in the result box. It updates instantly as you switch buttons, so you can compare styles before committing.
- Copy the result with the Copy button and paste it where it belongs.
Worked example: one phrase, five cases
Here is the converter's own demonstration phrase, "the quick brown fox", run through five of its cases:
Input: the quick brown fox
Title Case: The Quick Brown Fox
camelCase: theQuickBrownFox
snake_case: the_quick_brown_fox
CONSTANT_CASE: THE_QUICK_BROWN_FOX
Sentence case: The quick brown fox
The same paste also produces the-quick-brown-fox from the kebab-case button and TheQuickBrownFox from the PascalCase button. Nothing about the words changes between the rows; only the joining rule changes. That is the whole subject in one table: pick the rule your context expects, and the shape follows.
Going the other way: splitting an existing name
Conversion also runs in reverse. The code cases in this tool split words on spaces, punctuation and existing camelCase boundaries, which means a name that already exists in one style can be carried into another. Paste theQuickBrownFox and choose snake_case, and you get the_quick_brown_fox, because the tool can see where the words divide. This is the practical way to move a set of names from one codebase's style into another's without retyping them by hand.
Limitations and honest notes
The converter knows the rules of each case; it does not know your project's convention. It will happily produce any of its eleven cases for any text, including the wrong one for the file you are working in, so the style decision has to come from the language and codebase in front of you. Two of the eleven cases, alternating and inverse, are novelties rather than naming conventions; they exist for playful text, not for variables. And a detail worth knowing for headings rather than code: this tool's Title Case capitalizes the first letter of every word, including short words like "the" and "a", which some style guides treat differently.
Common mistakes
- Using kebab-case for a variable. In most languages the hyphen is a minus sign, so the name will not survive. Variables take
camelCaseorsnake_case; hyphens belong in URLs and file names. - Mixing styles inside one codebase. A project where half the variables are
camelCaseand half aresnake_caseis harder to search and easier to mistype. Convert incoming names to the house style. - Writing file names in camelCase. Capitals invite case-sensitivity mismatches when files move between systems. The converter's own guidance is
kebab-casefor web file names and URLs. - Retyping names by hand. Hand conversion of a long list invites exactly the inconsistencies you were trying to remove. Paste the whole list and convert it in one pass.
FAQs
Does the Case Converter really offer camelCase, snake_case and kebab-case?
Yes. They are three of its eleven cases, alongside UPPER, lower, Title, Sentence, PascalCase, CONSTANT_CASE, alternating and inverse. Pick the one you need from the buttons and the result updates instantly.
Which case should I use for file names?
kebab-case, meaning words joined by hyphens, is the safest default for web file names and URLs because it is readable and avoids case-sensitivity problems between systems.
Can it turn an existing variable name into a different style?
Yes. The code cases split words on spaces, punctuation and existing camelCase boundaries, so a name like theQuickBrownFox converts cleanly into the_quick_brown_fox or the-quick-brown-fox.
Does it work with non-English text? Yes. Case conversion uses Unicode letter rules, so accented and non-Latin letters convert correctly in the cases that apply to them.
Is my text uploaded? No. Conversion happens in your browser; nothing leaves your device.
Conclusion
The three styles are three answers to one problem: how to keep words readable where spaces are banned. camelCase lets capitals mark the joins, snake_case uses underscores, kebab-case uses hyphens, and each language community has picked its favourite. Once you know which style your context expects, the Case Converter does the mechanical work in one paste. If you are standardizing ordinary text rather than code, the companion guide on converting a list of names to a consistent case covers the same tool from the names angle, and the full set of writing utilities lives in the Text and Writing Tools category.