Case Converter (camelCase, snake_case)

Type or paste text to see it in 12 cases at once, from UPPER CASE to camelCase and snake_case. Put one name per line to convert a whole list of variable names.

Features

  • Shows 12 cases at once: UPPER CASE, lower case, Title Case, Sentence case, camelCase, PascalCase, snake_case, CONSTANT_CASE, kebab-case, Train-Case, dot.case and path/case
  • Smart word splitting that understands acronyms and digits: XMLHttpRequest → xml_http_request, userID → user_id
  • Converts a list of names line by line
  • Detects which case your input is written in
  • Keeps non-English letters such as é, ß, Greek and full-width letters; characters without case are left untouched
  • Options to keep acronyms uppercase (userID) and short words lowercase in Title Case; the text cases keep NASA and iPhone as typed

Use cases

Across languages

Turn an API's user_id into JavaScript's userId, or database columns into Python names.

Constants and env vars

Normalize setting names to CONSTANT_CASE such as API_BASE_URL.

File names and URLs

Make kebab-case file names and slugs from headings or component names.

Headings

Fix text typed in ALL CAPS into Title Case or Sentence case.

Privacy

Your text is converted only in this browser and never sent to a server, so pasting internal code is safe. The last input and options are saved only in this browser on this device (localStorage) so you can pick up where you left off. They are never put in the URL.

FAQ

How are words split?

Spaces and symbols such as -, _, . and / separate words and are dropped from the result. A word also breaks before an uppercase letter that follows a lowercase one (userId → user, Id), before the last capital of an acronym followed by lowercase letters (XMLHttpRequest → XML, Http, Request), and before an uppercase letter after a digit (version2Beta → version2, Beta). Digits stay with the preceding word (md5Hash → md5_hash) unless you choose to treat numbers as separate words (version_2_beta). A trailing s after an acronym counts as a plural (userIDs → user, IDs). Emoji are removed. Names that start with a lowercase letter split: iPhone becomes i and Phone, iOS becomes i and OS, so fix those by hand if needed. In the text cases (Title Case, Sentence case), lines containing a dot (U.S.A., file.txt) are treated as prose and not split.

Which case should I use in each language?

Common conventions: camelCase for variables and functions in JavaScript, Java and Swift; PascalCase for classes and types; snake_case for variables and functions in Python, Ruby and Rust; CONSTANT_CASE for constants and environment variables; kebab-case for CSS classes, URLs and file names. Go uses PascalCase for exported names and camelCase for unexported ones. Follow your team's style guide if it says otherwise.

What are the Title Case rules?

English headings usually keep articles (a, an, the), coordinating conjunctions (and, but, or) and short prepositions (of, in, on, to) lowercase unless they are the first or last word. Style guides such as AP, Chicago and APA differ in the details, for example which prepositions count as short. This tool lowercases only the most widely shared short words. Turn the option off to capitalize every word.

userId or userID?

By default you get userId, which treats acronyms like normal words. Google's Java style guide does this for all acronyms; Microsoft's .NET guidelines do it for acronyms of three or more letters and keep two-letter ones uppercase (IOStream). With "Keep acronyms uppercase", words that were all caps in the input (ID, HTTP) stay uppercase: userID, XMLHttpRequest. If the whole input is in capitals, such as HELLO WORLD, no word is treated as an acronym.

What about the Turkish dotted i?

Conversion uses the standard Unicode rules, which do not depend on the language (locale). So the Turkish and Azerbaijani pairs i ↔ İ and ı ↔ I are not applied: i becomes I. The German ß becomes SS in uppercase, and the Greek final sigma (ς) is used correctly when lowercasing.

What happens to full-width or CJK characters?

Characters without case, such as Chinese or Japanese, are left unchanged. Full-width letters (ABC) change case but stay full-width. Choose "Convert full-width letters and digits to half-width first" to turn them into ABC before converting.

Related tools

Input looks like: Type something to detect its case

Only alphabets have upper and lower case (Latin, Greek, Cyrillic and full-width letters included). Characters without case, such as Chinese or Japanese, are left unchanged.

Options

Turn off to join the words of all lines into a single name.

All-caps words such as ID or HTTP stay uppercase in camelCase and similar cases. The text cases always keep words like NASA or iPhone as typed, unless the line is mostly in capitals.

To convert other full-width characters too, use Full-width ⇔ Half-width

Text

  • UPPER CASE All capitals
     
  • lower case All small letters
     
  • Title Case Headings: each word capitalized
     
  • Sentence case Only the start of each sentence capitalized
     

Programming (variable and file names)

  • camelCase JavaScript and Java variables and functions
     
  • PascalCase Class, type and component names
     
  • snake_case Python and Ruby variables, database columns
     
  • CONSTANT_CASE Constants and environment variables
     
  • kebab-case CSS classes, URLs and file names
     
  • Train-Case HTTP header names
     
  • dot.case Config keys and package names
     
  • path/case Folder paths
     

Everything is converted in this browser. Your text is never sent anywhere.