toolfree

Case converter

Convert text between naming conventions in your browser. Acronyms stay whole and CJK is left alone.

Runs in your browser

Chinese, Japanese and Korean have no case, so they are returned unchanged.

Title case keeps short prepositions and articles lowercase unless they are first or last.

Acronyms are the test

parseJSON should become parse_json. A converter that splits on every capital gives parse_j_s_o_n, and that is the single most common defect in these tools.

The rule is that a run of capitals is one word, except that its last capital begins the next word when a lowercase letter follows. So:

Inputsnake_case
parseJSONparse_json
JSONParserjson_parser
HTMLElementhtml_element
getURLForget_url_for
IOErrorio_error

Chinese, Japanese and Korean are returned unchanged

There is no case in any of them, so there is nothing to convert. Every style here leaves CJK exactly as it was, and a CJK run is treated as one indivisible word so that mixed text splits sensibly — 台北City becomes 台北_city, not something with the characters pulled apart.

Title case, and which convention

Title case keeps short articles and prepositions lowercase unless they are the first or last word: The Lord of the Rings, A Tale of Two Cities, but What Are You Waiting For.

That is one convention among several — some style guides capitalise every word over four letters instead, others capitalise everything. There is no universal answer, so this one is named rather than presented as the rule.

One thing that genuinely cannot be resolved

A-B-C in camelCase is aBC. Convert aBC back and you get aBc, because BC is character-for-character indistinguishable from an acronym.

No converter can tell those apart — the information that would distinguish them is not in the string. Every other input round-trips; single-letter words do not, and that is a property of the notation rather than a bug to fix.

Nothing is uploaded

Converted in this page.