Text Transform

Case converter

What to do

Transformed in your browser · nothing is uploaded

Local · Chicago/AP overlap for title case

Thirteen cases in one box. The writing ones — UPPERCASE, lowercase, Title Case, Sentence case, Capital Each Word, iNVERSE and aLtErNaTiNg — and the six programming ones, camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE and dot.case. Any of them converts to any other, and the conversion is Unicode-aware, so é becomes É — which is also why a handful of characters do not come back unchanged from a round trip, ß being the one people meet.

How to use the case converter

1 Paste or type the text. A whole document is fine.
2 Pick the case. The writing ones come first, the six programming ones after them.
3 Put back the proper nouns after a lowercase or sentence-case pass; nothing here can tell a name from an ordinary word.
4 Copy the result, or save it as a text file.

Title case is the one with real disagreement behind it. This capitalises every word except articles, coordinating conjunctions and short prepositions, and always capitalises the first and last word regardless — that is the overlap between the Chicago and AP rules, and the first-and-last part is what people get wrong. "A Tale of Two Cities" keeps its opening "A" capitalised even though "a" is normally a small word. Past that the guides diverge: AP capitalises prepositions of four letters or more, Chicago does not, so "Fall Into" versus "Fall into" is a genuine style choice rather than a mistake. Hyphenated compounds are a known gap here: only the first part is capitalised, so "Twenty-First" needs a manual touch.

Sentence case works from punctuation — a full stop, question mark or exclamation mark followed by a space, plus the start of each line. That handles ordinary prose and fails predictably in two places: proper nouns come down with everything else, so "I went to Paris in March" returns as "i went to paris in march" with only the first letter restored, and an abbreviation such as "e.g." or "Dr." looks exactly like a sentence ending, so the next word gets an unwanted capital.

Swapping the case is the only conversion here that undoes itself, which is what makes it the repair for a line typed with Caps Lock on: that text is the exact inverse of what was intended, so inverting it again gives the original back. Uppercasing and lowercasing throw the original capitals away permanently — once a paragraph is in capitals, nothing can tell you where the capitals used to be. But almost is the honest word for the inverse, not always, and the exceptions are all characters whose uppercase form is a different length or a different letter. The German ß uppercases to SS, and SS lowercases to ss, so straße inverts to STRASSE and back to strasse. The fi ligature comes back as two letters the same way. Greek final sigma ς uppercases to Σ, which lowercases to the ordinary σ, because which sigma belongs at the end of a word is not something a per-character mapping can know. Case mapping is also locale-sensitive: Turkish has a dotted and a dotless i that map differently from English, and a Turkish İ lowercases to an i plus a separate combining dot, two code points that no longer match a typed i. The default rules used here are the right ones for English and the wrong ones for Turkish.

The programming cases are unambiguous by comparison, and each exists for a reason worth knowing. snake_case is the database convention because unquoted SQL identifiers are case-insensitive and PostgreSQL folds them to lowercase, so a column created as firstName is really firstname. kebab-case is what URLs and CSS use because Google treats a hyphen as a word separator and an underscore as part of the word, and because a hyphen cannot appear in a JavaScript identifier, which makes the background-color to backgroundColor mapping mechanical. CONSTANT_CASE is the near-universal convention for constants and environment variables. And the difference between camelCase and PascalCase is one character that is load-bearing in at least two languages: in Go the capital decides whether a name is exported from its package, and in JSX a lowercase tag is an HTML element while a capitalised one is your component, which is the commonest reason a React component silently fails to render.

Acronyms are the detail converters get wrong, and the rule is worth stating exactly. A word boundary is found where a lowercase letter meets a capital, and also where a run of capitals meets a capital followed by a lowercase one, which is what keeps a run of capitals together as a single word. parseHTTPResponse and parseHttpResponse therefore both give parse_http_response, XMLHttpRequest gives xml_http_request, and userID gives user_id. The style that comes back out is the majority one, an acronym written as an ordinary word: parseHttpResponse, userId, xmlHttpRequest. So a name round-trips whichever way it was capitalised, but its acronym does not survive as capitals: HTTP comes back as Http, and if the original spelling matters it has to be restored by hand. One last note on aLtErNaTiNg, which is here because people ask for it: it starts on a lowercase letter, counts letters rather than characters so the pattern runs across word boundaries, and is genuinely hostile to screen readers, some of which announce it letter by letter. Fine for a reply where the joke is the point, bad for anything carrying information.

What people use it for

  • Setting a headline in title case with the small words left down
  • Un-shouting a document that arrived in block capitals
  • Putting a label or a heading into full capitals
  • Restoring sentence capitals in text pasted from a form
  • Renaming a variable from user first name to userFirstName
  • Naming a class, a type or a React component in PascalCase
  • Converting a column name to snake_case for a database
  • Turning a post title into a kebab-case URL segment
  • Repairing a line typed with Caps Lock on
  • Writing a reply in the mocking SpongeBob alternating case

Questions

The Chicago and AP overlap. Articles, short prepositions and coordinating conjunctions stay lowercase; AP additionally capitalises prepositions of four letters or more.

MDN, working with stringsUnicode, case mappingChicago Manual of Style, capitalization
Was this tool any good?
Internal signal only · I use it to find the tools worth rebuilding