1001Ferramentas
🐫 Text

To camelCase

Convert text to camelCase: first word lowercase, rest with capitalized initial. Standard in JS/Java/TS.

From field_name to fieldName

You have a spreadsheet of field labels, a column list from a legacy database, or accented text in another language, and you need camelCase identifiers for JavaScript, Java or TypeScript. Doing it by hand invites typos. Paste the text into the box and the result updates as you type: endereço_de_entrega becomes enderecoDeEntrega, delivery address becomes deliveryAddress, and foo-bar becomes fooBar.

Splitting happens at anything that is not a letter or a digit, meaning spaces, underscores, hyphens, brackets and punctuation, and also at capital transitions inside a word. That is why XMLHttpRequest is read as three words. Accents are stripped before joining, which is what you want in code: preço médio comes out as precoMedio. The trade off is that acronyms lose their shape, so CPF do usuário becomes cpfDoUsuario and get_user_ID becomes getUserId.

One detail catches a lot of people: the whole box is treated as a single piece of text. Paste one name per line and the line breaks count as ordinary separators, gluing everything into one enormous identifier. Convert one line at a time. Also check names that start with a digit, such as 2 copies, which yields 2Copies and is not a valid JavaScript identifier. The conversion happens on the page itself, with no text sent to a server.

Frequently asked questions

Can it convert several lines at once?
No. The box is read as one single text, so line breaks act as plain separators and the output comes out joined. Paste one name at a time to get one identifier per conversion.
Does it keep accents and cedillas?
No. Accents are stripped and ç becomes c, which is the expected behaviour for code identifiers: situação comes out as situacao.
Is there a copy button?
No. The converted text appears in a box below the input field. Select it with the mouse and copy with Ctrl+C or Cmd+C.

Related Tools