DevToolCase
Sign in Sign in

Convert case: camelCase, snake_case, kebab-case

Convert names and text to camelCase, PascalCase, snake_case, kebab-case, SCREAMING_SNAKE_CASE, Title Case and more, all at once.

Share this result

Encrypted in your browser. The key stays in the link, after “#”: only the people you give it to can read it, not even DevToolCase.

The link works for

Sign in for longer links or links without expiry, and to find them in your account.

Runs entirely in your browser: nothing you type is sent or stored.

Which case for which language?

Each language has its naming conventions, set by its style guide (PEP 8 for Python, Effective Go, the Rust API guidelines…) and checked by its linters. Following them makes code read like the rest of the ecosystem.

LanguageVariables and functionsClasses and typesConstants
JavaScript, TypeScriptcamelCasePascalCaseSCREAMING_SNAKE_CASE
Java, KotlincamelCasePascalCaseSCREAMING_SNAKE_CASE
C#camelCase for locals, PascalCase for methods and propertiesPascalCasePascalCase
PHPcamelCase (PSR-1 methods)PascalCaseSCREAMING_SNAKE_CASE
Python, Ruby, Rustsnake_casePascalCaseSCREAMING_SNAKE_CASE
GocamelCase, PascalCase when exportedPascalCaselike variables
SQLsnake_case for tables and columns——

Outside the code: CSS, URLs, files

  • CSS classes and custom properties, HTML data-* attributes and Angular file names use kebab-case, such as .main-nav, --primary-color, user-profile.component.ts.
  • URLs are written in kebab-case, in lower case, without accents: search engines read hyphens as word separators, not underscores.
  • Environment variables are in SCREAMING_SNAKE_CASE (DATABASE_URL), HTTP headers in Train-Case (Content-Type), configuration keys often in dot.case (spring.datasource.url).
  • JSON fields of an API follow the language that produces them, camelCase or snake_case; pick one and keep it everywhere.

How the words are found

Spaces, punctuation and separators (_ - . /) end a word, and so does a change of case inside an identifier. An acronym followed by a word is split before its last capital: XMLHttpRequest gives XML, Http, Request. Each line is converted on its own, so a list of names stays a list.

Digits stay with the word before them, as in base64, utf8 or int32, and a capital after a digit starts a new word: getHTTPResponse2Code becomes get_http_response2_code, and base64Encode stays readable as base64_encode.

Acronyms become ordinary words in camelCase and PascalCase (HttpClient, not HTTPClient), as most style guides recommend: the word boundaries stay visible.

Accents and other alphabets

By default, the identifier cases remove accents: crème brûlée becomes cremeBrulee. Many tools, databases and URLs only accept ASCII in names, and ß, æ or ø are written ss, ae and o. The text cases (Title Case, Sentence case, lower and UPPER CASE) always keep them.

Untick the option to keep accents in identifiers too: JavaScript, Python 3 and Java accept them. Letters of other alphabets (Greek, Cyrillic, Chinese…) are kept as they are. To check that renamed names match a pattern, use the regex tester; to compare two versions of a file, compare the texts.

Add this browser’s favorites to your account?

This browser has 0 favorites that your account does not have:

Either way, this browser keeps its favorites: you find them again after signing out.