Case converter
Everything runs in your browser; nothing is sent or stored.
- Type or paste text in the "Text" field, and all forms update as you type.
- The "Result" section shows all forms one below the other, including aLtErNaTiNg, in which lowercase and uppercase letters alternate.
- To copy a form, click "Copy" below its field.
- The word count appears above the forms, based on the same word split used for the code forms.
- For code forms such as camelCase and snake_case, the text is split into words at spaces, punctuation, underscores, hyphens, and dots, and also where a lowercase letter meets an uppercase one (userName), inside acronyms (XMLHttp), and between Latin letters and letters of a script without letter case.
- Letters in scripts without letter case, such as Hebrew or Arabic, stay as they are, including vowel marks. In camelCase and PascalCase, words in these scripts are joined with nothing between them.
- To convert several names at once, enter each name on a separate line.
Naming conventions in code
Variable and function names cannot contain spaces, so the words in a name are joined according to a fixed convention. In camelCase, every word except the first starts with an uppercase letter, a style common for variable and function names in JavaScript and Java. In PascalCase, the first word also starts with an uppercase letter, a style common for class names. The snake_case style is common in Python and in database table and column names, and SCREAMING_SNAKE_CASE, also called CONSTANT_CASE, is usually used for constants and environment variables. The kebab-case style is common in CSS class names, URLs, and file names, and dot.case is used for keys in some configuration files. When the whole development team follows one convention, the code is easier to read and search.
Title Case and Sentence case
In Title Case, the converter starts every word with an uppercase letter, including short words such as of and the. Many style guides for English headings keep short prepositions and conjunctions lowercase in the middle of a heading, so you can fix the short words manually after the conversion. In Sentence case, the first letter of each line and of each sentence becomes uppercase, that is, the first letter after a period, an exclamation mark, or a question mark followed by a space. In both forms, the other letters of each word become lowercase, so acronyms such as HTTP and names such as iPhone need a manual fix after the conversion.
Acronyms in code names
In the code forms, an acronym is written like a regular word, so XMLHttpRequest becomes xmlHttpRequest in camelCase and xml_http_request in snake_case. Some style guides recommend writing acronyms as regular words, such as JsonParser, and others recommend keeping them uppercase, such as JSONParser. After the conversion, check that the name matches the convention used in your existing code.
Code forms of the text get HTTP response code
getHttpResponseCodecamelCaseGetHttpResponseCodePascalCaseget_http_response_codesnake_caseGET_HTTP_RESPONSE_CODESCREAMING_SNAKE_CASEget-http-response-codekebab-caseget.http.response.codedot.case
Case converter FAQ
Can I create code names from words in non-Latin scripts?
Yes. The code forms join words in any script, including scripts without letter case, such as Hebrew or Arabic: in snake_case, the words are joined with an underscore, and in camelCase, with nothing between them. Many programming languages allow non-Latin letters in names, but names in code are usually written in English, so every developer can read and type them without switching keyboard layouts.
Why does a name like iPhone split into two words in the code forms?
In the code forms, a change from a lowercase letter to an uppercase letter marks the start of a new word, so a name such as userName splits into user and name. That is why iPhone becomes i_phone in snake_case. To keep it as one word, enter it in lowercase before the conversion.
Why does the apostrophe in don't disappear in the code forms?
In the code forms, apostrophes and quotation marks inside a word are removed to keep the word whole. For example, don't stop becomes dontStop in camelCase. The rule applies to words in every language. In the text forms, the apostrophe is kept.
What is the iNVERSE form used for?
The iNVERSE form turns every uppercase letter into lowercase and every lowercase letter into uppercase. It is useful for fixing text typed with Caps Lock turned on by mistake: for example, hELLO wORLD becomes Hello World.
Is kebab-case or snake_case better for URLs?
Words in URLs are usually separated with hyphens, and Google recommends hyphens rather than underscores, so kebab-case suits URLs. To create a slug from a title, you can use the "URL slug generator" tool.
What is the maximum size of text for case conversion?
You can convert text of up to 256 KB at once, measured by its size in UTF-8. In UTF-8, each letter in an alphabet such as Hebrew, Greek, or Cyrillic takes 2 bytes, so text in those alphabets can include about half as many characters as English text.