Code Case Converter

Code Case Converter

Convert phrases and existing identifiers to camelCase, PascalCase, snake_case, kebab-case, or CONSTANT_CASE. Splits on spaces, punctuation, and case changes, including acronym boundaries, then rejoins the words in the style you pick.

camelcase
snake-case
naming
Share this tool:
Quick Presets
Identifier styles that are commonly converted betweenNeed plain case conversion?
Input Text
Paste your text and choose a transformation.
How it works: Splits identifiers on spaces, punctuation, case changes, and acronym boundaries, then rejoins the words in camel, Pascal, snake, kebab, or constant case.

Was this tool helpful?

What is Code Case Converter?

The Code Case Converter rewrites phrases and identifiers into the naming convention you select. Paste text or an existing identifier and the tool splits it into words, then rejoins them as camelCase, PascalCase, snake_case, kebab-case, or CONSTANT_CASE. Acronym boundaries are detected, so HTTPServer becomes two words rather than one.

How does Code Case Converter work?

The input is split on whitespace, punctuation, case changes, and acronym boundaries. Two regular expressions handle the boundary cases: one separates an acronym from a following capitalized word, and one separates a lowercase letter or digit from an uppercase letter.

The resulting words are lowercased, then rejoined with the separator and capitalization the selected mode uses. Digits stay in place, so HTTP2Server becomes http2_server in snake case.

Key Features

  • camelCase, PascalCase, snake_case, kebab-case, and CONSTANT_CASE
  • Splits existing identifiers as well as plain phrases
  • Detects acronym boundaries such as HTTPServer
  • Keeps digits attached to the surrounding word
  • Handles spaces, punctuation, and mixed case input
  • Returns a single identifier rather than a list

Common Use Cases

When and why you might need this tool
  • Renaming a variable

    Turn a database column such as created_at into createdAt for JavaScript code.

  • Converting a CSS class to a JS key

    Change user-profile-settings into userProfileSettings when moving markup into a component.

  • Creating a constant from a phrase

    Generate MAX_RETRY_COUNT from the words max retry count for a configuration file.

  • Standardising API field names

    Convert a camelCase response field to snake_case for a Python service that expects it.

  • Turning a title into a slug

    Use kebab-case on a heading to produce a URL-friendly string before adding it to a route.

How to Use This Tool

Step-by-step guide to get the best results
1

Paste the phrase or identifier

Enter words separated by spaces, or an existing identifier such as getUserById.

2

Pick a convention

Select camelCase, PascalCase, snake_case, kebab-case, or CONSTANT_CASE.

3

Convert

Press Convert Case. The whole input becomes one identifier.

4

Copy the result

Use the copy button in the result header and paste the identifier into your editor.

5

Try another convention

Switch the mode and convert again without retyping the input.

Pro Tips

  • 1

    An acronym followed by a word splits correctly, so HTTPServer becomes http_server in snake case.

  • 2

    Digits stay attached to the word they belong to, so HTTP2Server becomes http2_server.

  • 3

    The converter returns one identifier, not a list, so use one input per name.

  • 4

    kebab-case is the right choice for URLs and CSS class names; snake_case suits Python and SQL.

  • 5

    Paste an existing identifier to normalise it before adding it to a shared codebase.

Frequently Asked Questions

How do I convert text to camelCase?

Paste the words, select camelCase, and convert. user profile settings becomes userProfileSettings, with the first word lowercase and each following word capitalised.

What is the difference between snake_case and kebab-case?

snake_case joins words with underscores and kebab-case joins them with hyphens. Both lowercase every word, so the choice usually depends on the language or the platform.

Can it convert an existing identifier rather than a phrase?

Yes. The input is split on case changes and separators, so getUserById, user_profile_settings, and user-profile-settings all become the same set of words.

How are acronyms handled?

A run of capitals followed by a capitalised word is split, so HTTPServer is read as HTTP and Server. That keeps the acronym intact instead of lowercasing it into one long word.

What happens to numbers in the input?

Digits stay attached to the word they follow. HTTP2Server splits into HTTP2 and Server, which becomes http2_server in snake case.