Case Converter - camelCase, snake_case & More
camelCasePascalCasesnake_casekebab-caseCONSTANT_CASEdot.caseUPPER CASElower caseTitle CaseSentence caseConvert Between Naming Conventions
Paste an identifier, a phrase or a whole list, one item per line, and
all ten formats appear below as you type. It is quickest when you are
moving names between layers that use different conventions: a
user_id column in Postgres, a userId
property in JavaScript, a USER_ID environment variable
and a user-id CSS class or URL slug.
Example
The input XMLHttpRequest gives:
- camelCase:
xmlHttpRequest - PascalCase:
XmlHttpRequest - snake_case:
xml_http_request - kebab-case:
xml-http-request - CONSTANT_CASE:
XML_HTTP_REQUEST - dot.case:
xml.http.request
Note that PascalCase gives XmlHttpRequest, not the
original XMLHttpRequest: each word is capitalised and the
rest lower-cased, which is what most style guides (including
Microsoft's .NET guidelines for acronyms longer than two letters)
recommend.
Which Convention Goes Where
- camelCase: JavaScript and Java variables and functions, JSON keys in most JavaScript APIs.
- PascalCase: classes and types in most languages, React components, C# methods and properties.
- snake_case: Python and Ruby variables and functions, Rust functions, SQL table and column names.
- kebab-case: CSS classes, URL slugs, HTML attributes, command-line flags, npm package names.
- CONSTANT_CASE: constants and environment variables such as
DATABASE_URL. - dot.case: config and translation keys such as
app.header.title.
Edge Cases
A digit followed by a capital starts a new word, so
user_id2FA becomes user-id2-fa. Accented and
non-Latin letters are handled, so Über Größe becomes
über_größe. Title Case capitalises every word, including
"of" and "the", and Sentence case lower-cases proper nouns, so check
those two by hand before publishing a heading.
Related Tools
Markdown Preview
Write Markdown and see the rendered HTML output in real time.
Lorem Ipsum Generator
Generate placeholder text in paragraphs, sentences, or words.
List Deduplicator
Remove duplicate lines from a list with options for case sensitivity and sort order.
List Diff / Compare
Compare two lists and find items unique to each, shared between both, or missing from one.