正在加载,请稍候…

String Case Converter: camelCase, snake_case, PascalCase and More

Convert text between camelCase, snake_case, PascalCase, kebab-case, and other naming conventions instantly.

What Is Case Conversion?

Case conversion is the process of transforming text between different capitalization and word separation conventions. Different programming languages, file systems, database schemas, and writing styles use different naming conventions, and converting between them is a frequent developer task.

Text Case Types

Lowercase

All characters in lowercase: hello world

UPPERCASE

All characters in uppercase: HELLO WORLD

Title Case

First letter of each significant word capitalized: Hello World

Sentence case

First letter of sentence capitalized: Hello world

Programming Naming Conventions

camelCase

Words joined without spaces, first word lowercase, subsequent words capitalized:

helloWorld
getUserById
calculateTotalPrice

Used in: JavaScript variables and functions, Java methods, Swift properties, TypeScript

PascalCase (UpperCamelCase)

Like camelCase but first word also capitalized:

HelloWorld
UserProfile
DatabaseConnection

Used in: JavaScript/TypeScript class names, C# types, React components, Pascal language (hence the name)

snake_case

Words separated by underscores, all lowercase:

hello_world
user_id
get_user_by_id

Used in: Python variables and functions, Ruby, PHP, SQL column names, file names in many Unix conventions

SCREAMING_SNAKE_CASE (CONSTANT_CASE)

Like snake_case but all uppercase:

MAX_RETRY_COUNT
DEFAULT_TIMEOUT_MS
API_BASE_URL

Used in: Constants in most languages, environment variables, C/C++ macros

kebab-case (dash-case, param-case)

Words separated by hyphens, all lowercase:

hello-world
user-profile
get-user-by-id

Used in: CSS class names, HTML attributes, URL slugs, npm package names, Kubernetes manifest names

dot.case

Words separated by dots:

hello.world
com.example.app
org.springframework.boot

Used in: Java package names, configuration keys (Spring Boot, etc.), domain-reversed package identifiers

path/case

Words separated by forward slashes:

hello/world
src/components/button

Used in: File paths, URL paths, import paths in some systems

Header-Case (Train-Case)

Words separated by hyphens, each word capitalized:

Hello-World
Content-Type
Authorization

Used in: HTTP headers

Why Case Conversion Matters

Cross-Language Integration

JavaScript APIs typically use camelCase, while REST API endpoints often use kebab-case, and databases use snake_case. When building systems that span these layers, consistent conversion is essential.

Code Generation

When generating code from external sources (database schemas, API definitions, config files), you need to convert names to the target language's convention.

Data Import

Spreadsheet column headers (Title Case) need conversion to database column names (snake_case) or API field names (camelCase).

Documentation and Communication

Technical writers converting between formal writing (Title Case) and code references (camelCase, snake_case).

Conversion Rules

Splitting Words

Case conversion first splits text into individual words, then rejoins in the target format. Word boundaries are detected at:

  • Transitions from lowercase to uppercase (camelCase splitting)
  • Spaces and existing separators (-, _, ., /, space)
  • Consecutive uppercase letters followed by lowercase (APIResponse → API + Response)

Preserving Acronyms

Acronyms like "HTML", "API", "URL", "ID" need special handling. Different style guides disagree:

  • htmlParser vs HTMLParser (camelCase for HTML)
  • apiKey vs APIKey (camelCase for API)
  • userId vs userID (camelCase for ID)

Many converters provide options for acronym handling.

Using the Case Converter Tool

Our tool:

  1. Enter any text — handles any mix of case conventions as input
  2. Select target format — camelCase, PascalCase, snake_case, kebab-case, and more
  3. Batch conversion — convert multiple lines at once for bulk renaming
  4. Smart word splitting — correctly splits on boundaries in any input format
  5. Copy result — one-click copy in the target case format
  6. Acronym options — choose how to handle common abbreviations

Use it for renaming variables across codebases, converting database column names to API field names, generating code from documentation, and creating consistent naming in multi-language projects.