Developer case converter

Turn a phrase or a mixed identifier into camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, or dot.case. Runs in your browser. Nothing is uploaded.

0 characters · 0 words

All conversion happens on this device. Nothing is uploaded.

How to convert an identifier

  1. Paste or type a phrase, a variable name, or a mix of both into the box.
  2. To change only part of the text, select a whole identifier first. A partial selection is converted on its own, so highlight the full name.
  3. Click camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, or dot.case.
  4. Click Copy and paste the result into your editor, ticket, or config file.

There is no login and no upload. The split and the join run in this tab. The privacy policy covers the rest of the site, including ads. The four prose buttons (UPPER, lower, Title Case, Sentence case) stay on the home converter. They change letter case and leave your underscores, hyphens, and dots where they are. This page is the one that rebuilds the separators.

If the box is empty, or the text is only spaces and symbols, the status line says "Nothing to convert" and the box stays empty. A normal click says which style you just applied.

How a phrase becomes words

Every style starts from the same word list. The button only changes how those words are joined and capitalized. Spaces, underscores, hyphens, dots, and slashes are boundaries. So are emoji and most other symbols. They are not kept. An apostrophe is deleted instead of becoming a boundary, so don't stays one word, dont. The Google Java Style Guide, section 5.3, also removes apostrophes before it builds a camel-case name.

Inside a chunk that has no separator, the converter splits on case changes. A lowercase letter followed by an uppercase letter is a break (fooBar is foo and Bar). A run of capitals followed by a normal word is a break (XMLHttpRequest is XML, Http, and Request). A digit followed by a letter is a break (2FA is 2 and FA). A letter followed by digits is not a break, so html5 and user2 stay intact.

One repair keeps version-looking tokens together. A single capital, then a capital, a lowercase letter, and digits, is glued back into one word. That is why IPv4Address becomes ipv4 and Address, not i, Pv4, and Address. iPhone is left as i and Phone, because Phone is a normal word, and camelCase keeps the familiar iPhone shape.

After the word list exists, camelCase lowercases the first word and capitalizes the later ones, with nothing between them. PascalCase capitalizes every word the same way. snake_case lowercases every word and joins with underscores. kebab-case does the same with hyphens. CONSTANT_CASE uppercases every word and joins with underscores. dot.case lowercases every word and joins with dots. When camelCase or PascalCase would place two number-only words next to each other, an underscore is inserted, because digits have no upper and lower case to show the boundary.

Which style to pick

camelCase

Use this for variables, functions, and methods in Java and JavaScript, and for parameter names in .NET. Google's camel-case section says to lowercase the whole phrase, including acronyms, then capitalize each word except the first. Microsoft's capitalization conventions reserve camelCasing for parameter names. The nickname "camel case" is old. I have not found a first printed use I can cite with confidence, so this page does not name one.

PascalCase

Use this for type names and for public members in languages that ask for a capital on every word. PEP 8 calls that shape CapWords and uses it for class names. Microsoft uses PascalCasing for identifiers other than parameters. On the phrase XML HTTP request, this button emits XmlHttpRequest, which is the form Google's section 5.3 table lists as correct. Microsoft makes a special case for a two-letter acronym and keeps both letters capital, as in IOStream. This converter does not. IO stream becomes IoStream. Change those two letters by hand when a .NET guide requires it.

snake_case

PEP 8 wants Python functions and variables in lowercase, with underscores between words when the name has more than one. It allows mixedCase only where that is already the local style. Use snake_case for those Python names, and for many config keys that are not full capitals.

kebab-case

CSS property names are hyphenated. background-color is one example. In HTML, a custom data attribute name contains no ASCII uppercase letters. The HTML living standard illustrates that with data-foldername and data-msgid. A multi-word name uses hyphens, as in data-user-id. A hyphen is also the minus operator in JavaScript, Python, and Java, so kebab-case is the wrong shape for a variable in those languages. It fits CSS, HTML attributes, URL slugs, and some config files.

CONSTANT_CASE

PEP 8 says module-level constants are written in all capital letters with underscores separating words, and it gives MAX_OVERFLOW as an example. Pasting that name and clicking CONSTANT_CASE leaves it as MAX_OVERFLOW. The same click on a normal sentence uppercases each word and puts underscores between them.

dot.case

Oracle's Java tutorial says package names are written in all lower case, and the pieces are separated with dots, often starting from a reversed domain. Oracle does not use the label "dot.case". That is the name of this button. The output is the lowercase dotted shape. It does not check that the name is a legal Java package, and it does not add a domain.

AP, Chicago, APA, and MLA govern headlines, titles, and reference lists. They do not define variable names. Those editorial rules, and the hand edits they still need, are on the Title Case rules guide and the sentence case versus Title Case guide. Use the home converter for that work. JavaScript, Python, CSS, and SQL each pick among the identifier shapes for a different reason. That comparison, with the style-guide citations, is camelCase, snake_case, and kebab-case.

Worked examples

One mixed input, get User_ID-from.API, through every button:

camelCase getUserIdFromApi
PascalCase GetUserIdFromApi
snake_case get_user_id_from_api
kebab-case get-user-id-from-api
CONSTANT_CASE GET_USER_ID_FROM_API
dot.case get.user.id.from.api

The words are get, user, id, from, and api. The original capitals and the mix of spaces, underscores, hyphens, and dots only served to mark those words. They are not preserved.

