String Case Converter

Convert text between camelCase, PascalCase, snake_case, kebab-case, and more.

Privacy First

This tool runs entirely in your browser. No data is sent to any server. Your input remains completely private.

Enter some text to see all case conversions

What is String Case Conversion?

String case conversion is the process of transforming text between different capitalization and formatting conventions. In programming and web development, different contexts require different naming conventions, and being able to quickly convert between them is essential for productivity.

Whether you're naming variables, creating CSS classes, defining constants, or formatting titles, choosing the right case convention improves code readability and maintains consistency across your projects.

Common Case Conventions Explained

camelCase

Words are joined without spaces, with each word after the first starting with a capital letter. The first letter is lowercase. Named after the "humps" created by capital letters. Commonly used for JavaScript variables, function names, and JSON keys.

PascalCase (UpperCamelCase)

Like camelCase, but the first letter is also capitalized. Used for class names in most programming languages, React component names, and TypeScript interfaces.

snake_case

Words are lowercase and joined with underscores. Popular in Python, Ruby, database column names, and file names in many Unix-like systems.

kebab-case (hyphen-case)

Words are lowercase and joined with hyphens. Standard for CSS class names, HTML attributes, URL slugs, and npm package names.

CONSTANT_CASE (SCREAMING_SNAKE_CASE)

Words are uppercase and joined with underscores. Used for constants in most programming languages to indicate values that should not change.

Title Case

The first letter of each word is capitalized. Used for headings, titles, and proper nouns in formal writing.

Why Consistent Naming Matters

Code Readability

Consistent naming conventions make code easier to read and understand. When all variables follow the same pattern, developers can quickly identify what each identifier represents.

Framework Requirements

Many frameworks and languages have strict conventions. React requires PascalCase for components, Python style guides recommend snake_case for variables, and CSS class naming methodologies like BEM use specific patterns.

API Consistency

When building APIs, choosing a consistent case for JSON keys (often camelCase or snake_case) and sticking to it throughout prevents confusion for API consumers.

Team Collaboration

When everyone on a team follows the same conventions, code reviews become easier and merge conflicts decrease. Case converters help maintain consistency even when copying from different sources.

Common Conversion Scenarios

Database to JavaScript

Database columns typically use snake_case, while JavaScript prefers camelCase. Converting between them is a common task when mapping database records to objects.

Design to Code

Designers might provide names in Title Case or natural language, which need to be converted to kebab-case for CSS classes or camelCase for JavaScript.

API Integration

Different APIs use different conventions. Converting between cases when integrating with external services ensures consistency in your codebase.

Privacy and Security

All case conversion happens entirely in your browser. Your text never leaves your computer, making this tool safe for converting sensitive variable names, internal project terms, or confidential identifiers.

Common Use Cases

Variable Naming

Convert text to camelCase or snake_case for use as programming variable names following language conventions.

CSS Class Generation

Convert titles or descriptions to kebab-case for use as CSS class names or BEM modifiers.

Constant Definition

Convert text to CONSTANT_CASE for defining constants in JavaScript, Python, or other languages.

Component Naming

Convert text to PascalCase for React component names, TypeScript interfaces, or class names.

Database Column Mapping

Convert between snake_case database columns and camelCase JavaScript object properties.

URL Slug Creation

Convert titles to kebab-case for use in URL paths and slugs.

Worked Examples

Multiple Case Outputs

Input

user profile settings

Output

camelCase: userProfileSettings
PascalCase: UserProfileSettings
snake_case: user_profile_settings
kebab-case: user-profile-settings
CONSTANT_CASE: USER_PROFILE_SETTINGS

The same input phrase is converted to various case formats commonly used in programming.

Detect and Convert

Input

myExistingCamelCase

Output

snake_case: my_existing_camel_case
kebab-case: my-existing-kebab-case
Title Case: My Existing Camel Case

The tool detects the existing camelCase format and correctly splits it into words before converting to other formats.

Frequently Asked Questions

Does the tool handle numbers correctly?

Yes, numbers are preserved in their original position. For example, "user2profile" becomes "user2Profile" in camelCase and "user2_profile" in snake_case.

Can it detect my input format automatically?

Yes, the tool automatically detects camelCase, PascalCase, snake_case, kebab-case, and space-separated words, then correctly splits them before conversion.

What about special characters?

Most special characters are treated as word separators and removed during conversion. This includes hyphens, underscores, periods, and slashes.

Is there a limit to input length?

There is no hard limit, but for optimal performance, keep input under 10,000 characters. Very long inputs may cause temporary slowdowns.

Is my text sent to any server?

No, all processing happens locally in your browser. Your text never leaves your device, making it safe to convert sensitive identifiers.

Does it handle acronyms like HTTP or API?

Acronyms are treated as single words. "httpRequest" becomes "http_request" in snake_case. For special handling of acronyms, manual adjustment may be needed.