Skip to content
cliplimeClipLime

Convert text to camelCase

Variable and function names from plain words, with acronyms handled.

0 characters, 0 lines

Options

Only the letter i is affected. Turkish and Azerbaijani pair i with İ and ı with I.

Words are split at spaces, punctuation, underscores and hyphens, and where a lower case letter meets a capital (fooBar becomes foo and Bar). Each line is converted on its own, and apostrophes are dropped.

The same text in every style

Add some text to see all 12 styles side by side. The previews use the first line.

Your text stays in your browser. Nothing you type or paste is sent anywhere.

At a glance

What it does
Joins words with no separator, with the first word in lower case and every later word starting with a capital: getUserName.
Input
Plain words, snake_case, kebab-case, PascalCase or text that is already camelCase.
Acronyms
Treated as ordinary words: 'XML HTTP request' becomes xmlHttpRequest.
Numbers
Stay attached to the word before them: 'version2 update' becomes version2Update.
Lists
Each line is converted on its own, so a column of labels becomes a column of identifiers.
PascalCase
For a leading capital, pick PascalCase in the style row. It is the same style with the first letter capitalized.
Privacy
Runs in your browser. Your text is never uploaded.

How to do it

  1. 1

    Paste your words

    Type a phrase, or paste names in any style, one per line.

  2. 2

    Check the output

    camelCase is already selected. The result is ready to paste into code.

  3. 3

    Review acronyms and numbers

    If your code base keeps acronyms in capitals, adjust those by hand.

  4. 4

    Copy

    Press Copy, or look in the table at the bottom for the same names in snake_case, kebab-case and the others.

Where camelCase is the convention

camelCase is the usual style for variables, functions and methods in JavaScript, TypeScript, Java, Kotlin and Swift, and for the properties of objects in those languages. Go uses it for names that stay inside a package. Many web APIs also use it for the keys in their JSON, and CSS in JavaScript uses it for properties such as backgroundColor.

Not every language agrees. Python, Ruby and Rust prefer snake_case, and CSS and HTML use kebab-case. If you are moving names between those worlds, the snake_case converter does the same job in the other direction, and the style row above covers the rest.

camelCase, lowerCamelCase and PascalCase

People use these names loosely. Strictly, lowerCamelCase starts with a small letter (userName) and UpperCamelCase, also called PascalCase, starts with a capital (UserName). This page produces the first. Classes, types and React components usually take the second, so switch to PascalCase in the style row for those.

How acronyms and numbers are handled

The converter splits the text into words, then writes the first in lower case and capitalizes only the first letter of each other word. Runs of capitals stay together until the capital that starts the next word, so HTTPServerError is split into HTTP, Server and Error and written as httpServerError.

Treating an acronym as a word is the rule in several style guides, including Google's Java style guide, and it is why the result reads xmlHttpRequest. Other code bases keep acronyms in capitals (the browser's own XMLHttpRequest is an example). If yours does, fix those spots by hand.

Digits stay with the word before them, so version2Update splits into version2 and Update. Apostrophes are dropped, so 'it's ready' becomes itsReady.

Converting a whole list of names

Paste a column of labels, one per line, and every line becomes one identifier. 'First Name', 'Last Name' and 'Date of Birth' become firstName, lastName and dateOfBirth. Empty lines stay empty, so the shape of your list is kept. This is handy for turning spreadsheet headers into object keys. Names must still be valid in your language: a name cannot start with a digit in most of them, and this page does not check that.

Questions people ask

What is camelCase?

A way of writing several words as one with no spaces, where each word after the first starts with a capital letter: firstName, getUserName. The capitals in the middle look like the humps of a camel.

What is the difference between camelCase and PascalCase?

camelCase starts with a small letter (userName) and PascalCase starts with a capital (UserName). Variables and functions usually use camelCase, classes and types usually use PascalCase.

Why are spaces and punctuation removed?

Names in code cannot contain spaces, and most languages do not allow punctuation either. The capitals mark where the words begin instead.

Can it convert from snake_case or kebab-case?

Yes. Underscores and hyphens count as word breaks, so user_first_name and user-first-name both become userFirstName. Text that is already camelCase is split at its capitals first.

How does it handle acronyms such as HTTP or ID?

It treats them as words: 'user ID' becomes userId and 'HTTP request' becomes httpRequest. If your project keeps acronyms in capitals, edit those by hand afterwards.

Can I convert many lines at once?

Yes. Every line is converted on its own and empty lines stay empty. Nothing is uploaded, so the list can be as private as you like.

Guides that help

All Text guides →