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.

Enable JavaScript to customise; default output below.

Live preview converted.txt
The Quick Brown Fox and the Lazy Dog
WordPress Plugin Boilerplate

Output is valid and updates as you type.

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

  1. Paste the text. Each line is converted on its own by default, so a list stays a list.
  2. Pick the case. The first four are for prose, the next six for code, and the last two for making a point.
  3. Turn off per-line conversion when you want one identifier out of several words on several lines.
  4. 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. HTTPServer becomes http-server, and WordPress becomes word_press, which is what those conventions do.
  • A name that spells itself is left alone by the prose cases. WordPress, iPhone and eBay keep 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. wp2Post is wp2 and post, 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 helloWorld to 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?
kebab-case. It matches the rest of CSS, and hyphens are legal in class names without escaping.
Why did my acronym become lowercase?
Programming cases lowercase everything they do not capitalise. parseHTML becomes parse_html in snake case, which is the convention in most languages.
Does it handle several lines?
Yes, one result per line by default. Turn per-line off to join them into one.
What is inverse case for?
Fixing text typed with caps lock on, mostly. It swaps the case of every letter rather than lowercasing everything.
Is anything sent to a server?
No. The conversion happens in this tab.
Weekly drops

New tools, when there are new tools

One email when something worth using ships. No schedule to fill, so no filler.

Your address goes nowhere else, and one click unsubscribes.