What camelCase is
camelCase joins words together without spaces. The first word stays lowercase and every word after it starts with a capital letter:
first namebecomesfirstNametotal_order_countbecomestotalOrderCountis-logged-inbecomesisLoggedIn
Programming languages do not allow spaces in names, so developers need a way to show where one word ends and the next begins. camelCase does it with capitals.
How the converter reads your text
The tool works out where the words are, then joins them. It splits on:
- spaces and tabs
- underscores, hyphens, dots and slashes
- a lowercase letter followed by a capital, so
UserNameis read as “User” and “Name”
It then lowercases the first word, capitalizes the rest and removes the separators. Apostrophes are dropped, so “don’t stop” becomes dontStop. Numbers are kept.
Each line is handled on its own. That makes it easy to convert a column of database fields or a list of JSON keys in one go.
| Input | Output |
|---|---|
| user first name | userFirstName |
| order_total_amount | orderTotalAmount |
| background-color | backgroundColor |
| GetUserById | getUserById |
| API response code | apiResponseCode |
Where camelCase is used
- JavaScript and TypeScript: variables, functions and object properties
- Java, Kotlin and Swift: variables and method names
- JSON: keys in many web APIs
- C#: local variables and parameters
- CSS in JavaScript:
backgroundColorin place ofbackground-color
Other languages prefer different styles. Python and Ruby use snake_case for variables, and class names in most languages use PascalCase.
Common conversions
snake_case to camelCase. Useful when a Python or SQL backend sends data to a JavaScript frontend. Paste the field names and convert the list.
kebab-case to camelCase. CSS properties and HTML attributes use hyphens. JavaScript needs camelCase to read them, for example data-user-id becomes dataUserId.
Plain words to camelCase. Type a description such as “is email verified” and get a ready variable name.