Home/Tools/Text & developer utilities
Case Converter
Nine cases, including the ones programmers need.
The programmer cases, and where each is used
- camelCase — JavaScript and Java variables and functions.
- PascalCase — class and type names in most languages, and React components.
- snake_case — Python and Ruby variables, and SQL column names.
- kebab-case — URLs, CSS class names, HTML attributes. It cannot be used for variable names in most languages because the hyphen reads as minus.
- CONSTANT_CASE — constants and environment variables.
These are conventions rather than rules, but they are strongly held. Using the wrong one marks code as foreign in a codebase faster than almost anything else.
Title case is not simply capitalising everything
Proper title case leaves short words lowercase unless they start the title: articles, conjunctions and short prepositions. "The Catcher in the Rye", not "The Catcher In The Rye".
Which words count as short varies between style guides — the AP, Chicago and New York Times rules all differ, particularly on prepositions of four or five letters. The list used here is the common core, and you may need to adjust a word or two by hand for a specific house style.
What gets lost
Converting to any of the programmer cases discards punctuation and spacing entirely, because those characters are not legal in identifiers. Going back is not possible: userId could have come from "user id", "User ID" or "user-id", and nothing in the result records which.
Acronyms are the specific casualty. "parse HTML string" becomes parseHtmlString, and whether you wanted parseHTMLString is a matter of house style that no converter can guess.
Common uses
- Fixing text typed with caps lock on.
- Renaming variables between languages with different conventions.
- Preparing headings in a consistent title case.
- Turning a label into an identifier.
Questions people ask
What is the difference between camelCase and PascalCase?
The first letter. camelCase starts lowercase and is used for variables; PascalCase starts uppercase and is used for classes and types.
Which words stay lowercase in title case?
Articles, conjunctions and short prepositions, unless they start the title. Style guides disagree on the details, particularly longer prepositions.
Why can I not convert back from snake_case?
Because the original punctuation and capitalisation are gone. 'user_id' could have been 'user id', 'User ID' or 'user-id'.
What happens to acronyms?
They get normalised. 'parse HTML string' becomes parseHtmlString, and whether you wanted parseHTMLString is a house style decision.
Your text stays in the page
This matters more here than on most tools. People paste API keys into hash generators, customer data into CSV converters, contract wording into diff checkers and configuration into JSON validators. Almost every site offering these sends your input to a server to process it.
Nothing here is transmitted. The work happens in your browser, this site is static files with no server behind it, and the about page lists every request the site makes, read live from your own browser so you can check rather than trust.