Case converter

Turn any text into every case at once, with the words found properly so XMLHttpRequest and user_id both come out right.

camelCase
theQuickBrownFoxJumpsOverTheLazyDog
PascalCase
TheQuickBrownFoxJumpsOverTheLazyDog
snake_case
the_quick_brown_fox_jumps_over_the_lazy_dog
CONSTANT_CASE
THE_QUICK_BROWN_FOX_JUMPS_OVER_THE_LAZY_DOG
kebab-case
the-quick-brown-fox-jumps-over-the-lazy-dog
dot.case
the.quick.brown.fox.jumps.over.the.lazy.dog
path/case
the/quick/brown/fox/jumps/over/the/lazy/dog
Title Case
The Quick Brown Fox Jumps Over the Lazy Dog
Sentence case
The quick brown fox_jumpsover the lazy dog
lowercase
the quick brown fox_jumpsover the lazy dog
UPPERCASE
THE QUICK BROWN FOX_JUMPSOVER THE LAZY DOG

Questions

How are the words found?+

By splitting on separators and on the case changes inside a run of letters, so XMLHttpRequest becomes XML, Http and Request rather than one word. That is what makes the conversion survive an input that is already in some other case.

What is the difference between Title Case and Sentence case?+

Title case capitalises every word except the small ones in the middle, such as of, the and to. Sentence case capitalises only the first word of each sentence, which is what most interface copy should use.

Which case goes where?+

camelCase for JavaScript variables, PascalCase for components and types, kebab-case for files and CSS, snake_case for database columns, CONSTANT_CASE for environment variables.

Related tools

The tools are free. So is most of the library.

1935 blocks and 989 pieces for shadcn/ui and Tailwind, built on the same tokens these tools write. Install one with a command and the code is yours.

No signup for the tools. MIT for free blocks, commercial licence for Pro.

Markdown version