Case Converter
Convert text between different casing formats
Convert text between common casing formats.
Input
Output
Select Case Format:
About the Case Converter
Every language and tool has its own naming convention. JavaScript wants camelCase variables, Python wants snake_case, CSS and URLs want kebab-case, and environment variables use CONSTANT_CASE. The Case Converter rewrites a name in any of these styles, so you can move identifiers between codebases without retyping them.
The formats
Here is the phrase user profile id in each style:
- camelCase: userProfileId. JavaScript and TypeScript variables and functions, and the keys of many JSON APIs.
- PascalCase: UserProfileId. Classes, React components, and TypeScript types.
- snake_case: user_profile_id. Python and Ruby code, and database column names.
- CONSTANT_CASE: USER_PROFILE_ID. Constants and environment variables.
- kebab-case: user-profile-id. URLs, CSS class names, file names, and command-line flags.
- Title Case: User Profile Id. Headings and labels. Every word is capitalised, including short ones like of and the.
- Sentence case: User profile id. Buttons, menu items, and ordinary sentences.
- lower case and UPPER CASE. Change the letters only, and keep spacing and punctuation exactly as typed.
How words are detected
The converter splits your text at spaces, hyphens, underscores, and changes from lower to upper case, so it can go from any format to any other. For example, XMLHttpRequest parser becomes xml_http_request_parser in snake_case and xmlHttpRequestParser in camelCase.
The code-style formats keep only letters and numbers, so punctuation such as ! or . is dropped. The whole input is treated as one name, so convert a list of identifiers one at a time rather than pasting them all at once.
Chaining tools
Apply to Input copies the result back into the input box, and the text you type carries over when you switch to another text tool. That makes it easy to trim stray whitespace with the Text Trimmer, then come back here to convert the cleaned-up name.