LocalExcelTool
Get started

Naming Case Converter

Convert between camelCase, PascalCase, snake_case, kebab-case and CONSTANT_CASE.

Runs in your browserNo account neededFree

What is Naming Case Converter

A naming case converter converts identifiers between camelCase, PascalCase, snake_case, kebab-case and CONSTANT_CASE. It splits mixed input into words and reassembles them in the chosen style.

🔒 Everything runs in your browser. Nothing is uploaded.

What this tool actually does with your file

Where it runs
In your browser, on this page
Upload
None — the file never leaves your device
Offline
Works with the network disconnected

Splitting an identifier into words is the whole problem

camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE and dot.notation all encode the same word list, so the conversion is only as good as the tokeniser. This one splits on lower-to-upper boundaries, then on upper-run-to-word boundaries, then on separators — which is why parseHTMLDocument becomes parse, HTML, Document rather than parse, H, T, M, L, Document.

The acronym boundary is where naive implementations fail. A single regex for lower-followed-by-upper turns HTTPServer into H, T, T, P, Server or http, server depending on ordering. Getting it right needs two passes, and the second pass is specifically for uppercase runs followed by a lowercase letter.

Digits and existing separators

A digit next to a letter is ambiguous: utf8Decoder could be utf8 + decoder or utf + 8 + decoder, and both conventions exist in the wild. This implementation treats the digit as part of the preceding token, which matches the common Python and Go styles but not every codebase.

Mixed input — some_snake and someCamel in the same string — is accepted and normalised, because the splitter runs all the rules in sequence. That tolerance is useful when converting a CSV header row, where the columns were named by different people at different times.

What conversion cannot fix

Renaming a variable in a codebase is a refactor, not a string transform: the same word may appear in comments, log messages, JSON keys and a database column, and only one of those should change. Use this for generating a naming-convention table or converting a header row, not for a find-and-replace across a repository.

Also watch for collisions after conversion. user_id and userId and user-id all become user_id, so a table keyed on the converted name silently merges three distinct columns into one. Check for duplicate output before using it as a header row.

How to use it

  1. 1.Enter an identifier
  2. 2.Pick a naming style
  3. 3.Copy the result

How Naming Case Converter works under the hood

Text tools look trivial until encoding enters the picture. The bytes are unambiguous; the characters they represent are a guess unless the encoding is declared.

  1. 1

    Read bytes, not characters

    The file is read as an ArrayBuffer so the original bytes are preserved, including a byte-order mark if present.

  2. 2

    Decode with a declared or detected encoding

    TextDecoder converts bytes to text. UTF-8 is validated; a BOM is used when present; legacy encodings must be chosen explicitly because guessing between GBK and Shift_JIS is unreliable.

  3. 3

    Transform as a pure function

    Escaping, quoting, case changes and line-ending normalisation are applied to the decoded string, so the same input always gives the same output.

  4. 4

    Encode and download

    The result is encoded back to UTF-8 (or the format's own escaping rules) and returned as a Blob.

  5. Processing pipeline

Why a file looks like mojibake

Mojibake is the same bytes decoded with the wrong table: Shift_JIS read as UTF-8, or GBK read as Latin-1. Nothing is corrupted in the file itself. If the output is garbled, the fix is to re-run with the correct source encoding, not to edit the text by hand — editing bakes the wrong characters in permanently.

CSV quoting is not optional

A CSV field containing a comma, a quote or a newline must be wrapped in double quotes, and inner quotes doubled. Tools that skip this produce files that look fine until someone imports them and the columns shift. This converter applies RFC 4180 quoting on output.

Where text tools stop

There is no reliable way to detect an unknown legacy encoding from content alone, and no way to recover bytes that were already lost. Mixed encodings inside one file cannot be fixed automatically. Very large inputs are capped because regular expressions and repeated string concatenation can take quadratic time.

Verify it yourself

Text is transformed in memory. Nothing is sent while it runs.

  1. 1.Open DevTools on this page and switch to the Network tab
  2. 2.Keep the filter on Fetch/XHR and run the tool
  3. 3.Confirm no request carries your file — you should see only page assets and fonts

Frequently asked questions

What input formats work?

Spaces, underscores, hyphens, camelCase, PascalCase and UPPER_CASE constants are all split into words automatically.

Does it handle non-Latin identifiers?

Scripts without word separators, such as Japanese-only input, are left as-is.

What this kind of conversion cannot keep

Text tools never leave the page: the string you paste is transformed in memory and written back to the result box. There is no request, no log and no retention, which also means there is no way to recover a value you closed the tab on.

More in Text