What is Case Conversion?
Case conversion is the process of transforming text between different naming conventions — the rules that dictate how multi-word identifiers are formatted in code, URLs, file names, and databases. Every programming language and platform has preferred conventions, and switching between them is one of the most common text transformations developers perform.
Naming conventions exist because most programming languages do not allow spaces in identifiers. Instead, developers use capitalization patterns, underscores, or hyphens to visually separate words while keeping the identifier as a single token that a compiler or interpreter can parse.
Common Naming Conventions
- camelCase — first word lowercase, subsequent words capitalized:
getUserName. The standard for variables and functions in JavaScript, Java, TypeScript, and C#. - PascalCase — every word capitalized:
GetUserName. Used for class names, type definitions, React components, and C# methods. Also called "UpperCamelCase." - snake_case — words joined with underscores, all lowercase:
get_user_name. The standard in Python, Ruby, Rust, and SQL. Also common for JSON keys in many REST APIs. - kebab-case — words joined with hyphens, all lowercase:
get-user-name. The convention for CSS classes, HTML attributes, URL slugs, and CLI flags. Hyphens are not encoded in URLs, making this format URL-friendly. - UPPER_SNAKE_CASE — snake_case in all caps:
MAX_RETRY_COUNT. The universal convention for constants and environment variables across nearly every language. - Title Case — every word capitalized with spaces:
Get User Name. Used in headings, button labels, and UI text.
When to Use Each Convention
Choosing the right naming convention depends on the language and context:
- JavaScript / TypeScript:
camelCasefor variables and functions,PascalCasefor classes and React components,UPPER_SNAKEfor constants. - Python:
snake_casefor variables, functions, and modules (PEP 8),PascalCasefor classes,UPPER_SNAKEfor constants. - CSS / HTML:
kebab-casefor class names and attributes (data-user-id,.nav-item). - Go:
camelCasefor unexported identifiers,PascalCasefor exported identifiers (visibility is determined by case). - Ruby:
snake_casefor methods and variables,PascalCasefor classes and modules,UPPER_SNAKEfor constants. - Databases:
snake_caseis the most common for table and column names, since SQL is case-insensitive and underscores are unambiguous. - URLs:
kebab-caseis preferred for URL slugs (/blog/my-first-post) because search engines treat hyphens as word separators, improving SEO.
How This Tool Works
The converter uses a two-step process:
- Tokenization: The input is split into individual words by detecting boundaries — uppercase-to-lowercase transitions (camelCase), underscores (snake_case), hyphens (kebab-case), or spaces. This produces a normalized array of lowercase words.
- Reassembly: The word array is then joined using the rules of each target convention — concatenation with capitalization for camelCase/PascalCase, underscores for snake_case, hyphens for kebab-case, and so on.
This means you can input text in any format and get all eight conversions simultaneously. The tool also auto-detects the input format and displays it above the results.
How to Use This Tool
- Type or paste any text into the input field — it can be in any case format, or just plain words separated by spaces.
- All eight conversions appear instantly below as you type.
- Click Copy next to any result to copy it to your clipboard.
- The detected input format is shown below the input field.
Everything runs in your browser — no data is sent to any server.
Frequently Asked Questions
What is camelCase?
camelCase is a naming convention where multiple words are joined without spaces, each word after the first starting with an uppercase letter. For example, "user first name" becomes "userFirstName". It is the standard for variables and functions in JavaScript, Java, and TypeScript.
What is snake_case?
snake_case is a naming convention where words are joined with underscores and all letters are lowercase. For example, "user first name" becomes "user_first_name". It is the standard in Python, Ruby, Rust, and is commonly used for database column names and REST API parameters.
What's the difference between camelCase and PascalCase?
camelCase starts with a lowercase letter (e.g., "getUserName"), while PascalCase starts with an uppercase letter (e.g., "GetUserName"). In most languages, camelCase is used for variables and functions, while PascalCase is reserved for class names, type names, and components (e.g., React components).
When should I use kebab-case?
kebab-case (words joined with hyphens, all lowercase) is used in CSS class names, HTML attributes, URL slugs, and file names. For example, "my-component-name" or "blog-post-title". It is the convention for CSS because property names like "font-size" already use hyphens, and it is URL-friendly since hyphens are not encoded in URLs.
What is SCREAMING_SNAKE_CASE?
SCREAMING_SNAKE_CASE (also called UPPER_SNAKE_CASE or CONSTANT_CASE) is snake_case with all uppercase letters, e.g., "MAX_RETRY_COUNT". It is the universal convention for constants and environment variables across nearly all programming languages.
What naming convention does Python use?
Python follows PEP 8 naming conventions: snake_case for variables, functions, and module names; PascalCase (called CapWords) for class names; and UPPER_SNAKE_CASE for constants. For example: my_variable, calculate_total(), class UserProfile, MAX_CONNECTIONS.