Case converter
Transformed in your browser · nothing is uploaded
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
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.
Articles, coordinating conjunctions and short prepositions: a, an, the, and, but, or, of, in, on, to and similar. The first and last word are always capitalised regardless.
Title case leaves small words like "of" and "the" lowercase unless they are first or last. Capital case capitalises everything.
Only the first letter of each sentence is capitalised. It cannot tell a name from an ordinary word, so proper nouns need fixing by hand afterwards.
Yes. Lowercase strips the shouting; sentence case then puts a capital back at the start of each sentence.
iNVERSE. Caps Lock text is the exact inverse of what was intended, so swapping the case restores it. Uppercasing or lowercasing cannot, because they discard the original capitals.
Almost. A letter whose uppercase form is a different length does not come back: ß uppercases to SS and returns as ss, the fi ligature returns as two letters, and the Greek final sigma ς returns as an ordinary σ. Ordinary Latin text round-trips exactly.
Yes, and in either direction. It splits on case boundaries and separators alike.
A run of capitals is kept together as one word, so parseHTTPResponse and parseHttpResponse both give parse_http_response, and XMLHttpRequest gives xml_http_request. What comes back is the majority style, an acronym written as an ordinary word: parseHttpResponse. The capitals themselves are not preserved.
Only the first letter. In Go that decides whether a name is exported from its package; in JSX it decides whether a tag is your component or an unknown HTML element.
Unquoted SQL identifiers are case-insensitive and PostgreSQL folds them to lowercase, so firstName silently becomes firstname. snake_case avoids it entirely.
Hyphens, which is kebab-case. A hyphen cannot appear in a JavaScript identifier at all, which is the whole reason CSS writes background-color where the DOM writes backgroundColor. Keep snake_case for database columns; the slug generator has the URL side of it.
Only iNVERSE, and even that is almost rather than always. Uppercasing and lowercasing discard the original capitals outright; swapping restores ordinary text exactly, but not a character whose uppercase form is a different length, such as ß, which goes to SS and returns as ss.
Yes. É becomes é, Ø becomes ø, Σ becomes σ. Digits and punctuation are untouched.
Turkish maps dotted and dotless i differently from English. These are the default Unicode rules, which suit English and are wrong for Turkish.
For display only, use text-transform: uppercase; the underlying text stays intact for copying, search and screen readers. Convert the characters when the stored value itself must change.
Lower. The Mocking SpongeBob format always begins on a lowercase letter, and it counts letters, so the pattern continues across word boundaries rather than resetting.