Case converter

What is a Case Converter?

Different languages and tools expect different naming conventions. JavaScript variables use camelCase, Python functions use snake_case, CSS classes and URLs use kebab-case, and environment variables use CONSTANT_CASE. This case converter shows your text in all the common styles at once so you can copy the one you need.

How to use it

  1. Type or paste a word or phrase, for example user account id.
  2. Copy the variant you need from the list.

The common cases

CaseExampleTypical use
camelCaseuserAccountIdJavaScript, Java and JSON fields
PascalCaseUserAccountIdClasses, types and React components
snake_caseuser_account_idPython, Ruby and SQL columns
CONSTANT_CASEUSER_ACCOUNT_IDConstants and environment variables
kebab-caseuser-account-idCSS classes, URLs and CLI flags
dot.caseuser.account.idConfig keys and i18n keys
Title CaseUser Account IdHeadings and labels

How words are detected

The converter splits the input into words at spaces, underscores, hyphens, dots and changes from lowercase to uppercase. That means XMLHttpRequest, xml_http_request and xml-http-request all produce the same word list. Acronyms are where tools differ most: userID may become user_id or user_i_d depending on the rules, so check names containing acronyms.

Tips

  • Follow your language's style guide, such as PEP 8 for Python or the Airbnb guide for JavaScript.
  • Keep JSON API fields consistent; mixing camelCase and snake_case confuses clients.

Frequently Asked Questions

What is the difference between camelCase and PascalCase?

camelCase starts with a lowercase letter, as in userName. PascalCase starts with an uppercase letter, as in UserName.

Which case should I use for URLs?

kebab-case is the usual choice for URLs, because hyphens are treated as word separators by search engines.

What is CONSTANT_CASE used for?

Constants and environment variables, such as DATABASE_URL or MAX_RETRIES.

How are acronyms handled?

A change from lowercase to uppercase starts a new word. Runs of capitals can be split differently by different tools, so check names that contain acronyms.