Free tool
Case converter for text and code
Change text to UPPER CASE, lower case, Title Case or Sentence case, or turn words into code names like camelCase, snake_case and kebab-case. Paste a list and every line is converted on its own. All 16 cases are shown at once, so you can copy the one you need.
Free · no sign-up · runs in your browser, nothing is uploaded
Type or paste text, then pick a case.
All cases
Every case, with an example
The tool splits your text into words first, then joins them in the style you pick. The same input, XML http request, in each case:
| Case | Result | Typical use |
|---|---|---|
| camelCase | xmlHttpRequest | JavaScript, Java and C# variables and functions |
| PascalCase | XMLHttpRequest | Classes, types, React components |
| snake_case | xml_http_request | Python and Rust functions, SQL columns |
| CONSTANT_CASE | XML_HTTP_REQUEST | Constants, environment variables |
| kebab-case | xml-http-request | URLs, CSS classes, file names, CLI flags |
| Train-Case | XML-Http-Request | HTTP header names like Content-Type |
| dot.case | xml.http.request | Config keys, i18n message keys |
| path/case | xml/http/request | Folder paths, topic names |
| flatcase | xmlhttprequest | Go and Java package names |
| Title Case | XML Http Request | Headings, titles |
| Sentence case | XML http request | UI labels, normal sentences |
Text cases (Title, Sentence, UPPER, lower, Capitalized, alternating and inverse) keep your spaces and punctuation. Code cases turn each line into one name, so a pasted list of column names comes back as a list. A line that is a single code name, like get_user_by_email, is split into words first, so Title Case gives Get User by Email.
Naming conventions by language
Most languages have a style guide that says which case goes where. The common ones:
| Language | Variables and functions | Classes and types | Constants |
|---|---|---|---|
| JavaScript / TypeScript | camelCase | PascalCase | CONSTANT_CASE or camelCase |
| Python (PEP 8) | snake_case | PascalCase (CapWords) | CONSTANT_CASE |
| Java (Google style) | camelCase | PascalCase | CONSTANT_CASE |
| Go | camelCase, or PascalCase to export | PascalCase to export | Same as other names |
| Rust | snake_case | PascalCase (UpperCamelCase) | CONSTANT_CASE (SCREAMING_SNAKE_CASE) |
| C# | camelCase locals, PascalCase methods | PascalCase | PascalCase |
| CSS / HTML | kebab-case classes and attributes | --kebab-case custom properties | |
| Shell / env vars | snake_case | CONSTANT_CASE |
Go is the odd one out: case is part of the language. Effective Go says a name is visible outside its package only when its first letter is upper case, and asks for MixedCaps instead of underscores. POSIX says the environment variables its utilities use are made of upper-case letters, digits and underscores, which is why DATABASE_URL looks the way it does.
How words and acronyms are split
To convert between code styles, the tool has to find the words inside a name first. It splits on:
- Anything that is not a letter or digit: spaces,
_,-,.,/, emoji. - A lower-case letter or digit followed by a capital:
userId→ user, Id;v2Api→ v2, Api. - The end of an acronym:
XMLHttpRequest→ XML, Http, Request;HTML5Parser→ HTML5, Parser.
Apostrophes are dropped instead of splitting a word, so don't stop becomes dontStop, not donTStop. Letters with accents and non-Latin scripts are kept: größe der datei becomes GrößeDerDatei. To get plain ASCII for a URL, use the slug generator.
Style guides disagree on acronyms. PEP 8 says to capitalize all letters of an acronym in CapWords (HTTPServerError). The Google Java Style Guide treats them as normal words (XmlHttpRequest, newCustomerId). The "Keep acronyms" switch picks between the two.
Title case vs sentence case
Sentence case capitalizes only the first word of each sentence (and the word I). It is what most product UIs use for buttons and labels. Title case capitalizes the main words of a heading.
Here, title case keeps these words lower case unless they come first, last or right after a colon: a an the and but or nor for so yet as at by in of off on per to up via vs en if. Hyphenated words get each part handled (Step-by-Step), and words with their own capitals, like iPhone, JavaScript or NASA, are left alone. If a line is all caps, nothing can be told apart, so every word on it is treated the same.
AP, Chicago and APA style differ on details, for example whether longer prepositions like with or from are capitalized. Check your house style for anything you publish.
Change case in code
JavaScript: upper and lower case are built in. For identifier styles, Lodash has helpers.
'Hello World'.toUpperCase(); // 'HELLO WORLD'
'Hello World'.toLowerCase(); // 'hello world'
import { camelCase, snakeCase, kebabCase, startCase } from 'lodash';
camelCase('user profile id'); // 'userProfileId'
snakeCase('userProfileId'); // 'user_profile_id'
kebabCase('User Profile Id'); // 'user-profile-id'
startCase('user_profile_id'); // 'User Profile Id'Python: str.title() treats an apostrophe as a word break, which the Python docs point out:
"they're bill's friends".title() # "They'Re Bill'S Friends"
"Hello World".upper() # 'HELLO WORLD'
"Hello World".lower() # 'hello world'
import re
def snake(name): # 'userProfileId' -> 'user_profile_id'
return re.sub(r'(?<=[a-z0-9])([A-Z])', r'_\1', name).lower()Go: strings.Title is deprecated because it does not handle Unicode word breaks well. Use the golang.org/x/text/cases package.
import (
"golang.org/x/text/cases"
"golang.org/x/text/language"
)
cases.Title(language.English).String("hello world") // "Hello World"
strings.ToUpper("hello") // "HELLO"Bash (version 4 or newer):
name="Hello World"
echo "${name^^}" # HELLO WORLD
echo "${name,,}" # hello world
echo "Hello" | tr '[:lower:]' '[:upper:]' # HELLO, works in any POSIX shellOther free tools that help with names and text: the slug generator for URLs, the JSON to TypeScript converter for typed field names, and the regex tester for custom renames. For editors and IDEs with rename refactoring built in, see IDE tools on DevHunt.
More free developer tools
FAQ
What is a case converter?+
A case converter changes the capital letters in text without retyping it: UPPER CASE to lower case, a heading to Title Case, or a phrase like "user profile id" to a code name like userProfileId or user_profile_id. This one shows all 16 cases at once and converts each line separately, so you can paste a whole list.
How do I convert all caps to normal text?+
Paste the text and pick Sentence case. Every sentence then starts with a capital and the rest is lower case, and a lone "i" becomes "I". Pick Title Case for headings. Names and acronyms in all-caps text cannot be told apart from the rest, so check those by hand afterwards.
How do I change case in Word without retyping?+
Select the text and press Shift+F3 (fn+Shift+F3 on a Mac keyboard). Each press cycles through lowercase, UPPERCASE and Capitalize Each Word. The Change Case button (Aa) on the Home tab has more options, including Sentence case.
How do I change all caps to lowercase in Google Sheets or Excel?+
Use a formula in a new column: =LOWER(A1) for lower case, =UPPER(A1) for upper case and =PROPER(A1) to capitalize each word. Then copy the column and paste it back as values. For camelCase or snake_case there is no built-in function, so paste the column here instead.
What is the difference between camelCase and PascalCase?+
Only the first letter. camelCase starts lower case (userProfileId) and PascalCase starts upper case (UserProfileId). In JavaScript, Java and C#, variables and functions are usually camelCase and classes are PascalCase. In Go the first letter decides visibility: Name is exported from its package, name is not.
What is the difference between snake_case and kebab-case?+
snake_case joins words with underscores (user_profile_id) and kebab-case with hyphens (user-profile-id). Most programming languages read a hyphen as minus, so kebab-case is used where names are not code: URLs, CSS classes, HTML attributes, file names and CLI flags. snake_case is the Python and Rust style for functions and variables.
What is title case?+
Title case capitalizes the main words of a heading and keeps short words like a, the, and, of and to in lower case, unless they are the first or last word. Style guides (AP, Chicago, APA) differ on details such as words of four or more letters. Turn off "Lower-case small words" to capitalize every word.
How are acronyms like XML or ID handled?+
With "Keep acronyms" on, all-caps words stay as they are: "XML http request" becomes XMLHttpRequest, as PEP 8 recommends for Python class names. Turn it off to get XmlHttpRequest, the style the Google Java and JavaScript guides use. Text that is all caps is treated as plain words either way.
Sources: PEP 8: naming conventions · Effective Go: names · Google Java Style Guide: camel case · Google JavaScript Style Guide: naming · Google Shell Style Guide: naming · Microsoft: C# identifier naming · Rust API Guidelines: naming · Python str.title() · Go strings.Title (deprecated) · POSIX: environment variables · Microsoft: change the case of text in Word · Lodash string functions. Checked 2026-10-30.