Regex Bench › Case Converter
Text Case Converter
Paste text and pick a case. Title case follows an actual style guide, leaving short conjunctions and prepositions lowercase, rather than blindly capitalising every word.
● Runs locally. What you paste never leaves this page.
Title case is not "capitalise every word"
Most converters upper-case the first letter of every word, which produces "The Quick Brown Fox Jumps Over The Lazy Dog". Every English style guide would write "The Quick Brown Fox Jumps over the Lazy Dog", because short prepositions, articles and coordinating conjunctions stay lowercase unless they begin or end the title.
This converter applies that rule using the common minor-word set: a, an, and, as, at, but, by, for, if, in, nor, of, on, or, per, so, the, to, v, vs, via. The first and last words are always capitalised regardless.
Guides disagree at the margins. Chicago lowercases all prepositions regardless of length, while AP capitalises those of four letters or more, so "Between" is capitalised in AP and not in Chicago. If you are writing to a specific guide, check the ones longer than three letters by hand.
Programming cases
| Case | Example | Where it is used |
|---|---|---|
| camelCase | userAccountId | JavaScript and Java variables |
| PascalCase | UserAccountId | Class and type names |
| snake_case | user_account_id | Python, Ruby, SQL columns |
| CONSTANT_CASE | USER_ACCOUNT_ID | Constants, environment variables |
| kebab-case | user-account-id | URLs, CSS classes, filenames |
Conversion splits on existing separators and on the boundary between a
lowercase and an uppercase letter, so userAccountId,
user_account_id and user-account-id all resolve to the
same word list and convert between each other cleanly.
Consecutive capitals are the known ambiguity. parseHTTPResponse
has no boundary the rule can detect inside "HTTP", so acronyms may need a manual
pass. This is why many style guides recommend treating acronyms as ordinary
words in identifiers, writing parseHttpResponse.
Sentence case
Sentence case lowercases everything, then capitalises the first letter and anything following terminal punctuation. Because it lowercases first, proper nouns lose their capitals and need restoring by hand. That is unavoidable without recognising names, and worth knowing before running it over a document full of them.
Why kebab-case for URLs
Hyphens are treated as word separators by search engines, while underscores
historically were not, so blue-suede-shoes is read as three words
and blue_suede_shoes may be read as one. URLs are also
case-sensitive on most servers, so lowercase avoids duplicate paths pointing at
the same page.
Questions
Why are some words left lowercase in title case?
Because that is what English style guides require. Articles, coordinating conjunctions and short prepositions stay lowercase unless they are the first or last word, so it is Jumps over the Lazy Dog, not Jumps Over The Lazy Dog.
Which style guide does title case follow?
The common convention shared by Chicago and AP for the shortest function words. They differ on prepositions of four or more letters, which AP capitalises and Chicago does not, so check those by hand if you are writing to one specifically.
How are acronyms handled in camelCase?
Runs of consecutive capitals have no detectable word boundary, so parseHTTPResponse may need a manual fix. Many style guides recommend writing acronyms as ordinary words, as in parseHttpResponse, precisely to avoid this.
Does sentence case preserve proper nouns?
No. It lowercases everything before capitalising sentence openings, so names need restoring by hand. Recognising proper nouns reliably is not possible without understanding the text.