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
- Type or paste a word or phrase, for example
user account id. - Copy the variant you need from the list.
The common cases
| Case | Example | Typical use |
|---|---|---|
| camelCase | userAccountId | JavaScript, Java and JSON fields |
| PascalCase | UserAccountId | Classes, types and React components |
| snake_case | user_account_id | Python, Ruby and SQL columns |
| CONSTANT_CASE | USER_ACCOUNT_ID | Constants and environment variables |
| kebab-case | user-account-id | CSS classes, URLs and CLI flags |
| dot.case | user.account.id | Config keys and i18n keys |
| Title Case | User Account Id | Headings 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.