Convert text to camelCase
Paste a phrase, a snake_case name or a kebab-case slug below and read the camelCase result straight off the highlighted row — every other common case is shown alongside it at the same time.
What camelCase is, exactly
camelCase joins words with no separator, keeps the first word entirely lowercase, and capitalises the first letter of every word after it — the capital letters sit like the humps of a camel along an otherwise lowercase line, which is where the name comes from. first name, first_name and first-name all become firstName; user account id becomes userAccountId.
It is the default convention for variable and function names in JavaScript (and by extension TypeScript), Java, C# and Swift. Getting it right matters beyond style: JavaScript object property names and JSON keys are frequently expected in camelCase by convention across an API boundary, so a mismatched first_name versus firstName is a common source of "why is this field undefined" bugs when front-end and back-end teams use different default conventions.
camelCase versus PascalCase, side by side
| Input | camelCase | PascalCase |
|---|---|---|
| hello world | helloWorld | HelloWorld |
| user_account_id | userAccountId | UserAccountId |
| page-title | pageTitle | PageTitle |
| XML parser | xmlParser | XmlParser |
The last row is worth a second look: this tool's tokeniser splits XMLParser-style input into XML and Parser as two words, and camelCase then lowercases whichever of those two words comes first — so an acronym that happens to be the leading word loses its capitals entirely (xmlParser, not xMLParser). That is a direct consequence of "the first word is always fully lowercase" and is usually the result you want.
Quick check. If the very first character of your result is uppercase, you have PascalCase, not camelCase. That single letter is the entire difference between the two conventions.
Frequently asked questions
Does camelCase capitalise the first letter?
No — that would be PascalCase. camelCase keeps the very first letter lowercase (helloWorld) and capitalises the first letter of every word after that. PascalCase capitalises the first letter too (HelloWorld). Mixing them up is the single most common camelCase mistake.
Can I convert snake_case or kebab-case straight to camelCase?
Yes. Underscores and hyphens are treated as word breaks, so first_name becomes firstName and page-title becomes pageTitle in one pass, with no need to type the words in separated form first.
What does camelCase do with numbers?
Digits are split from surrounding letters and treated as their own word. address2Line stays address2Line if it is already in that shape, but a plain phrase like address 2 line converts to address2Line the same way — the digit sits as its own token between the words either side of it.
Is camelCase valid for every programming language's variable names?
It is valid syntax in effectively every mainstream language — camelCase is just letters and digits with no special characters, which every identifier rule accepts. What differs is convention, not validity: JavaScript, Java, C#, Swift and Kotlin all expect camelCase for variables and functions by default; Python and Ruby style guides expect snake_case instead, even though camelCase would still run.