Case Converter
Convert any identifier or phrase into eleven naming conventions at once: camelCase, PascalCase, snake_case,
SCREAMING_SNAKE, kebab-case, Title Case, Sentence case, UPPER, lower, dot.case and path/case. The input can be in any
style, or a mix of styles. Acronyms (XMLHttpRequest), digits (version2Name) and non-ASCII letters
(café) are split the way a developer would expect, so you can round-trip names without fixing them by hand.
How to use the Case Converter
- Type or paste a name, a list of words or a sentence into Input. The table updates as you type.
- Use the Copy button next to a style to copy that version.
The page starts with thisIsAnExample of_text, which mixes camelCase, a space and an underscore. It splits
into the six words this, is, an, example, of, text and converts to:
| Style | Output |
|---|---|
| camelCase | thisIsAnExampleOfText |
| PascalCase | ThisIsAnExampleOfText |
| snake_case | this_is_an_example_of_text |
| SCREAMING_SNAKE | THIS_IS_AN_EXAMPLE_OF_TEXT |
| kebab-case | this-is-an-example-of-text |
| Title Case | This Is An Example Of Text |
| Sentence case | This is an example of text |
| UPPER / lower | THIS IS AN EXAMPLE OF TEXT / this is an example of text |
| dot.case / path/case | this.is.an.example.of.text / this/is/an/example/of/text |
How words are found
Every conversion starts by splitting the input into words. Three rules decide where one word ends and the next begins:
- A capital after a lowercase letter or a digit starts a new word:
fooBar→ foo, Bar, andversion2Name→ version2, Name, so its snake_case form isversion2_name. - The last capital of an acronym that is followed by a lowercase letter starts a new word:
XMLHttpRequest→ XML, Http, Request, so snake_case isxml_http_requestand camelCase isxmlHttpRequest.getHTTPResponsegivesget-http-responsein kebab-case, andHTML5Parsergiveshtml5_parser. - Anything that is not a letter or a digit separates words: spaces,
_,-,.,/and punctuation. Repeated separators count once, so--user--id--becomesuser_id, and so doesuser/id.
Letters are Unicode-aware: café_au_lait becomes caféAuLait, not cafAuLait. Each word is
lowercased before the style is applied, which is why an acronym loses its capitals inside camelCase and PascalCase
(XmlHttpRequest). That matches the Google Java and JavaScript style guides, which treat acronyms as ordinary words. Go
style keeps initialisms in capitals (HTTPServer, userID), so fix those by hand after converting.
Brand spellings are not preserved either: iOS splits into i, OS and becomes iOs in camelCase.
Common use cases
| Style | Where it is the convention |
|---|---|
| camelCase | JavaScript and TypeScript variables and functions, Java methods, most JSON APIs |
| PascalCase | Class and type names in most languages, React components, C# methods and properties |
| snake_case | Python and Ruby variables and functions, Rust functions, PostgreSQL and MySQL columns |
| SCREAMING_SNAKE | Constants in most languages, environment variables (DATABASE_URL) |
| kebab-case | URL slugs, CSS classes, HTML attributes, CLI flags (--dry-run), npm package names |
| dot.case / path/case | Config keys (server.port), i18n message keys, file and route paths |
A common job is mapping between layers: database columns in snake_case, an API in camelCase, and constants in
SCREAMING_SNAKE. Pasting one name and copying the other forms avoids typos such as user_Id or userID
next to userId in the same codebase.