camelCase to PascalCase converter

Turn camelCase variable and function names into PascalCase so they work as class or component names.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter camelcase names (one per line or inside text) and keep acronyms in capitals (such as html and id).
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

Each camelCase name is split into words at every change from a lowercase letter or digit to a capital, and before the last capital of an acronym that is followed by a lowercase letter. Every word then starts with a capital and the rest of it is lowercase, with no separator. With the acronym option on, all-capital words such as ID stay as they are when the name also has lowercase letters. Symbols and spaces around the names are left as they are. Example: userProfile becomes UserProfile.

Example

Inputs: Keep acronyms in capitals (such as HTML and ID) = yes. Result: PascalCase result: UserProfile ParseHTMLString GetUserID; Names processed: 3.

userProfile
parseHTMLString
getUserID
UserProfile
ParseHTMLString
GetUserID

Limits and caveats

  • A name with no capital to mark the word break, such as username or an Arabic name, cannot be split.
  • Every word in the pasted text is converted, including keywords and library names, so review the result before pasting it into code.

Questions about this tool

Why do React components need PascalCase?

JSX treats a tag that starts with a lowercase letter as a plain HTML element, so the component userCard must be written UserCard to render as a component.

What changes if I turn off the acronym option?

With the option on, parseHTMLString becomes ParseHTMLString; with it off, HTML is treated as a normal word and you get ParseHtmlString.

Does anything change besides the first letter?

With the option on, only the first letter changes in most names, and words written in capitals stay as they are.