Text Case Converter
Enter any text and get instant conversions to all common naming conventions used in code.
Where this actually comes up: the boundary between two naming conventions
The case I reach for this most isn't renaming a single variable — it's the boundary where two naming conventions meet. A .NET API following Microsoft's PascalCase convention serving JSON to a JavaScript frontend that expects camelCase; a Python service with snake_case fields feeding a C# client that wants PascalCase properties; an environment variable in UPPER_SNAKE_CASE that needs to become a kebab-case command-line flag for a Docker Compose file. Converting one identifier by hand is trivial. Converting twenty of them consistently, by eye, without introducing a typo in one of them, is exactly tedious enough to be worth a tool.
Naming conventions by language and context
The choice of naming convention is not arbitrary — each language community has established conventions that compilers, linters, and developers all expect:
- camelCase — first word lowercase, subsequent words capitalised:
getUserName. Used for: JavaScript/TypeScript variables and functions, Java variables and methods, Swift variables and functions, JSON property names in APIs. - PascalCase (UpperCamelCase) — every word capitalised:
GetUserName. Used for: C# classes, methods, and properties (Microsoft's .NET conventions), TypeScript interfaces and types, React component names, Python class names. - snake_case — all lowercase, words separated by underscores:
get_user_name. Used for: Python variables, functions, and module names (PEP 8), Ruby methods and variables, SQL column names, Django model fields, C/C++ function names in system libraries. - kebab-case — all lowercase, words separated by hyphens:
get-user-name. Used for: CSS class names and custom properties, HTML attributes, URL slugs, npm package names, command-line flags. - UPPER_SNAKE_CASE (SCREAMING_SNAKE_CASE) — all uppercase, words separated by underscores:
GET_USER_NAME. Used for: constants in Python (MAX_RETRIES = 3), environment variables (DATABASE_URL), C/C++ preprocessor macros, Java constants (static final).
How to use this tool
- Type or paste your text into the input field — it can be in any case format or plain words.
- All five case formats update instantly in the output panel.
- Click the copy icon next to the format you need.
How digits are handled in a word split
Word-boundary detection runs in passes: first a lowercase-to-uppercase boundary (userName → "user" + "Name"), then a run of capitals followed by a capital-plus-lowercase (parseHTMLTag → "parse" + "HTML" + "Tag"), then a boundary is inserted on either side of any digit run sitting next to a letter. That last pass is what keeps a digit from merging two words together: user2Name splits into "user", "2", and "Name" — giving user_2_name for snake_case, user-2-name for kebab-case, and user2Name unchanged for camelCase, since the digit already sat at a natural boundary. The digit itself is always kept as its own segment rather than being merged into the word on either side.
Consistency matters more than preference
In a team project, consistent naming is more important than which convention you choose. Inconsistent naming — mixing getUserName with get_user_name in the same codebase — slows down code reading, makes autocomplete less useful, and causes subtle bugs when field names need to match an external format like a database schema or JSON API. Most teams enforce naming conventions automatically using linters: ESLint for JavaScript/TypeScript, pylint or flake8 for Python, dotnet format for C#, and stylelint for CSS.
ASP.NET Core's own default JSON serialization is a built-in example of exactly this conversion happening automatically: System.Text.Json's default web defaults apply a camelCase naming policy to outgoing JSON, so a C# property named UserName on a DTO serializes as userName in the API response without you writing any conversion code. That's the same camelCase transform this tool performs by hand — useful to know if you're ever debugging why a property name looks different in the network tab than it does in your C# source.
helloWorldExample
HelloWorldExample
hello_world_example
hello-world-example
HELLO_WORLD_EXAMPLE