Convert PascalCase to camelCase!

String
Result

Convert PascalCase to camelCase!

Is the variable naming in the code you copied from somewhere else different from your code? Don't worry! It converts variables to your desired naming convention!

Lowercases the first letter of PascalCase names: CustomerName → customerName. The classic source is a .NET backend: older ASP.NET and Newtonsoft setups serialize C# properties as PascalCase JSON (OrderId, ShippedAt), while JavaScript, TypeScript and Java code expects camelCase fields.

It is equally useful for deriving instance or variable names from class names, such as UserRepository → userRepository, when writing dependency injection or test setup code.

How to use

  1. Pick PascalCase as the source and camelCase as the target.
  2. Paste a JSON response, property list or class names into String.
  3. Copy the converted text from Result.

Example

Input (PascalCase)
{
  "OrderId": 1001,
  "CustomerName": "Kim",
  "ShippedAt": null
}
Output (camelCase)
{
  "orderId": 1001,
  "customerName": "Kim",
  "shippedAt": null
}

The three PascalCase keys from a C#-style response are converted; null and the numbers are untouched, so the JSON stays valid.

Supported features

  • Only the start of the name changes case: ShippedAt → shippedAt.
  • Recognizes a name only when it has at least two words and some lowercase letters, so single words like Order, Name or an all-caps JSON are skipped.
  • Lowercases only the first word and keeps the rest exactly as written, including digits and inner acronyms (OrderID → orderID).

Use cases

Consuming a PascalCase .NET API from TypeScript

If the API cannot be switched to JsonNamingPolicy.CamelCase, paste a sample response to see the camelCase field names your client mapping will produce, or to write the interface by hand.

Naming injected dependencies

A list of services like PaymentService and UserRepository converts directly to the constructor parameter or field names paymentService and userRepository.

Notes and limitations

  • A leading acronym is lowercased as a whole: HTTPServer → httpServer, JSONPayload → jsonPayload, IOError → ioError.
  • Single-word PascalCase names (Id, Name, Order) need two capitals to be recognized, so they stay capitalized. Lowercase them yourself.

FAQ

Why did Name not become name?

The PascalCase pattern requires at least two words (two capitals) so that ordinary capitalized words in sentences are not changed. One-word keys have to be edited by hand.

Will it break class names in the same paste?

Yes, every multi-word PascalCase name is converted, including class and type names. Paste only the fields when working with code.