FIRST CH TOOLS / 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

Target case
Text to convert
Result
0
Items converted
0
Actually changed
0
Words found
Input case (detected)
Every case
Checks

    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.

    How to Use

    1. Pick the target caseEleven of them, from camelCase to UPPER CASE. The result changes the moment you choose.
    2. 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.
    3. 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 (URLParserurlParser).

    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 2FactorAuth2_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