Code Case Converter
Convert any phrase to camelCase, PascalCase, snake_case, kebab-case and CONSTANT_CASE.
Was this tool helpful?
Thanks for the feedback!
The Code Case Converter takes a phrase such as "user profile settings" and prints it in seven naming conventions at once: camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, dot.case and path/case. Programmers use it to name variables, database columns, CSS classes and environment variables consistently without retyping the same words seven ways.
Output for the example phrase
camelCase: userProfileSettings PascalCase: UserProfileSettings snake_case: user_profile_settings kebab-case: user-profile-settings CONSTANT: USER_PROFILE_SETTINGS dot.case: user.profile.settings path/case: user/profile/settings
All seven lines appear in one result box. The Copy button copies the whole block, so select just the line you need if you want a single form.
How your input is split into words
- Every character that is not an English letter or a digit, such as a space, hyphen, underscore, dot or slash, is treated as a break between words.
- Each word is converted to lowercase.
- The words are joined with the separator and capitalisation each convention requires.
Because hyphens and underscores count as breaks, converting between existing styles works: "first-name_field 2" becomes firstNameField2, first_name_field_2 and FIRST_NAME_FIELD_2. Digits survive as their own words.
Two inputs that give surprising results
Text that is already camelCase
Capital letters inside a word are not treated as word breaks. "userProfile" is seen as one word, so every output reads "userprofile" or "USERPROFILE". Likewise "getHTTPResponse code" becomes gethttpresponseCode. Type the words with spaces ("get http response code") to get getHttpResponseCode.
Accented letters
Letters outside A to Z are treated as separators and dropped, so "Café menu" comes out as cafMenu. Run the phrase through the accent remover first to get cafeMenu. Identifiers are safest in plain ASCII anyway, even where a language technically allows Unicode names.
Which convention to use where
| Convention | Typical use |
|---|---|
| camelCase | JavaScript and Java variables and functions, many JSON API fields |
| PascalCase | Class names in most languages, React components, C# methods |
| snake_case | Python functions and variables (PEP 8), Ruby, SQL column names |
| kebab-case | CSS classes, URL paths, file names, command-line options |
| CONSTANT_CASE | Constants and environment variables such as DATABASE_URL |
| dot.case | Configuration keys and translation keys, e.g. app.title |
| path/case | Folder paths, route segments and namespaces |
The strongest rule is consistency with the codebase you are working in. Python's PEP 8 style guide asks for snake_case functions, CapWords (PascalCase) classes and UPPER_CASE constants, while Java uses camelCase methods with PascalCase classes. When a JavaScript front end talks to a Python back end, you often need the same field name in both camelCase and snake_case, which is exactly the situation this converter speeds up.
For URLs, use a slug tool instead
kebab-case here is aimed at identifiers. A page URL also needs accented letters converted to plain ones rather than dropped, which the slug generator does line by line for titles.