Case Converter
Thirteen ways to write the same text, all at once: the four for prose, the seven used in code, and two for fun.
How Case Conversion Works
Case conversion rewrites the same words under a different convention. Prose has four: all lower, all upper, one capital per word, and one capital per sentence.
Code has more, because an identifier cannot contain spaces. Each language settled on a different way of marking where one word ends and the next begins, which is why converting between them is a job at all.
- Type or paste into the field. All thirteen conversions run as you type, so there is nothing to press and no case to choose in advance.
- Each line is labelled in its own style, so the label shows what the result will look like before anything is entered.
- Copy takes one result. A line with nothing in it cannot be copied, and its button says so.
- Any of the code conventions can be pasted in and read correctly, so
user_namebecomesuserNameand back again.
| Separators | Anything that is not a letter or a digit: spaces, hyphens, underscores, dots, slashes |
| A capital | After a lower case letter or a digit, as in getName |
| Acronyms | Kept whole: XMLHttpRequest gives xml_http_request, not x_m_l_... |
| Digits | Stay attached to the word: HTML5 parser gives html5_parser |
| Word count | The figure under the field counts words by these rules, so getXMLHttpRequest is four, not one |
- The code conventions cannot round trip through punctuation.
path/to/filebecomespathToFile, and converting back givespath/to/fileonly because the separator is put back, not because it was remembered. - Accented and non-Latin letters are treated as letters, so
über Größestays intact rather than being cut at the umlaut. - German sharp s follows the language: lower case keeps
ß, upper case turns it intoSS, soGrößebecomesGRÖSSE. - Title case lower cases the rest of every word, so
iPhonebecomesIphoneandNASAbecomesNasa. Use it on prose, not on names.
Prose
Punctuation, spacing and line breaks are kept as they were.
Code
The text is split into words first, so any of these converts into any other.
For fun
Neither is a convention anyone should ship.