Camel Case Converter

Converts the input string to camel case.

Input: TextResult: Text

Text input

Tool options

Examples

Map a JSON API field to a JavaScript property

A snake_case API field becomes lower camel case.

Input

first_name

Expected answer

firstName
Attempt to be context aware
Off
Keep a mixed acronym boundary readable

XML becomes xml; the following capitalized words remain boundaries.

Input

XMLHttpRequest

Expected answer

xmlHttpRequest
Attempt to be context aware
Off
Remove the accent when naming a café menu property

Lodash removes the accent as part of word normalization.

Input

café menu price

Expected answer

cafeMenuPrice
Attempt to be context aware
Off
Rename bare keys while retaining a double-quoted value

Context mode preserves this double-quoted string; it is a token heuristic, not a language-aware refactor.

Input

user_name = "display_name"; retry_count = 3;

Expected answer

userName = "display_name"; retryCount = 3;
Attempt to be context aware
On
Turn a versioned heading into a property name

The numeric suffix is retained.

Input

HTTP response code 404

Expected answer

httpResponseCode404
Attempt to be context aware
Off
To Camel case (dumb)

Input

hello world

Expected answer

helloWorld
Attempt to be context aware
Off
To Camel case (smart)

Input

test='hello'
echo $test
a_camel_case_function
$a_camel_case_variable;
function function_name() {
  console.log('things inside quotes do not get broken');
  console.log("things inside quotes do not get broken");
}

Expected answer

test='hello'
echo $test
aCamelCaseFunction
$aCamelCaseVariable;
function functionName() {
  console.log('things inside quotes do not get broken');
  console.log("things inside quotes do not get broken");
}
Attempt to be context aware
On

Camel case is all lower case except letters after word boundaries which are uppercase. e.g. thisIsCamelCase 'Attempt to be context aware' will make the operation attempt to nicely transform variable and function names.

Format reference: To Camel case background and specification

Parameters

ParameterDefault valueInput and choices
Attempt to be context awarefalseOn or off

Related tools

Browse code tidy tools