Case conversion and naming
Camel, Snake and Kebab Case: Choose a Naming Convention
Compare camelCase, snake_case and kebab-case with tested examples, language constraints and checks for choosing a consistent naming convention.
Camel case joins words with internal capitals, snake case joins them with underscores, and kebab case joins them with hyphens. For the phrase customer account id, the three results are customerAccountId, customer_account_id and customer-account-id. The right choice depends on where the name will be used and the convention already established there.
Read the three forms
| Convention | Example | Word boundary |
|---|---|---|
| Lower camel case | customerAccountId | Capital letter after the first word |
| Snake case | customer_account_id | Underscore |
| Kebab case | customer-account-id | Hyphen |
Lower camel case begins with a lowercase word. Pascal case, sometimes called upper camel case, would produce CustomerAccountId. Name the exact convention in a requirement so two people do not interpret camel case differently and produce inconsistent fields.
Choose for the receiving system
In an existing codebase, follow the surrounding convention and its linter or style guide. Python’s PEP 8 recommends lowercase function and variable names with underscores where needed. That is a style recommendation for that context, not a universal naming requirement for every language or file format.
A hyphen cannot be used as an ordinary JavaScript variable-name character. A JSON object can nevertheless have a quoted property named customer-account-id. Its name is a string, and JavaScript can access it with bracket notation. Do not confuse a permitted JSON property string with a valid unquoted variable identifier.
For a URL path or exported field, preserve the contract expected by consumers. A name that looks tidier can still break a link, configuration lookup or API client. A case converter generates a proposed string; it does not discover every place that refers to the old name.
Try the same phrase in each converter
Open the Camel Case Converter, Snake Case Converter or Kebab Case Converter. Enter customer account id and compare the result with the table. Use a second phrase, order status, to confirm that the displayed result changes to the current input.
The tool separates likely word boundaries before joining the pieces. This is useful for ordinary multiword labels, but it is still a mechanical rule. Review abbreviations, digits and unusual punctuation before adopting the generated name as a public interface.
Inspect acronyms and numbers
For HTTPServer2, these converters produce httpServer2, http_server_2 and http-server-2. They separate the acronym from Server and recognize the digit boundary. Another project may deliberately use http_server2 or preserve HTTP in selected positions. State that policy instead of assuming every converter shares it.
A name beginning with a number needs additional attention when used as code. The converter does not guarantee that its output is a valid identifier in the target language, avoid reserved words, or check an application’s length restrictions. Validate those requirements separately from visual word separation.
Check whether distinct labels collapse
The inputs user-name and user name both become user_name in the snake-case tool. If those labels represent different records, replacing both with the same generated key would lose their distinction. Build an old-to-new name list and check for duplicate outputs before converting a whole schema or directory.
Keep the original spelling in that mapping. A reverse conversion cannot reliably reconstruct whether the input used a hyphen, space or another separator once that information has been removed. Case conversion is not an encoding designed for lossless recovery.
Verify the adopted names
Review representative short names, acronyms, digit-containing names and pairs likely to collide. For code changes, use the language-aware rename operation and project tests to update references. For data exports, compare the new headers with the receiving system’s documented field names before replacing the working export.
References
PEP 8 naming guidance and JavaScript identifier rules explain two receiving contexts. The converter examples above are checked against this site’s current operations.


