Convert snake_case to camelCase!

String
Result

Convert snake_case 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!

Rewrites snake_case names such as order_id and created_at as camelCase (orderId, createdAt). Rows from SQL databases, Python dictionaries and many REST APIs (Rails, Django, GitHub) use snake_case, while JavaScript, TypeScript, Java and Kotlin code reads more naturally in camelCase.

Paste a query result, a dict literal, a column list or a JSON response and the snake_case words are converted in place, so you can see the frontend-side field names before writing a mapper or a TypeScript type.

How to use

  1. Make sure the left dropdown is snake_case and the right one camelCase.
  2. Put your SQL column list, Python dict or JSON into String.
  3. Take the converted text from Result; renamed identifiers are highlighted so you can spot anything that should not have changed.

Example

Input (snake_case)
row = {
  "order_id": 1001,
  "customer_name": "Kim",
  "total_price": 25000,
  "created_at": "2024-05-01",
}
Output (camelCase)
row = {
  "orderId": 1001,
  "customerName": "Kim",
  "totalPrice": 25000,
  "createdAt": "2024-05-01",
}

The quoted keys of the Python dict are renamed, and the value "Kim" and the date are left alone because they contain no underscore-separated words.

Supported features

  • The letter after each underscore is capitalized and the underscore removed: total_price → totalPrice.
  • A single leading underscore is kept, as JavaScript private-style fields expect: _private_var → _privateVar.
  • Names need at least one underscore to be recognized, so ordinary words like row or name are never touched.
  • Keys inside quotes, SQL aliases and YAML keys are all handled because the whole text is scanned.

Use cases

Typing a snake_case REST response in TypeScript

Paste a sample response from a Django or Rails API to see the camelCase property names your client-side model will use after a key-transform step (for example with axios interceptors or humps).

Mapping SQL rows to objects

When a repository layer turns SELECT user_id, last_login_at ... into objects, converting the column list gives the property names for the mapper or the DTO.

Notes and limitations

  • Segments made of digits are attached to the previous word: address_line_2 becomes addressLine2 and user_2fa_code becomes user2faCode.
  • Double-underscore names like __init__ or __tablename__ are not matched and stay as written.

FAQ

Does this change the JSON values too?

Only values that are themselves snake_case words, such as an enum string "in_progress". Numbers, dates, normal text and URLs without underscores stay the same.

Should I convert API keys on the server or the client?

That depends on your stack; this page only shows what the names will look like. It is useful for writing the type definitions or checking a serializer's camelCase output.