Contact

Developer Case Converter

camelCase

Output appears here

PascalCase

Output appears here

snake_case

Output appears here

kebab-case

Output appears here

CONSTANT_CASE

Output appears here

dot.case

Output appears here

Train-Case

Output appears here

Found this tool useful? Share it:

Share
Share
Share
Share

What this developer case converter does

It converts a variable, function or file name into seven naming conventions at once: camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, dot.case and Train-Case. It understands names that are already in a convention, so getUserName, user_first-name and plain words like user first name all work as input. Paste a list with one name per line and every line is converted separately.

How to use it

  1. Paste one name or a list of names, one per line.
  2. Read the seven results, which update as you type.
  3. Use the copy button on the format you need.

The seven formats

Naming conventions, an example for getUserName, and where each is commonly used
FormatExampleCommonly used for
camelCasegetUserNameVariables and functions in JavaScript and Java, JSON keys.
PascalCaseGetUserNameClass and type names in languages such as C#, TypeScript and Java, and exported names in Go.
snake_caseget_user_nameVariables and functions in Python, Ruby and Rust, and database column names.
kebab-caseget-user-nameCSS classes, URL slugs and file names.
CONSTANT_CASEGET_USER_NAMEConstants and environment variables.
dot.caseget.user.nameConfiguration keys and property paths.
Train-CaseGet-User-NameHTTP header names such as Content-Type.

These are common conventions, not rules. Your team or framework may prefer something different.

How a name is split into words

Every format is built from the same list of words. A new word starts at any run of characters that is not a letter or digit (spaces, underscores, hyphens, dots, slashes), and wherever the case changes from lowercase or a digit to uppercase. A run of capitals followed by a capitalized word is split before that word, which is how acronyms inside a name are separated.

Examples of how names are split into words and converted
Inputsnake_casecamelCaseCONSTANT_CASE
getUserNameget_user_namegetUserNameGET_USER_NAME
XMLHttpRequestxml_http_requestxmlHttpRequestXML_HTTP_REQUEST
HTML5Parserhtml5_parserhtml5ParserHTML5_PARSER
userIDuser_iduserIdUSER_ID
user_first-nameuser_first_nameuserFirstNameUSER_FIRST_NAME
API response v2api_response_v2apiResponseV2API_RESPONSE_V2
don't stop me nowdont_stop_me_nowdontStopMeNowDONT_STOP_ME_NOW
order #42 / totalorder_42_totalorder42TotalORDER_42_TOTAL

Converting several names at once

Input, one name per line
getUserName
XMLHttpRequest
user_first-name
kebab-case
get-user-name
xml-http-request
user-first-name

Blank lines stay blank, so the output lines up with your input.

Limits

  • Acronyms become ordinary words in camelCase and PascalCase: XMLHttpRequest becomes xmlHttpRequest, not XMLHttpRequest. Some style guides keep acronyms capitalized, so adjust those by hand.
  • Names with a capital inside a brand are split there. iOS becomes i_os in snake_case, and iOS app version becomes iOsAppVersion in camelCase.
  • Apostrophes are removed, so don't becomes dont. Other punctuation and emoji act as word breaks and are dropped. Letters from other alphabets, including accented letters, are kept.
  • The result is not checked against a language. A name that starts with a digit (2fa code becomes 2faCode) or a reserved word may not be valid as an identifier.
  • Only the text you paste is converted. It does not parse or rewrite code.

Single-format converters

If you only need one format, each has its own page with the same conversion rules.

Frequently asked questions

How do I convert camelCase to snake_case?
Paste the name, for example getUserName, and copy the snake_case result, get_user_name. Every other format is shown at the same time.
Can I convert a whole list of names?
Yes. Put one name per line. Each line is converted separately and blank lines are kept, so the output matches your input line for line.
How are acronyms like XMLHttpRequest handled?
A run of capitals followed by a capitalized word is split before that word, so XMLHttpRequest becomes xml_http_request. In camelCase and PascalCase the acronym turns into a normal word (xmlHttpRequest).
Why did iOS turn into i_os?
The converter splits a name wherever lowercase meets uppercase, and it cannot tell that iOS is one brand name. Type such names the way you want them split, for example ios.
What happens to numbers?
Digits stay attached to the word before them (html5_parser, api_response_v2) and a number on its own becomes its own word (order_42_total).
Does it remove punctuation?
Apostrophes are removed (don't becomes dont). Other punctuation, slashes and emoji act as word breaks and are dropped. Accented and non-Latin letters are kept.
Does it check that the result is a valid identifier?
No. A result can start with a digit or match a reserved word of your language, so check names that you will use in code.
Which format should I use?
Follow the convention of your language or framework, for example camelCase for JavaScript variables, snake_case for Python, kebab-case for CSS classes and CONSTANT_CASE for environment variables.
Is my text sent anywhere?
No. Conversion happens in your browser and nothing you type here is sent to our servers.