About this case converter

A small, dependency-free tool for one job: splitting text into words correctly, then rebuilding it in eleven common conventions at once. No account, no upload, nothing you type is ever recorded.

Why it exists

Renaming something across conventions — a Python snake_case field that needs to become a JavaScript camelCase property, a page title that needs a kebab-case slug — is one of those tasks that is trivial by hand for one word and tedious and error-prone for a real identifier or heading. Doing it by eye also means eleven separate re-typings if you actually want to compare every convention side by side. This tool does the boring, mechanical part — word-splitting and re-joining — correctly and instantly, for all eleven cases at once.

How the tokeniser is implemented

Everything except UPPERCASE, lowercase, Sentence case and aLtErNaTiNg cAsE first breaks the input into a list of words, in this order:

  1. Runs of spaces, underscores and hyphens become a single word break.
  2. An acronym boundary splits a run of capitals from a following capitalised word: XMLParserXML, Parser.
  3. A lowercase-or-digit-to-uppercase boundary splits: helloWorldhello, World.
  4. A letter-to-digit or digit-to-letter boundary splits either direction: state2Valuestate, 2, Value.
  5. Whatever remains is split on any run of non-alphanumeric characters, and empty pieces are dropped.

Each output case then joins that same word list its own way: no separator with the first word lowercase and the rest capitalised for camelCase, no separator with every word capitalised for PascalCase, an underscore between lowercased words for snake_case, and so on. Because every case is built from the same word list, converting an already-cased identifier (paste in some snake_case, get correct camelCase back) works the same way as converting plain prose.

UPPERCASE and lowercase transform the raw string directly with no tokenising step, so punctuation and spacing pass through untouched. aLtErNaTiNg cAsE flips the case of every character by its position in the raw string (lowercase at even indices, uppercase at odd), counting spaces and punctuation in that count too — which is what keeps the pattern from resetting at every word break. Sentence case lowercases the whole string, then capitalises the first letter of the string and the first letter following a run of ., ! or ? and whitespace.

How it was verified

The pure conversion logic lives in one file with no DOM dependency, so it can be exercised directly under Node with plain assertions — no browser, no test framework. Before shipping, it was checked against:

  • The exact worked examples for every case name against the input "hello world" (camelCase → helloWorld, PascalCase → HelloWorld, snake_case → hello_world, kebab-case → hello-world, CONSTANT_CASE → HELLO_WORLD, Title Case → Hello World, aLtErNaTiNg cAsE against the word "alternating case" itself → aLtErNaTiNg cAsE).
  • Mixed separators in one input — repeated spaces, underscores and hyphens together — tokenising down to the same clean word list.
  • Multi-sentence input for Sentence case, confirming only the first letter of each sentence is capitalised and the rest is lowercased.
  • Empty-string and null input to every function, confirming each returns an empty string or empty array rather than throwing.
  • Round-tripping already-cased input — camelCase, PascalCase, and an acronym-containing identifier — back through the tokeniser and out through every other case.
  • Digit boundaries splitting correctly in both directions.
  • UPPERCASE and lowercase preserving punctuation and whitespace exactly, unlike the tokenised cases.

How the site is built

  • Static HTML, one small stylesheet, one small script. No framework, no build step, no bundler.
  • Nothing loads from a network. No CDN framework, no web font, no remote image — the favicon is an inline SVG data URI. Once the page has loaded it keeps working offline.
  • System font stack. Your operating system's own UI font, so nothing has to download and nothing shifts as the page loads.
  • Nothing you type is transmitted. The whole conversion happens in your browser; text you paste in is never uploaded anywhere, and nothing is kept once you leave the page.
  • Dark mode follows your system setting via prefers-color-scheme.

Scope and honesty about limits

This is a pattern-based word splitter, not a natural-language parser and not a Unicode word-breaking implementation. It has no dictionary of known acronyms, so it cannot tell "URL" apart from any other run of capitals — it only recognises the shape of an acronym boundary. Non-Latin scripts, especially ones with no upper/lower case distinction, are handled best-effort: the whole-string cases pass such text through unchanged, and the word-based cases split on whatever punctuation-like characters are present, which will not always match what a native speaker would consider a "word".