3tej home

What is camelCase Converter?

A camelCase Converter converts data from one format to another using a deterministic mapping. It parses the input, transforms it according to the relevant standard, and returns a ready-to-use result. Paste any phrase and convert it to camelCase: first word lowercase, subsequent words capitalized, no spaces.

camelCase Converter

Paste any phrase and convert to camelCase: lowercase first word, capitalized subsequent words, no separators.

Browser-onlyInstantFree foreverWorks offlineNo signup
← Utilities

TLDR

Splits your text on any non-letter / non-digit boundary, lowercases everything, and capitalizes word 2-N to produce camelCase.

0 words · 0 chars
Runs entirely in your browser. No upload, no signup, no logging. Output is for personal or commercial use; we don't claim any rights.

About camelCase

camelCase, more precisely lowerCamelCase, is the identifier convention in which the first word is lowercase and every subsequent word starts with a capital, with no separators between words. The name comes from the humps in the resulting word shape: userFirstName, getElementById, isLoggedIn. It is the default style for variables, function names, method names, and JSON property names in JavaScript, TypeScript, Java, Kotlin, Swift, C#, Dart, and ActionScript, and it is the JSON style enforced by the Google JSON Style Guide and most public REST APIs.

The convention was popularised in the late 1970s by Smalltalk-80 and carried into the C++ and Java traditions by Sun Microsystems' coding guidelines. Today the Microsoft .NET Framework Design Guidelines, the Google Java Style Guide, and Airbnb's JavaScript style guide all specify camelCase for non-type identifiers, while PascalCase (UpperCamelCase) is reserved for classes, types, and enums. This converter performs the deterministic transformation from any human-readable phrase or other-cased identifier to that target form.

How the converter works

words   = input.split(/[^A-Za-z0-9]+/).filter(nonEmpty)
result  = words[0].toLowerCase() +
          words.slice(1).map(capitalize).join('')
capitalize(w) = w[0].toUpperCase() + w.slice(1).toLowerCase()
  • Tokenise. Split the input on any run of characters that are not ASCII letters or digits. Spaces, hyphens, underscores, dots, slashes, and punctuation all act as boundaries.
  • Lowercase first word. The whole first token is folded down so the identifier starts with a lowercase letter, as required by the convention.
  • Capitalise remaining words. For tokens 2 through N, uppercase the first character and lowercase the rest; this is why ALL-CAPS acronyms get flattened to xml, url, api.
  • Concatenate. Join everything with no separator. The result is one continuous identifier with humps at every word boundary.

Worked example

Input: a verbose column heading copied from a CSV file:

Customer's Total Amount Paid (USD) - 2026 YTD
  1. Tokenise on non-alphanumerics. Words: ["Customer", "s", "Total", "Amount", "Paid", "USD", "2026", "YTD"]. The apostrophe and parentheses are dropped along with spaces and hyphens.
  2. Lowercase first word. "customer".
  3. Capitalise the rest. "S", "Total", "Amount", "Paid", "Usd", "2026", "Ytd".
  4. Concatenate. customerSTotalAmountPaidUsd2026Ytd.
Result: customerSTotalAmountPaidUsd2026Ytd
A valid JavaScript identifier you can drop straight into a JSON key or a destructuring statement.

You probably want to clean this up: the stray "S" from the apostrophe should be dropped, and you might prefer the acronym treatment customerTotalAmountPaidUSD2026YTD. Edits like those are a five-second post-process; the converter handles the bulk of the renaming.

Convention reference by language

Language or formatVariables and functionsTypes and classesConstants
JavaScript, TypeScriptcamelCasePascalCaseUPPER_SNAKE_CASE
Java, Kotlin, Swift, C#camelCasePascalCaseUPPER_SNAKE_CASE
Python (PEP 8)snake_casePascalCaseUPPER_SNAKE_CASE
Rubysnake_casePascalCaseUPPER_SNAKE_CASE
Rustsnake_casePascalCaseUPPER_SNAKE_CASE
GocamelCase (unexported) or PascalCase (exported)PascalCasePascalCase or camelCase
SQL (PostgreSQL, MySQL)snake_casesnake_caseUPPER_SNAKE_CASE
JSON APIs (Google style)camelCasen/an/a
HTML / CSSkebab-case (attributes, classes)n/an/a

Pitfalls to watch for

  • Acronyms get flattened. XML parser becomes xmlParser, not XMLParser. Both Google and Microsoft style guides actually recommend the flat form, but if your team prefers the all-caps style, restore by hand after pasting.
  • Leading digits break identifiers. 2 factor auth produces 2factorAuth, which is not a legal identifier in JavaScript, Java, Python, C, Go, or Rust. Move the digit to the end or spell out the number.
  • SQL folds unquoted identifiers. PostgreSQL and MySQL lowercase unquoted identifiers, so a camelCase column becomes mush ("userFirstName" stays cased only if double-quoted). Use snake_case for database schemas.
  • Python lint rejects camelCase. PEP 8 reserves camelCase for very old library compatibility; flake8 and pylint will complain. Use snake_case in Python codebases.
  • HTTP headers are case-insensitive but conventionally Hyphen-Pascal. A header named user-agent is not the same as camelCase userAgent. Do not feed HTTP headers through this tool.
  • React DOM props are camelCase only for known DOM attributes. data-* and aria-* attributes stay kebab-case in JSX. Convert layout-related props (backgroundColor, tabIndex) but leave data-test-id as is.

Related case-conversion tools

Frequently asked questions

What is the difference between camelCase and PascalCase?

PascalCase (also called UpperCamelCase) capitalises every word including the first, so 'user first name' becomes 'UserFirstName'. camelCase (lowerCamelCase) keeps the first word lowercase: 'userFirstName'. The convention in Java, Kotlin, JavaScript, TypeScript, C#, and Swift is PascalCase for types and classes, camelCase for variables, function names, and JSON keys.

How does the converter handle acronyms like XML, URL, or API?

Conservatively. The whole token is lowercased before re-capitalisation, so 'XML parser' becomes 'xmlParser' and 'API key' becomes 'apiKey'. Google and Microsoft style guides actually recommend this (xmlParser, not xMLParser), but if you prefer the all-caps form 'XMLParser' or 'APIKey', edit those tokens by hand after pasting into your editor.

Does it work with kebab-case, snake_case, and dot.case input?

Yes. The splitter treats any run of non-alphanumeric characters as a word boundary, so 'background-color', 'user_first_name', 'order.line.item', and 'My Photos/2026' all split correctly. The first word stays lowercase and subsequent words start with a capital. This is the standard transformation React uses to convert CSS property names into style-object keys.

What happens when the first word starts with a digit?

The digit stays at the front: '2 factor auth' produces '2factorAuth'. That is a syntax error in JavaScript, Java, Python, and most other languages, which require identifiers to begin with a letter or underscore. Move the digit to the end manually ('factorAuth2') or prefix with a word ('twoFactorAuth') before pasting into code.

Why is camelCase wrong for Python and SQL?

PEP 8, the Python style guide, requires snake_case for functions and variables. PostgreSQL and MySQL fold unquoted identifiers to lowercase, so camelCase tables and columns end up as lowercase mush ('userFirstName' becomes 'userfirstname') unless quoted. Use the snake_case converter for Python, Ruby, Rust, and SQL; use camelCase for JavaScript, Java, JSON APIs, and Swift.