How to use
- Type or paste a phrase or an identifier. It can be in any style, for example user first name, userFirstName or user_first_name.
- Read the list. Every style is shown at once, and each line of your text is converted on its own.
- Press Copy next to the style you need.
Examples
Hello world foo
→ camelCase helloWorldFoo, snake_case hello_world_foo, kebab-case hello-world-fooPascalCase gives HelloWorldFoo and CONSTANT_CASE gives HELLO_WORLD_FOO.
XMLHttpRequest
→ xml_http_request in snake_case and xmlHttpRequest in camelCaseA run of capital letters is treated as one word, and a new word starts where lower-case text begins.
user name (line 1), last login (line 3)
→ user_name, an empty line, last_login in snake_caseEach line is converted separately, and blank lines stay blank.
How it works
The text is split into words, at spaces, punctuation and the places where the case changes, by the open-source change-case library. The words are then joined again in each style: lower case with a separator for snake, kebab, dot and path style, a capital letter at the start of each word for camel, Pascal, Train and Capital style, and so on.
Upper case and lower case simply change the letters of the original text without splitting it.
Each line of the input is converted separately, so you can paste a list of names and convert them all in one go.
Sources
Frequently asked questions
- Which style should I use?
- It depends on the language and the team. Common conventions: camelCase for JavaScript variables and functions, PascalCase for classes and components, snake_case in Python and SQL, kebab-case in URLs and CSS, and CONSTANT_CASE for constants and environment variables. These are conventions, not rules, so follow your project's style guide.
- How are abbreviations and numbers handled?
- A run of capitals such as XML counts as one word, so XMLHttpRequest becomes xml_http_request. Digits stay with the letters before them, so foo2bar stays one word.
- What happens to non-English text?
- Words are split at spaces and punctuation, and only Latin letters change case. Korean or other scripts are kept as they are, so 안녕 world becomes 안녕_world in snake_case.
- What is the difference between Sentence case and Capital Case?
- Sentence case capitalizes only the first word, like an ordinary sentence. Capital Case capitalizes every word.
- Is my text uploaded?
- No. The conversion runs in your browser.