toooly-box

Case Converter

Paste text and switch it between any case: including the ones only programmers ask for.

runs locally
Change case
Your text
Title Case

What are the different text cases?

UPPERCASE is all capitals, lowercase is none, Sentence case capitalises the first letter of each sentence, and Title Case capitalises each significant word. Programming adds camelCase, PascalCase, snake_case and kebab-case, which differ in how they join words without spaces.

How it works

Upper and lower are a straight mapping, done with the locale in hand so language-specific rules apply rather than a blind ASCII swap.

Title case is editorial, not mechanical: the small words, articles, short prepositions, conjunctions, stay lowercase unless they open or close the title. The list used depends on the language of the page you are on.

The programmer cases first split the text into words, which means they work from any starting style: HTTPServer, http-server and "HTTP server" all become the same camelCase.

What a text case is

The case of a text is which of its letters are capitals. Four conventions cover ordinary writing: UPPERCASE puts every letter up, lowercase puts every letter down, Sentence case capitalises the first letter after each full stop, and Title Case capitalises the significant words of a heading. They differ only in where the capitals fall; the letters and the spacing are untouched.

Programming adds a second family, and those are not really about capitals at all: they are about joining words where a space is not allowed. camelCase, PascalCase, snake_case, kebab-case and CONSTANT_CASE each take «user id» and return one token: userId, UserId, user_id, user-id, USER_ID. The capital, or the underscore, is doing the job the space used to do.

The two families behave differently when you convert back. An editorial case keeps the word boundaries, so the text stays readable whichever way you move it. A code case has thrown the separator away, which is why nothing downstream can tell whether user_id began life as «user id» or as «User ID».

The cases, and when each is the right one

  • UPPERCASE for short labels and constants. Past a few words it reads slower, because the shape of a word in all caps carries less information than its mix of ascenders and descenders.
  • lowercase for normalising input before comparing it, and for a deliberately quiet style.
  • Title Case for headlines and titles in English. The small words stay down; the first and last always go up.
  • Sentence case one capital at the start of each sentence. This is what most style guides now prefer for headings, including in Italian, where Title Case was never native.
  • Capitalise Every Word blunter than title case and sometimes what you want for a name list or a menu.
  • camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE the code ones. Variables, classes, database columns, URLs and constants respectively, roughly.

Why title case is harder than it looks

There is no single rule. The Chicago Manual, AP style and the New York Times each lowercase a slightly different set of words, and they disagree most about prepositions: Chicago lowercases all of them regardless of length, AP capitalises anything of four letters or more. "A Tale of Two Cities" is uncontroversial; "The Man Who Fell To Earth" or "to Earth" depends on which guide you are following.

The convention here is the common one: articles, coordinating conjunctions and short prepositions stay lowercase unless they are the first or last word. The last-word rule is the part people forget, and it is why "What Are You Waiting For" ends with a capital F.

Italian is a different matter entirely. Italian titles are written in sentence case, one capital at the start, plus proper nouns, and applying English title case to Italian produces something that looks translated. The tool uses an Italian minor-word list on the Italian page so the result is at least consistent, but for Italian the honest answer is usually sentence case.

The cases that change meaning, not just shape

Lowercasing is not always reversible, and occasionally it is not even safe. The German ß uppercases to SS, so "Straße" becomes "STRASSE" and cannot be turned back automatically. Turkish has a dotted and a dotless i, and lowercasing an I the English way in a Turkish context produces the wrong letter: a bug famous enough to have a name.

Accents survive here because the conversion is done with the locale rather than by subtracting 32 from a byte. "PERCHÉ" lowercases to "perché", not "perchÉ" or "perche". That sounds obvious and is exactly what the naive approach gets wrong.

And the programmer cases are lossy in a way worth knowing. Converting "user ID" to snake_case gives user_id, and converting it back gives "user id": the capital is gone, because snake_case has nowhere to keep it. Round-tripping through a code case is a one-way trip for anything that was capitalised for a reason.

The slug line

  • What it does folds accents to their base letters, lowercases everything, and replaces every run of other characters with a single hyphen.
  • Why accents are folded a URL can carry them percent-encoded, but the result is unreadable and brittle in copy-paste. perché becomes perche.
  • What it does not do it does not shorten, it does not remove stop words, and it does not check whether the slug is already taken.
  • Why it matters for a page the slug is part of the URL, and a URL is hard to change later without a redirect. Getting it right the first time is cheaper than fixing it.

Where each code case is the convention

  • camelCase variables and functions in JavaScript, Java and Swift.
  • PascalCase classes and types almost everywhere, and components in React.
  • snake_case Python variables, Ruby methods, and most SQL column names.
  • kebab-case URLs, CSS class names, HTML attributes and file names. Not valid as an identifier in most languages, because the hyphen reads as minus.
  • CONSTANT_CASE constants and environment variables, in essentially every language.

Questions people ask

How do I change text from uppercase to lowercase?

Paste it and pick lowercase. The conversion respects the language, so accented letters come back correctly rather than being stripped.

What is title case?

Capitals on the significant words, with articles, conjunctions and short prepositions left lowercase: except the first and last word, which are always capitalised.

Should I use title case in Italian?

Usually not. Italian titles are written in sentence case: one capital at the start plus proper nouns. English title case applied to Italian reads like a translation.

What is the difference between camelCase and PascalCase?

The first letter. camelCase starts lowercase and is used for variables; PascalCase starts uppercase and is used for classes, types and React components.

Why did my capital letters disappear in snake_case?

Because snake_case has nowhere to keep them: it is all lowercase with underscores. Converting back cannot restore a capital that the format does not store.