Skip to content
LeedyBox
Support

Case Converter (camelCase, snake_case …)

Convert names line by line, or rename every key in a JSON document, between camelCase, PascalCase, snake_case, kebab-case and more.

All styles for the first line

Check the results before you use them. The tool is provided as is, without warranty, and its results can be incomplete or wrong. Terms of Service

Word boundaries are detected automatically, and acronyms are normalised (for example, userID becomes userId). Renamed keys can break code, APIs or database mappings that rely on the original names.

How to use

  1. With "Apply to" left at "Each line of text", paste or type your names into "Input", one per line. Each line is converted on its own, and blank lines and any spaces or tabs at the start or end of a line are kept.
  2. Choose a style under "Convert to", such as camelCase, snake_case or CONSTANT_CASE. The output updates as you type or change an option, so there is no convert button.
  3. To rename the keys of a JSON document, set "Apply to" to "JSON keys (values unchanged)" and paste the whole document. Keys inside nested objects and arrays are renamed too.
  4. In "Each line of text" mode, the "All styles for the first line" box shows the first line of the input that is not blank in all ten styles, so you can compare them before you pick one.
  5. Review the "Output", then click "Copy result".

Frequently asked questions

Is the text I enter sent anywhere?

No. The conversion runs in your browser with JavaScript, and the names or JSON you enter are not uploaded to LeedyBox.

How does the tool decide where one word ends and the next begins?

A new word starts where a lowercase letter or digit is followed by a capital (fooBar, user2Name), before the last capital in a run of capitals when a lowercase letter follows it (XMLHttp becomes XML and Http), and at any character that is not a letter or digit, such as a space, underscore, hyphen or dot. A change between letters and digits does not start a new word by itself, so base64Encode becomes base64_encode in snake_case and user2name stays one word.

Why don't I get my original name back when I convert it again?

Some details are lost on the way. Each word is re-cased by the chosen style, so parseHTML becomes parse_html in snake_case and comes back as parseHtml in camelCase. A number also joins the word before it once the separator is gone: total_amount_2 becomes totalAmount2 in camelCase and then total_amount2 in snake_case. Keep the original names if you need an exact round trip.

Why did punctuation disappear, and why does Title Case capitalize every word?

Every character that is not a letter or digit is treated as a break between words. Punctuation and symbols are not copied to the output, and only the style's own separator, if it has one, is placed between the words, so "Hello, world!" becomes "hello world" in lower case and don't becomes don t. Title Case capitalizes each word, including short ones like of and the, and lowercases the rest of the word, so NASA becomes Nasa and iPhone becomes I Phone. The tool is meant for names and identifiers rather than sentences.

What happens to JSON keys such as _id, @type or $ref?

A leading symbol counts as a separator, so it is removed: in camelCase, _id becomes id, @type becomes type and $ref becomes ref. A key made only of symbols, such as $, keeps its name. If two keys in the same object end up with the same name, for example _id and id, or user_name and userName, the tool shows an error that names both keys and the path of their object (such as $ for the top level) and converts nothing, so no value is overwritten.

Does JSON mode change anything besides the keys?

The document is parsed and written out again with two-space indentation, so its spacing and line breaks can change. Numbers pass through JavaScript: 1.0 is written as 1 and 1e2 as 100, integers larger than 9007199254740991 and decimals with many digits can be rounded, and a number too large for JavaScript, such as 1e400, becomes null. Some escapes in strings are written out as plain characters, for example \u00e9 as é and \/ as /. Keys that are, or become, whole numbers below 4294967295 without a leading zero, such as "2" or "_3", move ahead of the other keys in their object, in numeric order. If the same key appears twice in one object, only the last value is kept, without a warning. The input must be strict JSON, so comments and trailing commas cause an error.

Does it work with accented letters and non-Latin scripts?

Letters from any script count as word characters, and an accented letter stored as one character, such as é, is handled like any other letter. Scripts without upper and lower case, such as Korean, Chinese and Japanese, keep their characters unchanged, and only the separators between words follow the chosen style. Upper- and lowercasing follow the general Unicode rules, so ß becomes SS in UPPER CASE, and the capital İ becomes a plain i in lowercase. For Turkish or Azerbaijani names, turn on "Turkish letters": I then becomes ı, and i becomes İ. Combining marks, such as Thai tone marks, Thai and Hindi vowel signs, or an accent stored as a separate character, stay attached to their letter. Text written without spaces between words, such as Thai, Chinese or Japanese, is split only where it contains spaces or other separators.