FIRST CH TOOLS / Text / 38 CASE CONVERTER
Case Converter — camelCase, snake_case, kebab-case
Convert identifiers between camelCase, snake_case, kebab-case, PascalCase and CONSTANT_CASE. Paste as many lines as you like and they are converted in one pass, or switch to per-field mode to tidy a comma or tab separated CSV header row without touching the separators. Acronyms such as XMLHttpRequest and digit runs such as sha256Hash are split the way you meant them.
Converted as you type
Leading and trailing spaces, indentation and the line endings (LF / CRLF) are all preserved, so you can swap the names without disturbing the layout of a table or a block of code. Blank lines and lines made only of punctuation are left alone.
Where each case belongs
| Case | Example | Where it is used |
|---|---|---|
| camelCase | userName | Variables and functions in JavaScript, Java and Swift; JSON keys |
| PascalCase | UserName | Class and type names, React / Vue components, public members in C# |
| snake_case | user_name | Variables and functions in Python, Ruby and PHP; SQL tables and columns |
| CONSTANT_CASE | USER_NAME | Constants, environment variables (.env), Makefile variables |
| kebab-case | user-name | URL paths, CSS classes and custom properties, HTML attributes, npm package names, file names |
| Train-Case | User-Name | HTTP header names (Content-Type / X-Request-Id) |
| dot.case | user.name | Configuration keys (application.properties), namespaces, log field names |
| Title Case | User Name | Headings, table column headers, UI labels |
| Sentence case | User name | Body copy, descriptions, form labels |
| lower case | user name | Normalising for search, tags |
| UPPER CASE | USER NAME | Emphasised headings, printed field names |
When in doubt, follow the convention of the language and the layer you are in. Within a single project it is perfectly normal for database columns to be snake_case, the JSON of the API camelCase and the URLs kebab-case — this tool exists to do the mechanical conversion at those boundaries.
How to Use
- Pick the target caseEleven of them, from camelCase to UPPER CASE. The result changes the moment you choose.
- Paste your textOne item per line by default. To tidy a CSV header row, switch the unit to "each comma / tab separated field" and only the field names are converted — the separators stay exactly as they were.
- CopyTake the whole right-hand box, or click a row under "every case" to copy just that one. Name collisions and results starting with a digit are listed under Checks.
About This Tool
Case conversion is really the question of where the word boundaries are. With a separator such as user_name that is easy; with a run of capitals such as XMLHttpRequest it is not. This tool breaks before a run of capitals only when that run is followed by a capital and a lower-case letter, which gives XML / Http / Request — a naive "split before every capital" gives you X / M / L / Http….
Digits stay attached to the word before them by default. sha256Hash is sha256 / Hash, not sha / 256 / Hash. Turn on "start a new word at digits" when a version number or a size really is its own word. A word that starts with digits and continues in lower case, such as 2fa, is kept as one word; when capitals follow, as in 2FactorAuth, the boundary is taken as deliberate and kept.
Acronyms (ID, URL, XML) are handled differently by different style guides. The default folds them, giving parseXmlData — the form Google's style guides use, because it still shows the boundaries when two acronyms meet, as in parseXMLHTTPData. If you need to match existing code that writes userID, turn on "keep acronyms capitalised". The first word of a camelCase name is lower-cased either way (URLParser → urlParser).
To tidy CSV headers, choose "each comma / tab separated field". A line containing tabs is split on tabs, otherwise on commas, and the separators and the spacing around them are left untouched — a tab separated row copied straight out of Excel comes back in the same shape. In this mode the tool also checks whether two columns end up with the same name: first name and first_name both become first_name. Colliding column names are how one of them silently disappears on import, so the count and the names are reported.
Text in scripts without letter case — Japanese, for instance — is passed through unchanged, though separators still work (受注 日付 becomes 受注_日付). Such words are never transliterated into Latin letters: guessing a reading is easy to get wrong, and being quietly wrong is worse than leaving it alone.
Results that start with a digit are flagged too. Most languages will not accept an identifier beginning with a number, so 2FactorAuth → 2_factor_auth cannot be used as a variable name as it stands; it needs a prefix or a rewording.
Nothing you paste ever leaves the browser — the conversion and the checks all run on your machine. Directly callable via URL parameters: /en/case/?text=user_name&format=camel / /en/case/?text=first%20name,last%20name&format=snake&scope=items
From AI Agents
The same conversion logic is available as the case_convert tool of the MCP (Model Context Protocol) server @first-ch/tools-mcp, so an AI agent can call it directly without driving a browser — handy for mechanical jobs such as renaming variables in bulk or normalising CSV headers. See How to use from AI agents for the details.
Install
claude mcp add firstch-tools -- npx -y @first-ch/tools-mcp
Examples
# Convert one item per line to camelCase case_convert(text="user_name\nlast-name\nEMAIL_ADDRESS", format="camel") # Tidy a CSV header row into snake_case, keeping the separators case_convert(text="First Name, Last Name, E-Mail", format="snake", scope="items") # See one identifier in every case case_convert(text="XMLHttpRequest", allFormats=true) # Read a file, convert it and write the result somewhere else case_convert(path="/tmp/headers.csv", format="kebab", scope="items", outputPath="/tmp/out.csv")
Other Tools
66URL Slug Generator (Japanese → Romaji)A Japanese title makes a URL that turns unreadable once copied; this gives you a romaji slug for WordPress and other CMSs instead. Kana become Hepburn romaji, symbols go, and the result is lowercased and hyphenated. Type kanji readings in kana; underscores, long-vowel spelling and a length limit are switchable.
41Katakana Converter (Full-Width ↔ Half-Width)Tidies the character widths in a manuscript, or in text you are about to import as CSV. Choose half-width, full-width or as-is for letters and digits, katakana, symbols and spaces; ガ comes back as one character, ガ. Leftover ideographic spaces are flagged, and invisible characters such as zero-width spaces can be removed.
- Browse category: Text
- Browse all tools