Identifiers come in many naming conventions, and switching between them by hand is tedious and error-prone. A variable might be helloWorld in JavaScript, hello_world in Python, hello-world in a CSS class, and HELLO_WORLD as an environment variable. This string case converter turns any input into ten common case styles, all in your browser.
How it works
The hard part of case conversion is not the joining, it is splitting the input into words regardless of how it was originally written. The converter inserts word boundaries at:
- camelCase and PascalCase transitions, where a lowercase letter or digit is followed by an uppercase letter,
- acronym boundaries, where a run of capitals is followed by a capital-then-lowercase pair, so
HTTPRequestbecomesHTTPandRequest, - letter-to-digit and digit-to-letter changes, and
- any separator character such as space, underscore, hyphen, dot, or slash.
Each word is lowercased, and then every output style re-joins the words with the right separator and capitalisation.
Example
The input helloWorld_exampleHTTPRequest v2 splits into the words hello world example http request v 2. That produces helloWorldExampleHttpRequestV2 in camelCase, hello_world_example_http_request_v_2 in snake_case, and Hello World Example Http Request V 2 in Title Case.
Notes
Because the converter normalises everything to a clean word list first, you can paste input that already mixes styles and still get consistent output. CONSTANT_CASE and SCREAMING_SNAKE_CASE are listed separately for convenience but produce identical results. Everything runs locally, so identifiers from private code never leave your device.