snake_case to camelCase

Paste your text: every name_like_this becomes likeThis (camelCase).

What it's for

The same name written two different ways is daily bread for anyone who codes: a database speaks snake_case (birth_date), JavaScript speaks camelCase (birthDate), and in between there's always someone retyping dozens of names by hand. Here you paste the whole list and the conversion happens to all of it at once: the underscore disappears and the letter that followed it becomes a capital.

How it works

There's a single rule and it applies everywhere in the text: every run of underscores inside a name is removed and the letter or digit right after it becomes uppercase. So user__name becomes userName even with two underscores in a row, and accented letters work too: café_name becomes caféName. The rest of the text isn't touched, so you can paste a whole file and not just the names: commas, brackets and line breaks stay where they are.

Constants and leading underscores

Constants in capitals are lowered first: from USER_NAME you get userName, which is the name you'd write by hand. That only happens when the whole name is in capitals: in a mixed name the capitals already there stay, because they're often acronyms (HTTP_response becomes HTTPResponse). If you want the acronym lowered there too, put the text in lowercase first with Upper and lowercase.

The leading underscore, which in many languages means «internal, don't touch», stays where it is, and so does a trailing one: _private stays _private, __init__ stays __init__ and _user_name becomes _userName. Only the underscores in the middle go, because those are the ones separating the words.

Nearby tools

The opposite direction is camelCase → snake_case. If instead you need the name for a web address, with ordinary dashes in place of spaces, the page is Make a URL slug. For freer replacements, with you deciding the rule, there is Find and replace.

Related tools