The quick answer: paste it, pick the case, copy
A column came out of the spreadsheet in ALL CAPS, a headline needs title case, or a name is user_first_name where your code wants userFirstName. Paste it into the case converter, pick the style and copy the result. A panel under it shows the first line of your text in all twelve styles at once.
- Paste your text. A list keeps its line breaks.
- Pick the style: Sentence case for text typed in capitals, Title Case for a headline, camelCase, snake_case or kebab-case for names in code.
- Open the options if needed: AP and APA or Chicago and MLA rules for title case, the Turkish i, and keeping capitals that already sit inside words, such as NASA.
- Read the result, then press Copy.
If you already know the style, these pages open with it chosen: uppercase, lowercase, title case, sentence case, camelCase and snake_case.
The twelve cases, with an example and the usual job
This is the phrase the cat in the hat in each style.
| Style | Result | Normally used for |
|---|---|---|
| UPPER CASE | THE CAT IN THE HAT | Acronyms, warning labels, short headings |
| lower case | the cat in the hat | Tags, usernames, emails, search terms |
| Title Case | The Cat in the Hat | Headlines and titles of works |
| Capitalize Each Word | The Cat In The Hat | Names and simple labels |
| Sentence case | The cat in the hat | Ordinary writing, interface text |
| camelCase | theCatInTheHat | Variables and functions in JavaScript, Java, Swift |
| PascalCase | TheCatInTheHat | Classes and types |
| snake_case | the_cat_in_the_hat | Python, Ruby, Rust, SQL columns |
| kebab-case | the-cat-in-the-hat | URLs, CSS classes, file names |
| CONSTANT_CASE | THE_CAT_IN_THE_HAT | Constants, environment variables |
| aLtErNaTiNg | tHe CaT iN tHe HaT | Mocking text in memes |
| iNVERSE cASE | hELLO wORLD becomes Hello World | Rescuing caps lock mistakes |
Fixing text typed with caps lock on
Which style rescues the text depends on how it went wrong.
| What you have | Pick | Result |
|---|---|---|
| MEETING NOTES FROM MONDAY. THANKS, ANNA | Sentence case | Meeting notes from monday. Thanks, anna |
| hELLO wORLD (shift held while caps lock was on) | iNVERSE cASE | Hello World |
| How To Write A Good Headline For NASA | Sentence case | How to write a good headline for NASA |
In the first row monday and anna lost their capitals. A program cannot tell a name from an ordinary word, and in text that was entirely in capitals nothing hints which words were names, so put those back by hand. In the third row NASA survived, because words with capitals inside are kept on purpose. That same rule means Sentence case leaves hELLO wORLD untouched. Inverse case swaps every letter, so use it only on flipped text.
Title case: the rules, and why two tools give two answers
Title case capitalizes the important words of a title and leaves the small ones in lower case. Where the line falls is a matter of style, not grammar, so style guides draw it in different places. Two tools can disagree about one headline and both be right for their guide.
Most guides agree that the first and last word get a capital, so does the first word after a colon, and verbs are capitalized however short: What to Do When the Server Is Down. The setting that matters is how long a preposition may be before it earns a capital:
| Headline | AP and APA setting | Chicago and MLA setting |
|---|---|---|
| a walk through the park | A Walk Through the Park | A Walk through the Park |
| tips for working from home | Tips for Working From Home | Tips for Working from Home |
| the cat in the hat | The Cat in the Hat | The Cat in the Hat |
The AP and APA setting capitalizes words of four letters or more. AP uses sentence case for its own news headlines, so its four letter rule applies to the titles of books, films and the like. The Chicago and MLA setting also lowers longer prepositions such as through, with and between, but it keeps words that are only sometimes prepositions, such as inside, near, past and up, in capitals because a program cannot tell how you use them. Use the guide your publication, school or employer names, and the same one everywhere. The title case converter opens with that choice in its options.
What no converter can know
A program sees letters, not meaning. It lowers in and on unless they come first, last or after a colon, so how to log in to your account becomes How to Log in to Your Account, and a guide that treats log in as a verb wants In capitalized. Its small word lists are English only, and it cannot spot a proper noun typed in lower case. Read a headline once before it goes out.
camelCase, snake_case, kebab-case: which one for which code
Names in code cannot contain spaces, so each convention marks where a new word starts in its own way. The language community and the project you join decide which to use, not taste.
| Convention | Looks like | Usual home |
|---|---|---|
| camelCase | getUserName | Variables and functions in JavaScript, TypeScript, Java, Kotlin, Swift; keys of many JSON APIs |
| PascalCase | UserAccount | Classes and types in those languages |
| snake_case | get_user_name | Python, Ruby and Rust variables and functions; SQL table and column names |
| kebab-case | get-user-name | URLs, CSS class names, HTML attributes, file names |
| CONSTANT_CASE | MAX_RETRIES | Constants and environment variables |
Hyphens fail in most variable names because they read as a minus sign: user-name is user minus name. That is why hyphens live in addresses and style sheets, and underscores in code and data. If a project already has a habit, follow it. For JSON keys, see format and validate JSON.
The converter splits a name at spaces, punctuation, underscores, hyphens and wherever a lowercase letter or digit meets a capital. So user_first_name, user-first-name and userFirstName become the same three words, and you can convert between styles directly. Spreadsheet headers such as First Name and Date of Birth come out as firstName and dateOfBirth, one per line.
kebab-case keeps accents, so café au lait becomes café-au-lait. For a web address, use the slug generator, which turns é into e.
Accents, numbers and acronyms
- Accents are kept. é becomes É. Scripts without case, such as Chinese and Arabic, are left as they are.
- German ß has no capital in everyday use. Upper case writes SS and lower case gives ss, so straße becomes STRASSE and then strasse.
- Turkish has dotted and dotless i. With the Turkish letter rules, istanbul becomes İSTANBUL.
- Acronyms such as NASA are kept in title, capitalize and sentence case, unless the whole text is capitals. Then HOW TO WRITE A HEADLINE FOR NASA comes back as How to Write a Headline for Nasa.
The code styles drop spaces and punctuation and treat acronyms as ordinary words. If your code base keeps acronyms in capitals, fix those by hand.
| Input | camelCase | snake_case |
|---|---|---|
| XML HTTP request | xmlHttpRequest | xml_http_request |
| HTTPServer | httpServer | http_server |
| userIDs | userIds | user_ids |
| version2Update | version2Update | version2_update |
| it's ready | itsReady | its_ready |
| 2nd place winner | 2ndPlaceWinner | 2nd_place_winner |
Digits stay with the word before them and apostrophes are dropped. The last row shows what the tool does not check: most languages do not allow a name that starts with a digit.
Three ways it goes wrong
- The names disappeared. After fixing a shouting paragraph, Monday and Anna are lower case. Fix: restore them by hand.
- The headline looks off. Verb phrases such as log in need a human eye. Fix: choose your publication's guide, then correct the few words it treats differently.
- The name converts but cannot be used. It starts with a digit, clashes with a reserved word or is too long for your database. Fix: rename it, and check your database's limit on name length.
Clean first, then convert
Apart from the code styles, which drop spaces and punctuation, a case converter changes letters and nothing else. Extra spaces, curly quotes and invisible characters stay, so run text from the web or a PDF through the text cleaner first. Apple and apple are different lines in the duplicate line remover while its Case sensitive switch is on, which it is to begin with, so lowercase them here or switch it off before you remove duplicates and sort a list. To see what a case change did to a long text, compare the two versions with Ignore case off.