Code Case Converter

Rename identifiers without retyping them. Paste variable, function or file names in any style, or plain phrases, and get them back in camelCase, PascalCase, snake_case, kebab-case or CONSTANT_CASE. Word boundaries are found from capital letters, digits, spaces, dashes and underscores, and acronyms such as XML or ID are kept together.

Case & Formatting Runs in your browser

Convert Identifier Case

How to Use the Code Case Converter

  1. Paste one identifier or phrase per line.
  2. Choose the target style under Convert to.
  3. Copy the converted list, or use the table below it to see every line in all five styles.

About This Tool

Developers moving names between languages (JavaScript camelCase, Python snake_case, CSS kebab-case, environment variables in CONSTANT_CASE) and anyone writing API field names or file names.

Input: Identifiers, one per line  ·  Output: Identifiers.

Features and Limitations

Features

  • Splits words at lower-to-upper changes (userId), at acronym ends (XMLHttp → XML Http), and at spaces, hyphens, underscores and dots.
  • Handles many lines at once and keeps blank lines in place.
  • A table shows each line in all five styles so you can copy whichever you need.
  • Works with accented letters as well as A to Z.

Limitations

  • Acronyms become ordinary words in camelCase and PascalCase (XMLHttpRequest → xmlHttpRequest); the original capitalisation of acronyms is not kept.
  • Digits stay attached to the word before them (version2Beta → version2_beta), which may not match every style guide.
  • Symbols other than letters and digits are treated as separators and removed.
  • Results are computed in your browser; nothing you enter is sent to a server.

Example

“XMLHttpRequest” becomes xmlHttpRequest, XmlHttpRequest, xml_http_request, xml-http-request and XML_HTTP_REQUEST.

Frequently Asked Questions

What is the difference between camelCase and PascalCase?

Both join words without separators and capitalise each word, but camelCase starts with a lower-case letter (userName) while PascalCase starts with a capital (UserName).

Where is each style used?

camelCase is common for JavaScript and Java variables, PascalCase for class names, snake_case for Python and database columns, kebab-case for URLs and CSS classes, and CONSTANT_CASE for constants and environment variables.

How are numbers handled?

A number stays with the word in front of it. “line 2 height” and “line2Height” both become line2_height in snake_case.

Can I convert normal sentences?

Yes. Spaces are word boundaries, so “max retry count” becomes maxRetryCount or MAX_RETRY_COUNT. Punctuation is dropped.

Related Tools

More like this: all Case & Formatting tools, all Text & Writing tools or the TinySandy home page.