Text Case Converter
Paste text and click a format: UPPERCASE, lowercase, camelCase, snake_case, kebab-case, Title Case, and more. The conversion is instant and nothing leaves your browser.
How to change text case
Paste text, pick a format, and copy the result.
- 01
Paste your text
A heading, a paragraph typed with caps lock on, or a variable name copied from code all work. The result updates as you type.
- 02
Click the case you want
Ten formats are available: UPPER, lower, Title, Sentence, camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE and dot.case.
- 03
Copy the result
One click copies the converted text. Your original stays in the box, so you can try another format straight away.
How words are split for code cases
The programming cases first break your text into words, then rejoin them. A new word starts at a space, an underscore, a hyphen, a dot or any other punctuation, and also wherever a lowercase letter or digit is followed by a capital. A run of capitals followed by a lowercase letter is split too, so HTTPResponse becomes HTTP and Response.
That means you can convert between conventions in any direction. Here are two inputs, UserProfileCard and parseHTTPResponse, run through each code case:
| Format | From UserProfileCard | From parseHTTPResponse | Typically used for |
|---|---|---|---|
| camelCase | userProfileCard | parseHttpResponse | JavaScript and Java variables, JSON keys |
| PascalCase | UserProfileCard | ParseHttpResponse | Class names, React components, C# methods |
| snake_case | user_profile_card | parse_http_response | Python, Ruby, SQL column names |
| kebab-case | user-profile-card | parse-http-response | CSS classes, HTML attributes, URLs, file names |
| CONSTANT_CASE | USER_PROFILE_CARD | PARSE_HTTP_RESPONSE | Constants and environment variables |
| dot.case | user.profile.card | parse.http.response | Config keys and translation keys |
Notice that acronyms come out as Http rather than HTTP in camelCase and PascalCase. That's the convention in most style guides, including Google's Java and JavaScript guides, because it keeps word boundaries clear. Accented letters are kept as they are: Café Menü becomes café_menü in snake_case. For URLs, where accents are best avoided, use the Slug Generator instead.
Title case and sentence case, done by rule
Title Case here capitalises every word, so "the lord of the rings" becomes "The Lord Of The Rings". Style guides such as AP and Chicago keep short words like of, the and and in lower case unless they start the title, so fix those by hand for a published headline: The Lord of the Rings.
Sentence case lowers everything, then capitalises the first letter of the text and of each new sentence after a full stop, question mark or exclamation mark. It can't know which words are names, so iPhone, NASA and London all come out in lower case and need putting back. That's still much quicker than retyping a paragraph written in capitals.
Which case each language expects
Most languages have a published style guide, and following it makes code easier for others to read. These are the usual conventions:
| Language or place | Variables and functions | Classes and types | Constants |
|---|---|---|---|
| Python (PEP 8) | snake_case | PascalCase | CONSTANT_CASE |
| JavaScript and TypeScript | camelCase | PascalCase | CONSTANT_CASE or camelCase |
| Java and C# | camelCase (C# methods are PascalCase) | PascalCase | CONSTANT_CASE |
| Go | camelCase, or PascalCase to export | PascalCase | PascalCase or camelCase |
| Rust | snake_case | PascalCase | CONSTANT_CASE |
| CSS classes and HTML attributes | kebab-case | n/a | n/a |
| SQL tables and columns | snake_case (by common practice) | n/a | n/a |
| Environment variables | CONSTANT_CASE | n/a | n/a |
Where a case converter saves time
Fixing text typed with caps lock on
Paste it in, choose Sentence case, then capitalise the few names. Two seconds instead of retyping.
Moving names between languages
A Python field user_id becomes userId for a JavaScript client and USER_ID for an environment variable.
Turning labels into field names
Human-readable column headers like "Date of Birth" become date_of_birth for SQL or dateOfBirth for JSON.