Writing
Code
Other
Clean up
Shortcuts: Ctrl/Cmd + Enter copies the result, Ctrl/Cmd + Z undoes the last clean-up.
What camelCase is
camelCase joins words together with no spaces. The first word is lowercase and each following word starts with a capital letter, for example userFirstName. It is common for variable and function names in JavaScript, Java, Swift and many other languages.
How to use the converter
Type or paste a phrase such as user first name. With camelCase selected, the result box shows userFirstName. Click Copy to paste it into your code. You can also pick PascalCase, snake_case, kebab-case or CONSTANT_CASE.
camelCase vs PascalCase
PascalCase starts with a capital letter, for example UserFirstName, and is common for class and component names. camelCase starts lowercase.
Tips for good names
Use clear whole words, keep names short but meaningful, and follow the style your team or language already uses.
How the converter builds a name
It splits your text into words, lowercases them, then capitalises every word after the first and joins them with nothing in between. It treats spaces, underscores, hyphens, dots and any other punctuation as word breaks, and it also breaks at capital letters in names that are already joined, so existing names can be converted too.
| You type | camelCase result |
|---|---|
user first name | userFirstName |
hello_world-foo.bar | helloWorldFooBar |
getHTTPResponse | getHttpResponse |
XMLHttpRequest | xmlHttpRequest |
Order #42 shipped | order42Shipped |
Café au lait | caféAuLait |
If you paste several lines, each line becomes its own name, so a list of field labels converts in one go.
Which style for which language
- camelCase: the usual style for variables and functions in JavaScript, Java, Swift and Kotlin.
- PascalCase (first letter also a capital): classes and types in most of those languages, and component names in React.
- snake_case: variables and functions in Python (PEP 8), plus Ruby and Rust. See the snake_case converter.
- CONSTANT_CASE: constants in many languages. kebab-case: CSS class names, file names and URLs.
Check these before you paste into code
- Names cannot start with a digit.
42 answersbecomes42Answers, which most languages reject. Add a letter at the front. - Reserved words are not checked. A phrase like
classordefaultconverts fine, but you cannot use it as a name in many languages. - Acronyms are lowercased after the first word. The converter writes
getHttpResponse, notgetHTTPResponse, which several style guides recommend for readability. Edit the result if your team's convention differs.
More converters: Uppercase to Lowercase Converter · Lowercase to Uppercase Converter · Capitalize Text Online · snake_case Converter · Title Case Converter · Sentence Case Converter · All case options
- Does it handle several lines?
- Yes. Each line is converted on its own.
- What about numbers?
- Numbers are kept in the name where they appear in your text.
- What is the difference between camelCase and PascalCase?
- camelCase starts with a lowercase letter (userFirstName). PascalCase starts with a capital (UserFirstName). Both capitalise each following word.
- Can I convert snake_case or kebab-case to camelCase?
- Yes. Underscores, hyphens, dots and spaces are all treated as word breaks, so hello_world-foo becomes helloWorldFoo.
- Does it keep accented letters?
- Yes. Café au lait becomes caféAuLait. Accented letters are treated as letters, not as word breaks.
Questions
All converters: Uppercase to Lowercase · Lowercase to Uppercase · ALL CAPS Converter · ALL CAPS to Sentence Case · Capitalize Text · Title Case · Sentence Case · Toggle Case · Alternating Case · PascalCase · snake_case · kebab-case · CONSTANT_CASE & dot.case