Case Converter
runs in your browserConvert text to camelCase, snake_case, kebab-case, PascalCase, Title Case, sentence case and more, all shown at once.
0 words · 0 lines · 0 characters
Text
lower case
the quick brown fox
—
UPPER CASE
THE QUICK BROWN FOX
—
Title Case
The Quick Brown Fox
—
Sentence case
The quick brown fox
—
camelCase
theQuickBrownFox
—
PascalCase
TheQuickBrownFox
—
snake_case
the_quick_brown_fox
—
CONSTANT_CASE
THE_QUICK_BROWN_FOX
—
kebab-case
the-quick-brown-fox
—
Train-Case
The-Quick-Brown-Fox
—
dot.case
the.quick.brown.fox
—
path/case
the/quick/brown/fox
—
tOGGLE cASE
tHE qUICK bROWN fOX
—
aLtErNaTiNg
tHe QuIcK bRoWn FoX
—
about this tool
Every case at once
Paste text and read it back in fourteen conventions: lower, UPPER, Title, Sentence, camelCase, PascalCase, snake_case, CONSTANT_CASE, kebab-case, Train-Case, dot.case, path/case, tOGGLE and aLtErNaTiNg. Copy whichever you needed.
Which convention goes where
The choice is almost always dictated by the surrounding language or system rather than by taste:
- camelCase — JavaScript and Java variables and functions
- PascalCase — class and type names nearly everywhere; React components
- snake_case — Python, Ruby, and SQL columns
- CONSTANT_CASE — constants and environment variables
- kebab-case — CSS classes, URL slugs, HTML attributes, npm packages
- dot.case — configuration keys and namespaced settings
- path/case — routes and file paths
How words are found
The hard part of case conversion is not changing letters, it is deciding where one word ends and the next begins. Splitting handles hyphens, underscores, dots, slashes and spaces, and also the boundary inside a run of camel case.
Consecutive capitals are treated as one word, which is the behaviour you want in
practice: XMLHttpRequest becomes xml_http_request rather than
x_m_l_http_request, and parseJSONResponse becomes parse-json-response.
Digits stay attached to the word they were part of, so utf8Decode does not
split into utf and 8.
Title case versus sentence case
Title case capitalises the first letter of every word. Sentence case capitalises only the first letter of the text and leaves the rest lowercase. Neither applies a publisher's style guide — real title case leaves short words like "of" and "the" lowercase, and that depends on which guide you follow, so the tool does the mechanical thing and lets you fix the exceptions.
Converting a list
Per line applies the conversion to each line independently. That is what you want for a column pasted out of a spreadsheet, or a list of database columns being turned into JSON keys, where treating the whole block as one sentence would join everything together.
If the list also needs deduplicating or sorting, sort & clean up lines does that in one pass.
questions
- How does it handle XMLHttpRequest and other runs of capitals?
- Consecutive capitals are treated as a single word, so XMLHttpRequest becomes xml_http_request rather than x_m_l_http_request, and parseJSONResponse becomes parse-json-response. Digits stay attached to their word, so utf8Decode does not split at the 8.
- Which case should I use for a URL slug or CSS class?
- kebab-case, with hyphens between lowercase words. Use camelCase for JavaScript variables, PascalCase for classes and components, snake_case for Python and SQL columns, and CONSTANT_CASE for environment variables.
- Why does title case capitalise words like 'of' and 'the'?
- Because the tool does the mechanical thing: it capitalises the first letter of every word. Real title case leaves short words lowercase, but which words depends on the style guide you follow, so it is left to you to adjust.
- Can I convert a whole list at once?
- Yes, turn on per line and each line is converted independently. That is what you want for a column pasted out of a spreadsheet, where treating the block as one sentence would run everything together.
- What is the difference between title case and sentence case?
- Title case capitalises the first letter of every word. Sentence case capitalises only the first letter of the text and leaves everything else lowercase.