camelCase is the most common way to name variables and functions in languages like JavaScript and Java. This converter takes any phrase or differently-cased identifier and rewrites it in clean camelCase, handling spaces, underscores, hyphens, and existing case boundaries automatically.
How it works
The converter normalises your input into a list of lowercase word tokens, then rejoins them with the camelCase rule. Word boundaries are detected several ways:
"user profile id" -> [user, profile, id]
"user_profile_id" -> [user, profile, id]
"UserProfileID" -> [user, profile, id]
"oauth2Token" -> [oauth, 2, token]
Each token after the first has its initial letter uppercased, the first stays
lowercase, and they are concatenated with no separators. So all of the examples
above collapse to a single camelCase string such as userProfileId.
Language convention guide
Knowing when to use camelCase helps you follow the idiom of each language:
| Language / context | Convention | Example |
|---|---|---|
| JavaScript / TypeScript — variables, functions | camelCase | getUserProfile |
| JavaScript / TypeScript — classes | PascalCase | UserProfile |
| Java — methods, variables | camelCase | calculateTotal |
| C# — methods, public properties | PascalCase | CalculateTotal |
| C# — local variables, parameters | camelCase | calculateTotal |
| Python — variables, functions | snake_case | calculate_total |
| CSS custom properties / HTML attributes | kebab-case | --primary-color |
| JSON keys (common but not universal) | camelCase | "userId": 1 |
When working across a boundary — for example, a Python backend sending JSON to a JavaScript frontend — you often need to convert between snake_case and camelCase. This tool handles that direction (any input format → camelCase).
Worked conversions
| Input | Output | Notes |
|---|---|---|
user profile id | userProfileId | plain phrase |
user_profile_id | userProfileId | from snake_case |
user-profile-id | userProfileId | from kebab-case |
UserProfileID | userProfileId | from PascalCase, acronym lowercased |
get HTTP response | getHttpResponse | acronym lowercased |
oauth2 token | oauth2Token | digit preserved |
Handling acronyms
Acronyms like HTTP, URL, ID, and API are normalised to title-initial form: Http, Url, Id, Api. This is the dominant convention in most style guides because it allows camelCase boundaries to remain unambiguous — getHTTPSUrl is harder to split than getHttpsUrl. If your codebase preserves acronym caps, adjust the output manually after copying.
Conversion tips
- If you are converting a full column of names (database column headers to JS object keys, for example), paste them all at once separated by lines and convert each manually. The converter processes one identifier at a time.
- After converting, verify the result works as a valid JavaScript identifier: it must not start with a digit, and must not be a reserved word like
class,return, ornew.