← Back to the tool

camelCase Converter — Rules, Examples & When to Use It

Updated: May 2026

camelCase is one of the most widely used naming conventions in software development. Understanding exactly when and how to apply it — and how it contrasts with PascalCase, snake_case and kebab-case — prevents naming inconsistencies that accumulate technical debt over time.

Convert text to camelCase →

Free · No upload · Instant results

What is camelCase?

camelCase is a compound-word notation where each word in a phrase is capitalised except the first, and all spaces and punctuation are removed. The resulting string resembles the humps of a camel — hence the name.

Examples of camelCase identifiers:

  • getUserName — a function that retrieves a user's name
  • isLoggedIn — a boolean variable
  • totalItemCount — a counter variable
  • fetchApiResponse — an asynchronous function
  • maxRetryAttempts — a configuration constant (though constants more often use SCREAMING_SNAKE_CASE)

The key rule: the first character of the entire identifier is always lowercase, regardless of the source text. Every subsequent word starts with a capital letter.

camelCase vs PascalCase — the critical difference

PascalCase (also called UpperCamelCase) follows the exact same logic as camelCase, but capitalises the first word too. The visual difference is small but the semantic distinction matters enormously in most codebases.

  • camelCase: getUserData, handleClick, isVisible
  • PascalCase: UserProfile, HandleClick, IsVisible

In practice, most style guides reserve PascalCase for type-level identifiers: classes, interfaces, enums, React components and TypeScript types. camelCase is reserved for instance-level identifiers: variables, function parameters, method names and object properties.

A quick heuristic: if you can create multiple instances of it, use camelCase. If it is a blueprint or category, use PascalCase. new UserProfile() creates an instance of the UserProfile class, so the class is PascalCase and any variable holding the instance would be camelCase (const userProfile = new UserProfile()).

Language-by-language conventions

camelCase is not universal. Each language and framework has established norms worth knowing before joining a codebase.

  • JavaScript / TypeScript: camelCase for variables, functions and object properties. PascalCase for classes and React components. This is mandated by ESLint's camelcase rule and the Airbnb style guide.
  • Java: camelCase for fields and methods; PascalCase for classes. The Java Language Specification and Google Java Style Guide both define this explicitly.
  • Swift: camelCase for all variables, constants and functions. PascalCase for types, protocols and enumerations.
  • Kotlin: identical to Java conventions — camelCase for member names, PascalCase for type names.
  • C#: camelCase for private fields and parameters; PascalCase (often called Pascal case in Microsoft docs) for public members and types. Microsoft's .NET naming guidelines formalise this split.
  • Python: Python prefers snake_case for variables and functions. camelCase appears in Python code that bridges Java or JavaScript APIs, or in older Django code, but it is not idiomatic.

Handling acronyms in camelCase

Acronyms such as URL, HTTP, ID or API create ambiguity. Two schools of thought exist:

  • Treat acronyms as words: getHttpUrl, parseXmlDocument, userId. This is the recommendation of the Google Java Style Guide and most modern linters. It produces predictable patterns regardless of acronym position.
  • Keep acronyms uppercase: getHTTPURL, parseXMLDocument, userID. Some older codebases and Microsoft guidelines use this. It is readable but creates inconsistency when acronyms appear mid-identifier (parseHTTPURLQuery is harder to scan than parseHttpUrlQuery).

The most important rule is consistency within a project. If the existing code writes userId, do not introduce userID in a new file. Your linter configuration should enforce whichever convention the team chooses.

Common mistakes when writing camelCase

  • Capitalising the first letter: GetUserName is PascalCase, not camelCase. This is the most frequent mistake for developers coming from C# or Java class authoring.
  • Leaving spaces or underscores: get_user_name is snake_case. Mixing conventions in a single identifier is always wrong.
  • Inconsistent acronym handling: writing getHTTPResponse in one file and getHttpResponse in another makes search-and-replace unreliable and confuses code reviewers.
  • Using camelCase for constants: most style guides prefer MAX_RETRIES over maxRetries for module-level or class-level constants, because the casing signals immutability to the reader.

Frequently asked questions

What is camelCase?

camelCase is a naming convention where compound words are joined without spaces and every word after the first starts with an uppercase letter. Example: getUserData, firstName, isLoggedIn.

Is camelCase the same as lowerCamelCase?

Yes. lowerCamelCase and camelCase refer to the same convention: the first word is entirely lowercase and subsequent words are capitalised. This distinguishes it from UpperCamelCase (PascalCase).

Does camelCase work with acronyms?

Style guides differ. Google Java Style treats acronyms as words and title-cases them (getHttpUrl), while some teams write them fully uppercase (getHTTPUrl). Pick one approach and apply it consistently within a project.