String Case Converter
Convert text between camelCase, PascalCase, snake_case, kebab-case, and more
About this tool
The String Case Converter transforms text between every common programming naming convention: camelCase, PascalCase, snake_case, SCREAMING_SNAKE_CASE, kebab-case, COBOL-CASE, dot.case, Title Case, UPPERCASE, and lowercase. It intelligently splits compound words regardless of the source format.
When to use it
- โRenaming variables when switching languages (Python uses snake_case, JS uses camelCase)
- โConverting API field names to match your codebase's convention
- โTransforming database column names into JSON keys for API responses
- โNormalizing user-supplied input strings to a consistent internal format
Tips
- โInput can be any mix of formats โ the converter handles camelCase, PascalCase, snake_case, and space-separated words as input.
- โkebab-case is required for CSS class names and HTML attributes. camelCase is required for JavaScript identifiers.
Frequently asked questions
Why do different programming languages use different naming conventions?
Naming conventions evolved independently with each language's community. Python's PEP 8 standardized snake_case for readability. JavaScript inherited camelCase from Java. CSS adopted kebab-case because hyphens are not operators in CSS. Databases favor snake_case for SQL compatibility. Each convention also reflects the language's syntax constraints โ hyphens are invalid in JS identifiers, for example.
What is the difference between camelCase and PascalCase?
Both concatenate words without separators and capitalize the first letter of each word โ except camelCase keeps the very first letter lowercase (myVariableName) while PascalCase capitalizes everything (MyClassName). PascalCase is also called UpperCamelCase or StudlyCase. In most languages, PascalCase is for types and classes while camelCase is for variables and functions.
When should I use SCREAMING_SNAKE_CASE?
SCREAMING_SNAKE_CASE (all caps with underscores) is the standard for constants and environment variables โ MAX_RETRIES, DATABASE_URL, API_KEY. The all-caps convention signals that the value should not change at runtime. In Python it's the recommended style for module-level constants per PEP 8.
How does the converter handle already-mixed input?
The converter tokenizes the input by splitting on case transitions (camelCase), underscores, hyphens, and spaces โ then rejoins the tokens in the target format. So 'myAPIKey', 'my_api_key', 'my-api-key', and 'My Api Key' all produce the same token list [my, api, key] before being reformatted.