Case Converter
Eleven naming conventions, applied correctly to acronyms and mixed input.
Which convention belongs to which language
| Convention | Example | Conventional in |
|---|---|---|
camelCase | userAccountId | JavaScript, Java, Swift, JSON keys |
PascalCase | UserAccountId | C# and .NET, Java classes, React components, Go exported names |
snake_case | user_account_id | Python, Ruby, Rust, SQL identifiers, C headers |
kebab-case | user-account-id | CSS classes, HTML attributes, URL slugs, npm package names |
CONSTANT_CASE | USER_ACCOUNT_ID | Compile-time constants in nearly every language |
Title Case | User Account Id | Headings, article titles, button labels |
Sentence case | User account id | Body copy, list items, tooltips |
The hard part is not the shift key
Converting is easy; splitting the input into words is where converters go wrong. The two rules that matter: an uppercase run followed by a lowercase letter starts a new word (HTTPServer is HTTP + Server, not H T T P Server), and a letter followed by a digit or a digit followed by a letter is a boundary (img12 becomes img + 12). This page applies both, so HTTPServer response_code splits into HTTP, Server, response, code.
Title case has rules, not a rule
There is no single correct title case. Chicago style lowercases short prepositions and articles (of, the, a, and) unless they open or close the title; APA capitalises any word of four letters or more. This tool capitalises every word, which is the right default for headings and button labels, and you can lowercase the joiners afterwards if a style guide demands it.
Two traps in code generation
- Acronyms in camelCase.
ParseXMLDocumentconventionally becomesparseXmlDocument, notparseXMLDocument. Squash acronym runs to one capital when they are not at the start of a word. - Reserved words.
class,default,importand their relatives are legal identifiers in one language and illegal in another. A name likeimportis fine as a JSON key and fatal as a Python variable — check, do not assume.
For anything on a website, kebab-case is the safe choice: it is case-insensitive on every filesystem that would host it, it survives people retyping a URL, and it is what search engines expect in a slug.
How to use it
- Paste your text — any mix of casing, underscores, hyphens or spaces will do.
- Pick the target convention.
- Copy the result. The word split is shown so you can check acronym handling.
Worth knowing
- Word splitting handles acronym runs:
HTTPServer→HTTP+Server. - Digit-to-letter boundaries are treated as word breaks, so
img12→img+12. - Eleven modes are supported, from
camelCasethroughCONSTANT_CASEandalternating. - Non-ASCII letters are preserved rather than silently dropped.
Limitations
- Title case here capitalises every word; style guides that lowercase short prepositions need manual adjustment.
- No dictionary lookup is performed, so
WiFicannot be restored fromwifi. - Language-specific name mangling (Go's exported-name rule, Java's bean conventions) is not applied.
- Repeated words are kept — deduplication is a separate tool.
Frequently asked questions
What is the difference between camelCase and PascalCase?
camelCase starts lowercase and is used for variables, methods and JSON keys; PascalCase starts uppercase and is used for class names, React components and Go exported identifiers.How does it handle acronyms like HTTP?
HTTPServer becomes HTTP and Server rather than an unreadable character run.Should I use snake_case or kebab-case in a URL?
Why did my constant become `CLASS_NAME`?
CLASS was reserved. CONSTANT_CASE output is mechanically derived; if the result collides with a reserved word in your language, rename the source concept rather than relying on casing.