X114

Text Case Converter

Convert text between 12 standard cases: camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, Title Case, and more.

Universal Text Case Converter

Scenario PresetsInstant naming conventions
Detected Words: 4All 12 conversions rendered simultaneously
camelCase

JavaScript / TypeScript variables and object properties

userAuthenticationHandlerV2
PascalCase

React components, class definitions, and TypeScript interfaces

UserAuthenticationHandlerV2
snake_case

Python variables, PostgreSQL table columns, and JSON APIs

user_authentication_handler_v2
kebab-case

URL slugs, CSS class names, and package repositories

user-authentication-handler-v2
CONSTANT_CASE

Environment variables, global constants, and enum keys

USER_AUTHENTICATION_HANDLER_V2
Title Case

Book titles, editorial headlines, and document headings

User Authentication Handler V2
Sentence case

UI button labels, error alerts, and prose sentences

User authentication handler v2
Header-Case

HTTP response headers and MIME protocol fields

User-Authentication-Handler-V2
dot.case

Kafka topics, translation keys, and log namespaces

user.authentication.handler.v2
path/case

Filesystem paths and URL route segments

user/authentication/handler/v2
UPPERCASE

All letters capitalized with whitespace preserved

USER AUTHENTICATION HANDLER V2
lowercase

All letters converted to standard lowercase

user authentication handler v2

About

String casing and identifier naming conventions are foundational elements of software architecture, code maintainability, and multi-language interoperability. As software systems span heterogeneous environments—such as relational databases, REST and GraphQL APIs, frontend state trees, microservices, and infrastructure-as-code manifests—engineers frequently encounter mismatched capitalization paradigms that lead to serialization defects, impedance mismatches, and syntax violations.

The Taxonomy of Identifier Naming Conventions

Different programming languages and runtime ecosystems enforce specific identifier capitalization standards through compilers, linters, and community style guides:

  1. camelCase (Lower Camel Case): Standard in JavaScript (ECMA-262), TypeScript, Java, and Swift for variable and function declarations. Words are joined without delimiters, and every word after the initial word begins with an uppercase letter.
  2. PascalCase (Upper Camel Case): Standard for class, interface, component, and type declarations in C#, TypeScript/React, Go (exported package members), and Swift.
  3. snake_case: Universal standard in Python (PEP 8), Ruby, C, and SQL database relational column identifiers. Words are separated by single underscore (_) characters and lowercased.
  4. kebab-case (Lisp Case): Standard for HTML attributes, CSS class names, URL slugs (RFC 3986), and CLI flags. Words are separated by hyphens (-). Note that kebab-case cannot be used as variable identifiers in most languages due to hyphen collision with the arithmetic subtraction operator.
  5. CONSTANT_CASE (Screaming Snake Case): Standard for global immutable constants, environment variables (POSIX IEEE 1003.1), and C preprocessor macro definitions (#define).
  6. Title Case & Sentence Case: Standard in editorial copywriting, user interface typography, and Chicago Manual of Style (CMOS) heading formatting.

Identifier Convention Comparison Matrix

Casing Style Token Delimiter Initial Character Case Formatting Canonical Ecosystems & Standards Primary Use Cases
camelCase None Lowercase Mixed (Subsequent words capitalized) JavaScript (ECMA-262), Java, Swift Local variables, object properties, functions
PascalCase None Uppercase Upper Camel (Every word capitalized) C#, Go (exported symbols), React JSX Class names, TypeScript interfaces, components
snake_case Underscore (_) Lowercase All lowercase Python (PEP 8), Rust, PostgreSQL Python functions/variables, database columns
kebab-case Hyphen (-) Lowercase All lowercase W3C CSS, URL Path Slugs (RFC 3986) CSS selectors, REST URL endpoints, CLI flags
CONSTANT_CASE Underscore (_) Uppercase All uppercase POSIX IEEE 1003.1, Docker, Linux Env Environment variables, immutable global constants
Dot.Case Period (.) Lowercase All lowercase Java package names, JSONPath keys Configuration property hierarchies, metrics keys
Path/Case Slash (/) Lowercase All lowercase POSIX File Systems, URL routes File directory paths, dynamic route parameters

Implementation Code Snippets Across Languages

TypeScript / Node.js (Robust Tokenizer with Acronym Preservation)

export function splitWords(input: string): string[] {
  return input
    .replace(/([a-z0-9])([A-Z])/g, '$1 $2')
    .replace(/([A-Z])([A-Z][a-z])/g, '$1 $2')
    .replace(/[\s_\-\.\/\]+/g, ' ')
    .trim()
    .split(/\s+/)
    .filter(Boolean);
}

export function toCamelCase(str: string): string {
  const words = splitWords(str);
  return words
    .map((word, index) =>
      index === 0
        ? word.toLowerCase()
        : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()
    )
    .join('');
}

Python 3 (PEP 8 Compliant Regex Converter)

import re

def to_snake_case(text: str) -> str:
    s1 = re.sub(r'([a-z0-9])([A-Z])', r'\1_\2', text)
    s2 = re.sub(r'([A-Z])([A-Z][a-z])', r'\1_\2', s1)
    return re.sub(r'[\s\-\.\/\]+', '_', s2).lower().strip('_')

print(to_snake_case("userAccountId"))  # "user_account_id"

FAQ