[ advertisement ]

String Case Converter

Convert variable, column and key names between the most common programming naming conventions, many lines at a time.

Input (one string per line)

camelCase

userProfileId
xmlHttpRequestHandler
fieldName

PascalCase

UserProfileId
XmlHttpRequestHandler
FieldName

snake_case

user_profile_id
xml_http_request_handler
field_name

CONSTANT_CASE

USER_PROFILE_ID
XML_HTTP_REQUEST_HANDLER
FIELD_NAME

kebab-case

user-profile-id
xml-http-request-handler
field-name

Train-Case

User-Profile-Id
Xml-Http-Request-Handler
Field-Name

dot.case

user.profile.id
xml.http.request.handler
field.name

Title Case

User Profile Id
Xml Http Request Handler
Field Name

Sentence case

User profile id
Xml http request handler
Field name

Use via API

Converts text into every naming convention (one conversion per line).

POSThttps://enhanced.dev.br/api/v1/convert/case
JSON body parameters
Body (JSON)TypeDescription
text *stringText to convert; multiple lines are converted separately.

Request example

curl -X POST "https://enhanced.dev.br/api/v1/convert/case" \
    -H "Content-Type: application/json" \
    -d '{"text":"user profile id"}'

Response

{
  "ok": true,
  "data": {
    "cases": {
      "camel": "userProfileId",
      "pascal": "UserProfileId",
      "snake": "user_profile_id",
      "constant": "USER_PROFILE_ID",
      "kebab": "user-profile-id",
      "train": "User-Profile-Id",
      "dot": "user.profile.id",
      "title": "User Profile Id",
      "sentence": "User profile id"
    }
  },
  "meta": {
    "version": "v1"
  }
}
  • Errors return { ok: false, error: { code, message } } with an HTTP 4xx/5xx status.
  • Free, no API key required. Limited to 120 requests per minute per IP.
  • CORS enabled: call it straight from the browser on any domain.
[ advertisement ]

How to use

  1. Type or paste one or more strings, one per line.
  2. See every conversion at once in the cards next to the input.
  3. Click Copy on the format you need.

Use cases

  • Mapping snake_case database columns to camelCase TypeScript properties.
  • Producing constant and environment variable names in CONSTANT_CASE.
  • Creating slugs and file names in kebab-case.
  • Normalizing lists of i18n keys or form field names.

Technical concepts

How words are detected

Text is split into words at spaces, underscores, hyphens, dots and also at lowercase-to-uppercase transitions. Acronyms are kept as one word: XMLHttpRequest becomes xml, http and request. Accented letters are recognized as letters.

Conventions by language

JavaScript and Java use camelCase for variables and PascalCase for classes. Python, Ruby and Lua use snake_case. CSS, URLs and npm package names use kebab-case. Constants and environment variables use CONSTANT_CASE (also called SCREAMING_SNAKE_CASE).

Frequently asked questions

Are numbers treated as separate words?

Yes. base64Encoder becomes base_64_encoder in snake_case and back to base64Encoder in camelCase.

Can I convert many names at once?

Yes. Each input line is converted independently, keeping the same order in the output.

Related tools