liminfo

Case Converter

Free web tool: Case Converter

About Case Converter

The Case Converter is a free online tool for converting text between eight major naming conventions used in programming: camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, Title Case, UPPERCASE, and lowercase. It is essential for developers who need to transform variable names, database column names, API field names, CSS class names, or file names to match their project's coding style.

The tool features intelligent word boundary detection that correctly splits input text regardless of its current format. Whether your input uses camelCase word boundaries (uppercase letters), snake_case separators (underscores), kebab-case separators (hyphens), or spaces, the converter identifies individual words and reassembles them in your chosen convention. This eliminates manual rewriting when migrating code between languages with different naming standards.

All text processing runs entirely in your browser using pure JavaScript string operations. No data is sent to any server, making this tool safe for converting proprietary variable names, internal API field names, or confidential database schema identifiers.

Key Features

  • Eight conversion targets: camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, Title Case, UPPERCASE, lowercase
  • Smart word boundary detection that handles camelCase splits (e.g., "myVariableName" splits into "my", "Variable", "Name")
  • Automatic recognition of underscore and hyphen separators in snake_case and kebab-case input
  • One-click conversion buttons for instant transformation to any target format
  • Monospace font input/output for accurate visual inspection of naming convention results
  • Copy-to-clipboard button for quickly transferring converted text to your code editor
  • Multi-word input support for converting phrases, sentences, or multi-word identifiers
  • Handles mixed-format input by normalizing separators before applying the target convention

Frequently Asked Questions

What is camelCase?

camelCase is a naming convention where the first word starts with a lowercase letter and each subsequent word starts with an uppercase letter, with no separators between words (e.g., myVariableName, getUserData, isLoggedIn). It is the standard for variable and function names in JavaScript, TypeScript, Java, and Swift. The name comes from the "humps" created by uppercase letters resembling a camel's back.

What is the difference between camelCase and PascalCase?

The only difference is the first letter: camelCase starts with a lowercase letter (myFunction), while PascalCase starts with an uppercase letter (MyFunction). PascalCase is used for class names in most languages (JavaScript, Python, Java, C#), React component names, TypeScript interfaces and type aliases, and C# method names. camelCase is used for variables, function names, and object properties.

When should I use snake_case vs camelCase?

snake_case (words separated by underscores, all lowercase) is the standard in Python (PEP 8), Ruby, Rust, and database column naming. camelCase is the standard in JavaScript/TypeScript, Java, and Swift. When working across languages, follow each language's convention: use snake_case in your Python backend and camelCase in your JavaScript frontend, converting at the API boundary.

What is kebab-case used for?

kebab-case (words separated by hyphens, all lowercase, e.g., my-component-name) is the standard for CSS class names, HTML attributes, URL slugs, npm package names, and Angular/Vue component selectors. It cannot be used for variable names in most programming languages because the hyphen is interpreted as a minus operator. It is also common in CLI command names and Git branch naming conventions.

What is CONSTANT_CASE?

CONSTANT_CASE (also called SCREAMING_SNAKE_CASE or UPPER_SNAKE_CASE) uses all uppercase letters with words separated by underscores (e.g., MAX_RETRY_COUNT, API_BASE_URL, DEFAULT_TIMEOUT). It is the universal convention for constants and environment variables across virtually all programming languages. In JavaScript, it is used with const for values that should never change.

What naming convention does Python use?

Python follows PEP 8 style guidelines: snake_case for variables, functions, and module names (get_user_data); PascalCase for class names (UserAccount); CONSTANT_CASE for module-level constants (MAX_CONNECTIONS); and snake_case with a leading underscore for private members (_internal_method). Method names also use snake_case, unlike Java's camelCase convention.

How does the word boundary detection work?

The converter uses a multi-step algorithm: first, it inserts spaces before uppercase letters that follow lowercase letters (splitting camelCase and PascalCase), then it replaces underscores and hyphens with spaces (splitting snake_case and kebab-case), and finally it splits on whitespace to get individual words. This means input in any supported format is correctly decomposed before being reassembled in the target convention.

Can I convert database column names to API field names?

Yes, this is one of the most common use cases. Database columns typically use snake_case (user_first_name, created_at), while JavaScript/TypeScript APIs use camelCase (userFirstName, createdAt). Paste your snake_case column name and click camelCase to get the API field name, or vice versa. This is especially useful when building ORM mappings or API serialization layers.