Input

0 chars

Output

0 chars

How to Use the String Case Converter

Paste or type your text in the Input field at the top of the tool. The converter accepts any format — plain English phrases, existing camelCase identifiers, snake_case database columns, or kebab-case CSS class names. As you type, the result updates instantly in the output area without needing to press any button.

Use the format selector to choose your target case. The eight available formats cover every common naming convention found in modern software development. Once you see the converted output, click the Copy button to copy the result straight to your clipboard. From there you can paste it directly into your editor, terminal, or documentation.

The tool handles edge cases that trip up simpler converters: consecutive uppercase letters (acronyms like API, URL, ID), mixed delimiters, and leading or trailing whitespace are all normalised before conversion. You can also paste a comma-separated list of identifiers and convert the entire batch at once, saving significant time during large refactors or when you need to rename a set of API fields across a codebase. No account, no sign-in, and no data ever leaves your device.

What is Case Conversion?

Case conversion is the process of transforming a string from one naming convention to another. In programming, identifiers — variable names, function names, class names, constants — must follow the naming rules of both the language and the project's style guide. The most widely used conventions are:

  • camelCase — First word lowercase, subsequent words capitalised, no separators. Used for variables and functions in JavaScript, Java, and Swift (getUserProfile).
  • PascalCase — Every word capitalised, no separators. Used for class and component names in most object-oriented languages (UserProfile).
  • snake_case — All lowercase, words separated by underscores. The default in Python, Ruby, and SQL (get_user_profile).
  • kebab-case — All lowercase, words separated by hyphens. Standard for HTML attributes and CSS class names (get-user-profile).
  • CONSTANT_CASE — All uppercase, words separated by underscores. Used for constants and environment variables across virtually every language (MAX_RETRY_COUNT).

Consistent naming conventions improve code readability, reduce cognitive load during code review, and help tools like linters, formatters, and code generators work correctly. A case converter removes the manual busywork of reformatting names when crossing language or layer boundaries.

Common Use Cases

One of the most frequent scenarios is adapting data between a backend API and frontend code. REST APIs built in Python or Go typically return JSON with snake_case keys (user_first_name), while JavaScript codebases expect camelCase (userFirstName). Rather than manually retyping each field name, you can paste a list of keys and convert the whole batch in seconds.

CSS class naming is another high-frequency use case. BEM and Tailwind projects use kebab-case for class names, but design tokens exported from Figma or Sketch often come through in camelCase or PascalCase. Converting them in bulk saves time and eliminates typos.

Database engineers frequently need to map column names. SQL conventions favour snake_case (created_at, user_id), but ORM models and GraphQL schemas sometimes use camelCase. During migrations or schema reviews, converting a full column list in one pass is far faster than editing each name by hand.

Code refactoring is a fourth scenario — renaming a variable or function consistently across multiple files is easier when you start by generating the correctly-cased target name here, then use your editor's find-and-replace to apply it everywhere. See also our Regex Tester for pattern-based renaming, and our JSON Formatter for cleaning up JSON payloads before key conversion.

Best Practices & Tips

The single most important rule is: pick one convention per layer and stick to it. Mixing camelCase and snake_case in the same file causes confusion and makes automated tooling harder to configure.

Here is a quick reference for the conventions used by popular ecosystems:

  • JavaScript / TypeScriptcamelCase for variables and functions, PascalCase for classes and React components, UPPER_SNAKE_CASE for module-level constants.
  • Pythonsnake_case for variables and functions, PascalCase for classes, UPPER_SNAKE_CASE for constants (PEP 8).
  • CSS / HTMLkebab-case for class names, IDs, and custom property names (--primary-color).
  • Database columnssnake_case is conventional across PostgreSQL, MySQL, and SQLite.
  • Environment variables — Always UPPER_SNAKE_CASE, regardless of the host language.

When working across language boundaries, establish a canonical form (usually the backend convention) and convert at the serialisation layer — for example, using an ORM serialiser or a JSON middleware that auto-converts keys. This keeps your business logic clean. For more on naming conventions across languages, see our guide at Naming Conventions Guide.

Supported Case Formats

  • camelCase — Words joined, first word lowercase, subsequent words capitalized (e.g. myVariableName)
  • PascalCase — All words capitalized and joined (e.g. MyVariableName)
  • snake_case — Words joined with underscores, all lowercase (e.g. my_variable_name)
  • SCREAMING_SNAKE — Words joined with underscores, all uppercase (e.g. MY_VARIABLE_NAME)
  • kebab-case — Words joined with hyphens, all lowercase (e.g. my-variable-name)
  • Title Case — Each word capitalized with spaces (e.g. My Variable Name)
  • UPPERCASE — All characters uppercased
  • lowercase — All characters lowercased

FAQ

What case formats are supported?

camelCase, PascalCase, snake_case, SCREAMING_SNAKE_CASE, kebab-case, Title Case, UPPERCASE, and lowercase.

Is my data safe?

Yes. All conversion happens in your browser. No data is sent to any server.

Can I convert multi-word phrases with spaces?

Yes. The tool intelligently splits on spaces, underscores, hyphens, and camelCase boundaries, so you can paste any text and get accurate conversions.

Does it handle acronyms like "ID" or "URL" correctly?

The converter treats consecutive uppercase letters as a single word unit, so "userID" converts to "user_id" in snake_case and "user-id" in kebab-case.

What is SCREAMING_SNAKE_CASE used for?

SCREAMING_SNAKE_CASE (also called CONSTANT_CASE or UPPER_SNAKE_CASE) is the standard convention for constants and environment variables in most languages, including JavaScript, Python, and C.

Related Articles