XMLHttpRequest becomes xmlHttpRequest, XmlHttpRequest, xml_http_request, xml-http-request, XML_HTTP_REQUEST, and xml.http.request. getHTTPResponse becomes getHttpResponse and get_http_response. Acronym capitals inside the name are not kept. Google's section 5.3 treats the capitals you started with as mostly irrelevant once the words are chosen, and this tool follows that outcome. If you need the letters XML left in capitals, edit them after the click.

parse HTML5 and IPv4 becomes parseHtml5AndIpv4, parse_html5_and_ipv4, and PARSE_HTML5_AND_IPV4. The 5 stays on html because digits after letters are part of that word. IPv4 is repaired into one word, then lowercased to ipv4. If the input is already camelCase as ipV4Address, the capital V is a word break the author typed, so snake_case is ip_v4_address, not ipv4_address.

maxRetryCount becomes max_retry_count, and that snake_case string converts back to maxRetryCount. Ordinary words round-trip. Apostrophes, symbols, and acronym capitals do not.

Edge cases

Acronyms and brands

iPhone stays iPhone in camelCase. IO stream becomes IoStream in PascalCase, not IOStream. Two-letter acronyms are the .NET exception mentioned above. Longer acronyms are words: only the first letter is capital in PascalCase, and none of the inner letters stay capital in camelCase.

Numbers

user2FA becomes user2Fa and user2_fa. The 2 stays on user. FA is the next word. 2FA alone becomes 2Fa and 2_fa. A phrase that starts with a digit keeps that digit. 3d model is digit, then a letter, so the letter is a new word: camelCase is 3DModel and snake_case is 3_d_model. It is not 3dModel. Many languages reject an identifier that starts with a digit. The converter still emits the string and leaves that check to you.

Google's table lists turnOn2sv as the correct rendering of "Turn on 2SV", and turnOn2Sv as the incorrect one, because the prose scheme lowercases the acronym after the number. This converter treats those letters as their own word, so the same phrase becomes turnOn2Sv. Edit the last two letters if you are matching that row of the table.

The same section notes that multipart version numbers sometimes need underscores, because digits cannot show a case change. Guava 33.4.6 becomes guava33_4_6 in camelCase and guava_33_4_6 in snake_case. The dots were boundaries. Adjacent number words are rejoined with an underscore only in camelCase and PascalCase.

supports IPv6 on iOS becomes supportsIpv6OnIOs. Google's table lists supportsIpv6OnIos for that phrase, treating iOS as a single odd word that is lowercased and then capitalized. This converter sees the capital O and splits i from OS, so the last hump is IOs. Fix that one by hand if you need Google's form. The question mark, if you paste the phrase with one, is dropped as a symbol.

Unicode

déjà Vu café becomes déjàVuCafé, DéjàVuCafé, déjà_vu_café, déjà-vu-café, DÉJÀ_VU_CAFÉ, and déjà.vu.café. Accented letters count as letters, including the capital that starts Vu. Combining marks stay attached to the letter they follow.

Case folding uses the browser's default toLowerCase and toUpperCase, not a Turkish locale. straßeName in CONSTANT_CASE is STRASSE_NAME, because that default uppercasing turns ß into SS. That is engine behavior, not a rule from PEP 8. This page does not claim correct results for Turkish dotted and dotless i. If you are casing Turkish text, check the output.

Apostrophes, symbols, and empty input

don't use @user names becomes dontUseUserNames. The apostrophe is removed, and the @ is a boundary that is not kept. o'neil becomes oneil, one word, not O'Neil. The home Title Case tool is the one that keeps an apostrophe inside a name. foo🚀bar baz becomes fooBarBaz. The emoji splits the first two words and is not copied into the result.

A box of only spaces, punctuation, or emoji converts to an empty string. Select a whole identifier when the surrounding sentence should stay. Selecting getUserId inside keep getUserId please and clicking snake_case leaves keep get_user_id please. Selecting only User from the middle of a camelCase name splits whatever fragment you highlighted, which is rarely what you want.

What this tool will not do

It does not look up trademarks, brand spellings, or a dictionary of acronyms. It does not know whether ID should stay ID for a .NET name. It does not produce a legal identifier for a specific language: leading digits, reserved words, and a hyphen in a JavaScript variable are your problem after the click. It does not translate, and it does not call a model. The text stays in the browser.

Headline case and sentence case are the other tool. If a house style still wants small words lowercased in a title, the case style guides say what to fix by hand. This page is only the identifier shapes above. Shipped notes for the site are in the changelog.

Frequently asked questions

Is the text sent to a server?

No. Conversion runs in your browser. The words in the box are not uploaded for this tool.

Why did XMLHttpRequest lose the capital XML?

The word list lowercases each word, then capitalizes word starts. That matches the Google Java approach and drops inner acronym capitals. Put the capitals back if the surrounding code needs them.

Why is ipv4 one word here and v4 a separate word there?

IPv4Address is repaired into ipv4 plus Address, so snake_case is ipv4_address. ipV4Address already has a capital V, so snake_case is ip_v4_address. The capital you typed is treated as a word break.

Can I convert just one name in a sentence?

Yes. Select the whole name, then click a style. The rest of the line stays as it was.

Does it work offline?

After the page has loaded, the converter itself needs no network. There is no service worker and no installable app. Bookmark the page if you want it close by.