Overview
Introduction
Different languages and style guides expect different casing conventions for identifiers, camelCase in JavaScript, snake_case in Python, kebab-case in URLs.
Converting between them by hand is tedious and easy to get wrong.
What Is Case Converter?
A case converter that splits input into words (handling spaces, hyphens, underscores, and camelCase boundaries) and re-joins them in one of seven common casing styles.
It runs entirely client-side as part of this site's String Tools collection, so nothing you paste is ever uploaded to a server.
How Case Converter Works
The tool first normalizes the input into a list of lowercase words, inserting boundaries at existing separators and at lowercase-to-uppercase transitions, then re-joins those words according to the selected style's capitalization and separator rules.
The transformation happens synchronously in JavaScript the moment you type, with no network round trip involved.
When To Use Case Converter
Use it when renaming an identifier between naming conventions, converting a database column name to a JavaScript property name, or formatting a heading.
It's a fast way to get the answer without opening a code editor, a REPL, or writing a one-off script just to check.
Often used alongside Uppercase Text Converter, Lowercase Text Converter and Slug Generator.
Features
Advantages
- Covers seven common styles from one tool.
- Detects camelCase word boundaries automatically, not just spaces and punctuation.
- Converts between styles in either direction, so an identifier already in snake_case can go straight to camelCase without being manually separated into words first.
Limitations
- Acronyms and initialisms aren't preserved specially and get re-cased like any other word.
- Numbers adjacent to letters aren't treated as separate word boundaries.
Examples
Best Practices & Notes
Best Practices
- Review acronym-heavy identifiers manually after conversion, since acronyms aren't preserved specially.
- Pick PascalCase for class/type names and camelCase for variables/functions, per common JavaScript convention.
- Convert from the original identifier rather than chaining conversions, because each pass re-splits the text and a boundary flattened by the first conversion cannot be recovered by the second.
Developer Notes
Word splitting first inserts a space between a lowercase-or-digit character and a following uppercase letter (`/([a-z0-9])([A-Z])/g`) before splitting on whitespace, hyphens, and underscores, which is what allows camelCase and PascalCase input to be re-cased correctly, not just space- or punctuation-separated input.
Case Converter Use Cases
- Renaming a variable between camelCase and snake_case conventions
- Converting a heading to Title Case
- Generating a CONSTANT_CASE name for an environment variable
Common Mistakes
- Expecting acronyms like "URL" or "XML" to stay uppercase after conversion.
- Assuming numbers create word boundaries the way case changes do.
Tips
- For URL-safe identifiers, kebab-case is the conventional choice; for environment variables, CONSTANT_CASE.
- Existing separators and camelCase boundaries are both honored, so a mixed-convention list with some snake_case and some camelCase entries can be normalized to one style in a single pass.