Text Case Converter
Convert text between twelve cases, including title case that keeps small words small and the programming cases that share one word list.
The Quick Brown Fox and the Lazy Dog
WordPress Plugin Boilerplate
Output is valid and updates as you type.
Fix the highlighted fields to update the output.
Convert text between twelve cases. The programming cases share one word list, so camelCase and kebab-case always agree on where the words break.
How to use
- Paste the text. Each line is converted on its own by default, so a list stays a list.
- Pick the case. The first four are for prose, the next six for code, and the last two for making a point.
- Turn off per-line conversion when you want one identifier out of several words on several lines.
- Copy the result. Nothing is uploaded and nothing is stored.
Example
the quick brown fox and the lazy dog becomes, in turn:
Title Case: The Quick Brown Fox and the Lazy Dog
Sentence case: The quick brown fox and the lazy dog
camelCase: theQuickBrownFoxAndTheLazyDog
PascalCase: TheQuickBrownFoxAndTheLazyDog
snake_case: the_quick_brown_fox_and_the_lazy_dog
CONSTANT_CASE: THE_QUICK_BROWN_FOX_AND_THE_LAZY_DOG
kebab-case: the-quick-brown-fox-and-the-lazy-dog
and and the stay lowercase in title case, because they are inside the title rather than opening or closing it.
Pitfalls
- Title case is a house style, not a rule. This keeps a short list of articles, conjunctions and prepositions lowercase unless they are first or last, which is what most style guides agree on.
- An acronym is a word boundary for the code cases.
HTTPServerbecomeshttp-server, andWordPressbecomesword_press, which is what those conventions do. - A name that spells itself is left alone by the prose cases.
WordPress,iPhoneandeBaykeep their capitals in title and sentence case, because lowercasing them is wrong in a way readers notice. - Digits stay attached to the word before them.
wp2Postiswp2andpost, which is what a variable name usually means. - Sentence case lowercases the rest of the line. That is the point when text arrives shouted, and destructive if the line contains a name.
- Converting to a programming case loses the separators entirely. Going back from
helloWorldto prose is a guess, not a conversion. - An empty line stays empty rather than collapsing, so the shape of a list survives.
- A line with no letters or digits is left exactly as it is, rather than becoming nothing.
- Unicode letters outside ASCII are kept as they are. A German or French word converts, but an accent is not stripped; that is what the slug generator is for.
Compatibility
Everything runs in your browser, with no upload. The word splitting works on any text the browser can hold, including accented Latin, Greek and Cyrillic letters. Case conversion uses the browser’s own Unicode-aware upper and lower casing, so Turkish and Greek text behaves the way the browser’s locale rules say.
Frequently asked questions
Which case should I use for CSS classes?
Why did my acronym become lowercase?
parseHTML becomes parse_html in snake case, which is the convention in most languages.