Case Converter

Paste a variable name, column header or sentence and switch it between eight casing styles. Word boundaries are detected from spaces, underscores, hyphens and existing camelCase.

Loading Case Converter…

How to Use Case Converter

1

Paste your text

Enter a heading, a sentence, a variable name or a list of field names, one per line if you have several.

2

Pick the case style

Choose from UPPER, lower, Sentence, Title, camelCase, PascalCase, snake_case, kebab-case and CONSTANT_CASE.

3

Convert

Press Convert Case or Ctrl+Enter. Words are detected from spaces, punctuation and existing capital letters, so "userID", "user-id" and "User ID" all convert cleanly.

4

Copy the result

Copy the converted text into your code, spreadsheet or document.

Case Converter Guide

Which case goes where

Naming conventions differ by language and context. camelCase is the norm for JavaScript and Java variables and JSON keys. PascalCase is used for class, type and React component names. snake_case is standard in Python, Ruby and SQL column names. kebab-case appears in URLs, CSS class names and CLI flags. CONSTANT_CASE marks constants and environment variables.

How words are detected

The converter splits input on spaces, underscores and hyphens, and also at the point where a lowercase letter is followed by an uppercase one, so userAccountId, user_account_id, user-account-id and "User Account ID" all become the same three words. That makes it handy for renaming fields when moving data between an API, a database and front-end code.

Frequently Asked Questions

What is the difference between camelCase and PascalCase?

Both join words without spaces and capitalize each word, but camelCase keeps the first letter lowercase (orderTotal) while PascalCase capitalizes it (OrderTotal). JavaScript and Java use camelCase for variables and functions and PascalCase for classes and types.

When should I use snake_case or kebab-case?

snake_case is the convention for Python variables and functions, Ruby, and most SQL column names. kebab-case is used in URLs, CSS class names, HTML attributes and command-line flags, where hyphens read naturally and underscores can be hidden by link underlines.

Why does Title Case not match my style guide?

This converter capitalizes every word, which is the simplest rule and the one most interfaces use for buttons and headings. Editorial styles such as AP and Chicago keep short words like "and", "of" and "the" lowercase in the middle of a title, so check those by eye for published headlines.

How are acronyms handled?

An acronym is treated as one word, so "HTTP request" becomes httpRequest in camelCase and HttpRequest in PascalCase. Some codebases prefer to keep acronyms capitalized, as in HTTPRequest. Pick one style and apply it consistently.

What is CONSTANT_CASE used for?

CONSTANT_CASE, also called screaming snake case, marks values that never change: constants in JavaScript, Java and C, environment variable names such as DATABASE_URL, and enum members in many codebases. The capital letters make it obvious at a glance that the value should not be reassigned.

Can I convert many names at once?

Yes. Paste a list with one name per line and every line is converted with the same style. This is useful when you move a set of database columns into a JavaScript object, or turn spreadsheet headers into JSON keys.

What does sentence case do?

Sentence case lowercases the text and capitalizes the first letter of each sentence, after a period, question mark or exclamation mark. It is the style most modern interfaces use for headings, menu items and button labels, because it reads more naturally than capitalizing every word. Proper nouns such as product names need to be fixed by hand afterwards.

More in Developer Utilities