Free Online camelCase to snake_case Converter

Convert camelCase to snake_case instantly: paste a variable, function or column name and copy the result, with examples.

Converter

camelCase, snake_case, kebab-case & Every Naming Style In Between

Convert an identifier or phrase between 17 case conventions

—

Results are provided for informational purposes only and may contain errors. Please verify important information independently. Use of this tool is at your own risk.

How to convert camelCase to snake_case

Convert camelCase names to snake_case instantly. Type or paste a variable, function or column name and get the snake_case version as you type.

  1. Type or paste a camelCase name, such as getUserById, into the box above.
  2. The snake_case version appears right away: getUserById becomes get_user_by_id.
  3. Copy the result, or pick one of 17 naming styles for the From and To boxes.

How the conversion works

The converter first splits the name into words: at each capital letter, underscore, hyphen, dot and space. Then it writes the words in snake_case: every word lowercase, joined with underscores. Runs of capitals such as HTTP are kept together as one word, and digits stay attached to the word they follow.

camelCase to snake_case examples

camelCasesnake_case
getUserByIdget_user_by_id
firstNamefirst_name
parseHTTPResponseparse_http_response
isValidis_valid
totalPriceUsdtotal_price_usd
address2Lineaddress2_line

camelCase and snake_case explained

camelCase starts with a lowercase word and capitalizes every following word, with no separators. It is the standard for variables and functions in JavaScript, Java, C# and Swift.

snake_case writes every word in lowercase and joins them with underscores. It is the standard in Python and Ruby and the usual style for database column names.

Frequently asked questions

What happens to acronyms like HTTP or ID?

A run of capital letters is treated as one word, so parseHTTPResponse becomes parse_http_response in snake_case.

Does it change the meaning of my code?

No. It only rewrites the name. Remember to rename every place that uses the name, or your code will look for the old one.

Which style should I use?

Follow the convention of your language or project: camelCase in JavaScript and Java, snake_case in Python, Ruby and SQL, kebab-case in URLs and CSS.

Is this tool free?

Yes, it's free to use. No signup, no email required. Get results on this page.

How do I get my result?

Use the tool on this page. Your result appears here; no email delivery is required.