Camel Case Converter

Enter the text you want to convert to camelCase.

How it is calculated

The text is trimmed and split at every run of characters that is not a letter, digit or combining mark in any script: spaces, underscores, hyphens, dots and other punctuation all act as separators, and empty pieces are dropped. Each piece is lower-cased entirely. For camelCase the first word stays lower case and each later word gets a capital first letter; for PascalCase every word, the first included, gets one. The pieces are joined with no separator and the number of words is reported. Accented and non-Latin letters are kept. There is no detection of word boundaries inside an existing camelCase word, so getUserID becomes getuserid. Empty input gives no result.

Worked example

Input: user_first-name total. Splitting on the underscore, hyphen and space gives four words: user, first, name, total. Each is already lower case. camelCase keeps the first as it is and capitalises the rest: userFirstNameTotal. PascalCase capitalises the first one too: UserFirstNameTotal. The tool reports 4 words.

Try this example →

Common mistakes

  • Pasting an identifier that is already camelCase, such as getUserID, and expecting it to be split into get, User and ID. It has no separators, so it is one word and comes out as getuserid.
  • Expecting acronyms to keep their capitals. Every word is lower-cased first, so API turns into Api, which may differ from a style guide that wants API or HTTP kept upper case.
  • Forgetting that digits stay attached to their word. item_id 2nd place gives a word 2nd, and an identifier that starts with a digit is invalid in most languages.
  • Using accented letters in an identifier. They are kept as they are (café au lait becomes caféAuLait), but many languages and tools only accept plain ASCII names.
  • Using the output without checking the language's convention. Some languages want PascalCase for classes and camelCase for functions, while others prefer snake_case.

About this calculator

camelCase (first letter lowercase, each subsequent word capitalized) and PascalCase (every word capitalized, including the first) are the two dominant word-joining conventions in programming, used respectively for variables/functions in languages like JavaScript and Java, and for class and type names in languages like C#, Java, and TypeScript.

Converting free text into either style means first splitting the input on spaces, underscores, hyphens, and punctuation to recover the individual words, then rejoining them with the correct capitalization and no separators. This tool automates that split-and-rejoin so developers can turn a plain phrase, a snake_case identifier, or a kebab-case slug straight into a valid camelCase or PascalCase identifier for their code.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    Feeding api response code gives apiResponseCode and ApiResponseCode, and max-retry_count 3 gives maxRetryCount3 with four words counted, so a stray digit glues itself onto the previous word. That helps when you turn column names or labels into JSON keys or variable names. Scan the output for a number you did not mean to keep. Which naming style does your team follow, and do you need snake_case or kebab-case here too?

Popular calculators

All Calculators