Identifier case converter — camelCase, snake_case, kebab-case and 10 more

Type one identifier or phrase, in any style, and get it back in 13 naming conventions at once, from camelCase and snake_case to CONSTANT_CASE, kebab-case and path/case, with acronyms split sensibly.

Live demo · real result from this tool

Table

CaseResult
camelCasegetUserProfileUrl
PascalCaseGetUserProfileUrl
snake_caseget_user_profile_url
CONSTANT_CASEGET_USER_PROFILE_URL
kebab-caseget-user-profile-url
Train-CaseGet-User-Profile-Url
dot.caseget.user.profile.url
path/caseget/user/profile/url
flatcasegetuserprofileurl
Title CaseGet User Profile Url
Sentence caseGet user profile url
lower caseget user profile url
UPPER CASEGET USER PROFILE URL

13 rows — scroll inside the table, or download the CSV.

Processed on your device — nothing is uploaded.

How to use the case converter

  1. Type or paste into Identifier or phrase. Any style works as input: getUserProfileURL, user_profile_url, user-profile-url or plain words.
  2. Read the table. It lists all 13 styles at once, so there is nothing to select.
  3. Copy the row you need.

What it does and when to use it

Renaming across layers is a daily chore. A database column created_at becomes createdAt in a JSON API, CREATED_AT in an environment variable and created-at in a CSS class or a URL. This tool gives every form at once, so you can paste the one you need without retyping.

The 13 outputs are camelCase, PascalCase, snake_case, CONSTANT_CASE, kebab-case, Train-Case, dot.case, path/case, flatcase, Title Case, Sentence case, lower case and UPPER CASE.

For URL slugs with accents stripped, use slugify. For changing the case of ordinary prose (sentence case, title case, alternating case), the text case converter is a better fit. To escape a converted name for a JSON or shell string, use the string escaper.

How it works

The input is first split into words with two rules:

  1. A lowercase letter or digit followed by a capital starts a new word: getUser → get User.
  2. A run of capitals followed by a capital plus a lowercase letter is split before that last capital: XMLHttp → XML Http.

Everything that is not a Unicode letter or digit (spaces, _, -, ., /, line breaks) then acts as a separator. The words are lowercased and joined again for each style. For example, snake_case joins them with _, CONSTANT_CASE also upper-cases the result, and Train-Case capitalises each word and joins with -. It runs in your browser.

Worked examples

getUserProfileURL. The acronym at the end is split off correctly:

camelCase | getUserProfileUrl
PascalCase | GetUserProfileUrl
snake_case | get_user_profile_url
CONSTANT_CASE | GET_USER_PROFILE_URL
kebab-case | get-user-profile-url

XMLHttpRequest, the classic hard case with an acronym at the start:

camelCase | xmlHttpRequest
snake_case | xml_http_request
Title Case | Xml Http Request

Mixed separators, hello world-foo_bar, are normalised:

camelCase | helloWorldFooBar
dot.case | hello.world.foo.bar
path/case | hello/world/foo/bar

Limits and tips

  • Brand capitals are lost. iOS splits into i and OS, giving i_os in snake_case. Fix names like iOS, GitHub or macOS by hand.
  • No reserved-word check. The tool does not warn if a result clashes with a keyword (class, default) or starts with a digit, which most languages forbid.

Frequently asked questions

Why does URL become Url in camelCase?
Every word is lowercased and then given a capital first letter where the style needs one, so acronyms are not kept in capitals. getUserProfileURL becomes getUserProfileUrl. Many style guides prefer this, but if yours keeps acronyms upper-case, fix those letters by hand.
How are numbers handled?
A digit stays attached to the letters before it, and a capital after a digit starts a new word. user_id2FA becomes user_id2_fa in snake_case and userId2Fa in camelCase.
Can I convert a whole list of names at once?
No. The input is treated as one identifier, and line breaks count as word separators like spaces. Convert names one at a time, or use a find-and-replace in your editor for bulk renames.
Are accented letters kept?
Yes. Any Unicode letter or digit counts as part of a word, so crème brûlée becomes crème_brûlée. Most languages allow such identifiers, but CSS classes, URLs and many file systems are safer with ASCII. Use the slugify tool if you need accents removed.
Which style does each language use?
Common conventions are camelCase for JavaScript and Java variables, PascalCase for classes and React components, snake_case for Python and Ruby, CONSTANT_CASE for constants, and kebab-case for CSS classes, URLs and CLI flags. Your project's style guide has the final say.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close