Code

Convert Identifiers Between camelCase and snake_case

Converts identifier names between the five common conventions and flags collisions.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Paste the names one per line.
  2. Choose the convention to convert to.
  3. Select Convert.
  4. Check the Note column for collisions before using the result as column or key names.

What identifier case converter does

Crossing a boundary usually means crossing a naming convention: snake_case columns arriving as camelCase fields, kebab-case config keys becoming CONSTANT_CASE environment variables. Paste the names one per line and get the whole list converted, which is faster and less error-prone than editing them by hand.

Runs of capitals are handled properly, so HTTPServerConfig becomes http_server_config rather than h_t_t_p_server_config — that single rule is what most quick conversions get wrong. Collisions are flagged: two different names that convert to the same result is a real problem when the output is a set of column names or object keys, and it is invisible until something overwrites something else.

Frequently asked questions

HTTPServerConfig becomes http_server_config, not h_t_t_p_server_config. A run of capitals is treated as one word, and the last capital before a lower-case letter starts the next one — that single rule is what most quick conversions get wrong.

Two different inputs converting to the same output — userID and user_id both become userId. When the result is a set of column names or object keys, one silently overwrites the other, so collisions are flagged rather than left for you to notice later.

That one is for prose: sentence case, title case, upper and lower. This one splits an identifier into its words first, so it understands that firstName is two words and can rebuild it in any convention.