What each case looks like
Here is the same line, "how to write a JSON API in five steps", in every case the tool offers:
| Case | Result | Typical use |
|---|---|---|
| UPPER CASE | HOW TO WRITE A JSON API IN FIVE STEPS | Short labels, signs, acronyms. Long passages in capitals are hard to read. |
| lower case | how to write a json api in five steps | Tags, email addresses, cleaning up data before comparing it. |
| Title Case | How to Write a JSON API in Five Steps | Headlines, book, film and article titles. |
| Sentence case | How to write a JSON API in five steps | Body text, buttons and menus, and many news and blog headlines. |
| camelCase | howToWriteAJsonApiInFiveSteps | Variables and functions in JavaScript and Java. |
| PascalCase | HowToWriteAJsonApiInFiveSteps | Class names, React components, C# methods. |
| snake_case | how_to_write_a_json_api_in_five_steps | Python and Ruby names, database columns. |
| kebab-case | how-to-write-a-json-api-in-five-steps | URLs, CSS class names, file names. |
| CONSTANT_CASE | HOW_TO_WRITE_A_JSON_API_IN_FIVE_STEPS | Constants and environment variables. |
| aLtErNaTiNg | hOw To WrItE a JsOn ApI iN fIvE sTePs | Jokes and memes. Not for anything serious. |
Remove extra spaces collapses runs of spaces and tabs into one space, trims each line and removes extra blank lines. It is useful after copying text from a PDF.
Title case rules used here
There is no single standard for title case. Style guides agree on the basics, and this tool follows them:
- Capitalise the first and the last word, and the first word after a colon or a full stop.
- Keep articles (a, an, the), short conjunctions (and, but, or, nor, for, so, yet) and short prepositions (as, at, by, in, of, on, per, to, via) in lower case.
- Capitalise every other word, including short verbs and pronouns such as "Is", "Be" and "It".
- Capitalise each part of a hyphenated word, except small words in the middle: "Step-by-Step".
- Leave words that already have capitals inside them alone, so "iPhone", "NASA" and "McDonald's" survive. If the whole text is in capitals, it is lowered first.
The Chicago Manual of Style also lowercases longer prepositions such as "with", "from" and "about". If your publication follows Chicago, change those by hand.
Converting between code styles
For camelCase, PascalCase, snake_case, kebab-case and CONSTANT_CASE, the tool first splits the text into words at spaces, punctuation and existing capital letters. That means you can convert from one code style to another: userAccountID becomes user_account_id, and user_first_name becomes UserFirstName. Each line is converted separately, so you can paste a whole list of column names or keys at once.
| Language | Variables and functions | Classes and types | Constants |
|---|---|---|---|
| Python (PEP 8) | snake_case | PascalCase | CONSTANT_CASE |
| JavaScript, TypeScript | camelCase | PascalCase | CONSTANT_CASE |
| Java | camelCase | PascalCase | CONSTANT_CASE |
| C# | camelCase for locals, PascalCase for methods | PascalCase | PascalCase |
| Ruby, Elixir | snake_case | PascalCase | CONSTANT_CASE (Ruby) |
| Go | camelCase, or PascalCase to export | PascalCase or camelCase | Same as variables |
| CSS, URLs | kebab-case | ||
Tips
- Chain conversions. Click Use as input to feed the result back in, for example to remove extra spaces and then apply Title Case.
- Check proper nouns. Sentence case can't know that "paris" or "monday" need a capital. Read the result before you publish it.
- Other languages work. Accented letters convert correctly (é → É). Letters follow standard Unicode rules, so Turkish dotted and dotless i are not handled the Turkish way.
- Count as you go. To check a headline's length, paste it into the word counter. To tidy JSON keys, use the JSON formatter.
Frequently asked questions
What is title case?
What is the difference between title case and sentence case?
What is the difference between camelCase and PascalCase?
firstName); PascalCase starts with a capital (FirstName).Should URLs use hyphens or underscores?
Is my text sent anywhere?
Last updated . How we check our tools.