Introduction
Every developer has stared at a JSON payload with snake_case keys and a codebase that expects camelCase. Or a CSS class name in kebab-case that needs to become a JavaScript constant in SCREAMING_SNAKE_CASE. These conversions are trivial but tedious, and doing them by hand invites typos. This String Case Converter handles ten common naming conventions in one click. Paste your text, pick the target case, and copy the result. It runs entirely in your browser.
What this tool does
- Converts between camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, and dot.case.
- Also converts to lowercase, UPPERCASE, Title Case, and Sentence case.
- Automatically detects word boundaries from mixed input: handles camelCase, PascalCase, snake_case, kebab-case, and space-separated text.
- Processes multi-line input line by line.
- Live conversion with no submit button required.
How this tool works
The converter first normalizes the input into a list of words by splitting on word boundaries. It detects boundaries from camelCase transitions (lowercase-to-uppercase), explicit separators (hyphens, underscores, dots, spaces), and consecutive uppercase runs (e.g., "HTTPServer" splits into "HTTP" and "Server"). Once the words are isolated, it reassembles them according to the target convention: camelCase lowercases the first word and capitalizes the rest; snake_case joins with underscores; kebab-case joins with hyphens; and so on. The conversion runs on every keystroke.
How case conversion works
Naming conventions exist because different languages and contexts have different rules for identifiers:
- camelCase: JavaScript, Java, Swift function and variable names. First word lowercase, subsequent words capitalized. - PascalCase: C# interfaces, Java classes, TypeScript types. Every word capitalized. - snake_case: Python, Ruby, Rust. Words joined with underscores. - kebab-case: CSS classes, HTML attributes, URLs. Words joined with hyphens. - CONSTANT_CASE: C, Java, JavaScript constants. Uppercase with underscores. - dot.case: Config files, Java package names. Words joined with dots.
The word-boundary detection regex handles the tricky cases. "XMLHttpRequest" splits into ["XML", "Http", "Request"] using the pattern /([A-Z]+)([A-Z][a-z])/ which inserts a space between a run of capitals and a capital-followed-by-lowercase. "user_id" splits on the underscore. "firstName" splits on the lowercase-to-uppercase transition.
How to use this tool
- Paste or type your text in the input field.
- Select the target case from the grid of buttons.
- The output updates instantly with the converted text.
- Copy the result using the Copy button.
- For multi-line input, each line is converted independently.
Real-world examples
Converting API response keys
A frontend developer receives a REST API response with snake_case keys: `{"user_id": 42, "first_name": "Alice", "created_at": "2026-08-10"}`. Their TypeScript interfaces use camelCase. They paste the keys and select camelCase to get `userId`, `firstName`, `createdAt`. This saves manual renaming when writing interface definitions.
CSS class to JavaScript constant
A developer has a CSS class `btn-primary-large` and needs to reference it as a constant in JavaScript. They paste "btn-primary-large", select CONSTANT_CASE, and get `BTN_PRIMARY_LARGE`. They use this as a key in a class name lookup object, ensuring the CSS and JS stay in sync.
Database column to TypeScript type
A backend engineer has a PostgreSQL table with columns named `created_at`, `updated_at`, `user_uuid`. They need PascalCase type names for a GraphQL schema. They paste the column names, select PascalCase, and get `CreatedAt`, `UpdatedAt`, `UserUuid` for their GraphQL type definitions.
Comparison with similar methods
| Method | Complexity | Typical use |
|---|---|---|
| Manual renaming | Low | One-off conversions, error-prone for large files |
| IDE refactoring | Medium | Project-wide renames within one language |
| This converter | Low | Quick cross-convention conversions for any text |
Limitations or considerations
The converter does not preserve original casing within words. "iPhone" becomes "Iphone" in PascalCase because it treats the lowercase "i" as a word start. Acronyms like "XML" are lowercased in camelCase ("xml") rather than preserved. The tool does not handle Unicode letter casing rules (e.g., Turkish dotted/dotless i). For locale-sensitive conversions, use a dedicated internationalization library.
Frequently asked questions
Does it handle multi-word input with spaces?
Yes. Spaces are treated as word boundaries, same as hyphens and underscores. 'hello world' in camelCase becomes 'helloWorld'.
Can it convert multiple lines at once?
Yes. Each line is converted independently, preserving line breaks.
What happens to numbers?
Numbers are treated as part of the adjacent word. 'user2name' stays as one word in camelCase.
Does it preserve special characters?
No. The converter focuses on identifier-style text. Special characters like @, #, $ are stripped during word splitting.
Is there a limit on input length?
No hard limit, but very large inputs may slow down the live preview. The converter processes the entire input on every keystroke.
Conclusion
This converter saves the 30 seconds of manual renaming you do dozens of times per day. Bookmark it for API key conversions, CSS-to-JS mappings, and cross-language refactoring. For generating random identifiers, try the NanoID Generator or UUID Generator.