Why You Are Here
You are naming JavaScript variables or functions. The ecosystem expects camelCase for identifiers, and you want a batch of names, getUserData, isLoggedIn, totalOrderValue, in one consistent style.
You are shaping JSON keys. Many APIs use camelCase keys, and you are converting field names from a snake_case database or a spreadsheet so the payload matches the front-end.
You are moving names between conventions. A set of snake_case columns or spaced labels that need to become camelCase before they reach a JavaScript codebase or a TypeScript interface.
What This Tool Does
The Camel Case Converter rewrites any text as camelCase: the first word lowercase, each following word capitalised, and no separators between them. Paste a word, a phrase, or an existing identifier, click convert, and it returns output ready for JavaScript variables, functions, and JSON keys.
camelCase and PascalCase Are Two Different Camels
The single most common confusion around this format is which word gets the first capital. The two variants look almost identical and belong in different places.
camelCase lowercases the first word
getUserData, orderTotal, isActive. This is lower camel case, and it is the convention for variables, function names, methods, and object properties in JavaScript and Java.
PascalCase capitalises the first word
GetUserData, OrderTotal, UserProfile. This is upper camel case, reserved for class names, React components, TypeScript types, and constructors.
This tool produces camelCase, the lower form
If you need the upper form for a class or a React component, capitalise the first letter of the output. Mixing the two is a frequent source of bugs, since a React component must start with a capital to be recognised as a component rather than an HTML tag.
What Happens to Each Kind of Input
Predict the output before you paste. camelCase removes the separators entirely rather than swapping them, which is what sets it apart from its siblings.
|
Input pattern |
You type | You get | What happened |
|
Plain words |
order total |
orderTotal |
Second word capitalised, joined |
|
snake_case |
is_logged_in |
isLoggedIn |
Underscores removed, words capitalised |
|
kebab-case |
main-nav-item |
mainNavItem |
Hyphens removed, words capitalised |
|
CONSTANT_CASE |
MAX_RETRY |
maxRetry |
Underscores removed, lowercased then camelised |
|
PascalCase |
UserProfile |
userProfile |
First letter lowercased |
|
dot.case |
app.base.url |
appBaseUrl |
Dots removed, words capitalised |
|
Acronym |
parse HTML string |
parseHtmlString |
Acronym treated as a word (see Section 5) |
|
Numbers |
address line 2 |
addressLine2 |
Digits stay attached in place |
|
Symbols |
user@name! |
userName |
Symbols removed |
|
Messy spacing |
first name |
firstName |
Spaces collapsed, edges trimmed |
The Acronym Problem Nobody Fully Agrees On
This is the honest heart of the page, and the one question every camelCase converter has to answer, quietly, whether or not it tells you. There is no universal rule for acronyms.
The two schools
Given getHTTPResponse or getHttpResponse, both are camelCase and both are defended by major style guides. There is genuinely no single correct answer, only house rules.
|
Guidance |
Rule | Result |
|
Google JavaScript |
Treat every acronym as a normal word |
getHttpResponse |
|
Microsoft .NET |
3+ letter acronyms as a word, 2-letter keep both caps |
getHttpResponse, getIOStream |
|
Common ad hoc |
Keep acronyms fully capitalised |
getHTTPResponse |
Why it matters for a converter
A tool has to pick one behaviour. The clean, widely recommended choice is to treat an acronym as a single word, so HTTP becomes Http, giving getHttpResponse. It reads well and stays consistent, but if your codebase has standardised on the all-caps style, you will need to adjust those names by hand.
The practical rule
Pick one convention and apply it everywhere. A codebase with both parseHTML and parseHttp is harder to search and read than one that is consistently either. Review acronym-heavy names after converting.
camelCase in JSON and APIs
The place camelCase meets its most common friction, the boundary between a JavaScript front-end and a back-end that names things differently.
Front-end and back-end often disagree
JavaScript uses camelCase, so front-end code and many JSON APIs use camelCase keys. Python and Ruby back-ends use snake_case, so their JSON often ships snake_case keys. The same field is userId on one side and user_id on the other.
Teams resolve it with a transform layer
Rather than argue, many projects convert keys automatically at the boundary, snake_case to camelCase on the way in, camelCase to snake_case on the way out. This converter is the manual version of that transform, useful when you are hand-writing an interface or a fixture.
Where camelCase Does Not Belong
camelCase is right for JavaScript and Java, and wrong nearly everywhere else. Naming this honestly is what keeps the page useful.
|
Do not use camelCase for |
Use instead |
|
Python variables and functions |
snake_case (PEP 8) |
|
SQL tables and columns |
snake_case |
|
Environment variables |
CONSTANT_CASE |
|
HTML class names and CSS |
kebab-case |
|
URLs and slugs |
kebab-case |
|
Class names and React components |
PascalCase |
Case sensitivity makes this bite in databases
Some databases fold unquoted identifiers to lowercase, so a camelCase column like orderTotal can silently become ordertotal and break later. snake_case avoids the problem entirely, which is why databases standardised on it.
camelCase and Its Siblings
If camelCase is not what your target expects, one of these is. The most common round trip is to snake_case for a Python or database name, which you can do with the Snake Case Converter.
|
Style |
Example | Separator | Casing | Best for |
|
camelCase |
userLoginCount |
none |
first word lower |
JavaScript, JSON, Java |
|
PascalCase |
UserLoginCount |
none |
every word capital |
Classes, components, types |
|
snake_case |
user_login_count |
Underscore |
all lowercase |
Python, Ruby, SQL |
|
kebab-case |
user-login-count |
Hyphen |
all lowercase |
URLs, CSS, slugs |
|
CONSTANT_CASE |
USER_LOGIN_COUNT |
Underscore |
all uppercase |
Constants, env vars |
Which Case to Use Where
| Situation | Convention of use |
|
JavaScript variables and functions |
camelCase |
|
JSON keys for a JS front-end |
camelCase |
|
Class names and React components |
PascalCase |
|
Python and SQL identifiers |
snake_case |
|
Environment variables |
CONSTANT_CASE |
|
URLs, slugs, and CSS classes |
kebab-case |
Match the language, not your taste
The right case is the one the surrounding code already uses. camelCase in a Python file or a CSS class is as jarring to a reader as snake_case in JavaScript.
Common Mistakes to Avoid
A React component named userProfile will be treated as an HTML tag and silently fail to render, because components must start with a capital. camelCase is for variables and functions; capitalise the first letter to get the PascalCase a component or class needs.
Mixing parseHTMLString and parseHttpString in the same project makes names harder to search and read. Choose one acronym rule, ideally treating acronyms as ordinary words, and apply it everywhere. Review acronym-heavy names after converting.
camelCase in a Python file breaks PEP 8, and a camelCase database column can be folded to lowercase by the engine and stop matching. Use snake_case for Python and SQL, and keep camelCase for JavaScript and JSON.
Quick Reference
| Item | Detail |
|
First word |
Lowercase |
|
Following words |
Capitalised |
|
Separators |
Removed, not replaced |
|
Splits on |
Spaces, hyphens, underscores, dots, capitals |
|
Numbers |
Preserved in place |
|
Symbols |
Removed |
|
Acronyms |
Treated as one word (Http, not HTTP) |
|
PascalCase |
Capitalise the first letter of the output |
|
Best for |
JavaScript variables, functions, JSON keys |
|
Not for |
Python, SQL, CSS, env vars, URLs |
|
Runs |
100% in the browser, nothing uploaded |
