Skip to content
TheCalcUniverse

String Case Converter — Convert Between Text Case Formats

Convert text between 9 case formats: camelCase, PascalCase, snake_case, kebab-case, dot.case, Title Case, Start Case, UPPER CASE, and lower case.

✓ Tested formula & cited sources Formula verified 2026-05-18 Runs in your browser — inputs never sent anywhere

The formula

camelCase: first word lowercase, subsequent words capitalized PascalCase: all words capitalized snake_case: lowercase with underscores kebab-case: lowercase with hyphens

camelCase
camelCase
PascalCase
PascalCase
snake_case
snake_case
Full explanation ↓

How Case Converter Works

camelCase: first word lowercase, subsequent words capitalized PascalCase: all words capitalized snake_case: lowercase with underscores kebab-case: lowercase with hyphens

String case conversion transforms text between naming conventions used in programming and writing. Each format has specific rules for word separation, capitalization, and delimiter characters. Case converters are essential for maintaining consistent code style across projects and adapting identifiers between different programming language conventions.

camelCase
camelCaseFirst word lowercase, subsequent words capitalized, no separators. Commonly used for variable and function names in JavaScript, Java, and C#.
PascalCase
PascalCaseEvery word starts with an uppercase letter, no separators. Standard for class names, components, and type definitions in many languages.
snake_case
snake_caseAll lowercase words separated by underscores. Used in Python, Ruby, and database column names for readability.
Visual comparison of different text case formats applied to the same input string

How to Use

  1. Enter or paste the text you want to convert into the input field.
  2. The converter automatically displays results in all nine case formats as you type.
  3. Click the copy button next to any result to copy that formatted version to your clipboard.

Quick Reference

camelCase →variableName, getUserData, calculateTotal
PascalCase →ClassName, UserProfile, GetRequestHandler
snake_case →user_name, db_table, http_response_code
kebab-case →css-class, data-attribute, url-slug

Common Uses

  • Converting between naming conventions when switching programming languages
  • Standardizing API response field names to match a project style guide
  • Generating clean database column names from user-facing form labels
  • Creating URL-friendly slugs and CSS class names from arbitrary text
  • Formatting user input for consistent storage and display in applications

Understanding the Result

String case conversion is a fundamental operation in software development, enabling developers to seamlessly transition between the diverse naming conventions used across programming languages, frameworks, and coding standards. Each case format serves a specific purpose in the ecosystem of code style. camelCase (also called lowerCamelCase) is the standard for variables and functions in JavaScript, Java, TypeScript, and Swift. PascalCase (also called UpperCamelCase) is reserved for class names, constructors, and React components across the same languages. snake_case dominates in Python and Ruby communities and is the standard for database column names in SQL, as underscores are more readable than alternatives in all-caps SQL queries. kebab-case is the web standard for CSS class names, HTML data attributes, and URL slugs because hyphens are URL-safe and visually clean. UPPER CASE is used for constants in many languages, environment variable names, and acronyms. The choice of naming convention often follows community standards: JavaScript ecosystem favors camelCase for variables and PascalCase for classes, Python's PEP 8 recommends snake_case for everything except classes (PascalCase), and Ruby follows similar conventions. CSS property names are always kebab-case (e.g., background-color, font-size). When moving between languages or contributing to projects with different style guides, a case converter saves significant time and eliminates manual errors. It also helps when generating code from external data sources, where you might need to convert database column names (snake_case) into JavaScript variable names (camelCase) or TypeScript interface properties.

Worked Examples

Converting database column names (snake_case) to JavaScript variables (camelCase)

input = user_first_name

camelCase: userFirstName, PascalCase: UserFirstName, snake_case: user_first_name, kebab-case: user-first-name

Enter "user_first_name" to get "userFirstName" (camelCase). When fetching data from a PostgreSQL or MySQL database where columns are snake_case, you need to convert them to camelCase for your JavaScript/TypeScript frontend. The same input also shows PascalCase ("UserFirstName") for TypeScript interfaces and kebab-case ("user-first-name") for CSS classes or URL slugs.

Generating CSS class names and HTML data attributes from a component label

input = Hero Section Title

kebab-case: hero-section-title, camelCase: heroSectionTitle, snake_case: hero_section_title, PascalCase: HeroSectionTitle

Enter a human-readable label like "Hero Section Title" to generate "hero-section-title" (kebab-case for CSS classes), "heroSectionTitle" (camelCase for JSX component props), and "hero_section_title" (snake_case for database columns or Python variables). This cross-format conversion from one input saves significant manual renaming effort when building full-stack features.

Converting a REST API response (camelCase) to Python data model fields (snake_case)

input = customerBillingAddress

snake_case: customer_billing_address, PascalCase: CustomerBillingAddress, camelCase: customerBillingAddress, kebab-case: customer-billing-address

Enter a camelCase field name from a JavaScript API response to get "customer_billing_address" (snake_case) for your Python backend or database schema. Also shows PascalCase ("CustomerBillingAddress") for your Pydantic model class name. The converter handles the full round-trip: JavaScript -> Python -> database schema, keeping naming conventions consistent across the stack.

Standardizing user-entered form data to a consistent identifier format

input = User-Entered DATA_Field!!

camelCase: userEnteredDataField, UPPER CASE: USER_ENTERED_DATA_FIELD, Title Case: User Entered Data Field

Real user input is messy — spaces, mixed delimiters, special characters. Entering " User-Entered DATA_Field!! " produces clean "userEnteredDataField" (camelCase), "USER_ENTERED_DATA_FIELD" (upper snake for constants), and "User Entered Data Field" (Title Case for display). Use this to sanitize and normalize free-form user input into consistent identifiers for your backend.

Frequently Asked Questions

What is the difference between Title Case and Start Case?
Title Case typically capitalizes every word but may leave short articles, prepositions, and conjunctions lowercase depending on the style guide (e.g., APA, Chicago). Start Case (also called Initial Caps or Capital Case) capitalizes the first letter of every word without exceptions. Our Title Case implementation capitalizes all words, making it equivalent to Start Case for most practical purposes.
Why are there so many naming conventions?
Different naming conventions evolved from different language communities and historical constraints. camelCase emerged from C and Java traditions where special characters were restricted in identifiers. snake_case was popularized by C's standard library and later by Python. kebab-case is natural for URLs and CSS where hyphens are valid. Each convention optimizes for readability in its specific context.
Which case format should I use for JSON keys?
There is no official JSON standard for key naming, but camelCase is most common in JavaScript/TypeScript ecosystems, while snake_case is preferred in Python and Ruby communities. For public APIs, consistency matters more than the specific choice. Many APIs adopt camelCase for JSON keys to match JavaScript conventions.
What is the difference between camelCase and PascalCase?
The only difference is the first character: camelCase starts with a lowercase letter (e.g., "userName"), while PascalCase starts with an uppercase letter (e.g., "UserName"). In practice, camelCase is used for variables and functions, while PascalCase is used for classes, types, and constructors.
Does the converter handle Unicode characters?
The converter works with standard ASCII alphanumeric characters. Non-ASCII Unicode characters (like accented letters or CJK characters) are treated as word separators in some conversion modes, while in others they pass through. For best results with special characters, preprocess your input to standard ASCII.

Pro Tips

  • Use UPPER CASE for environment variables and constants (REACT_APP_API_URL, MAX_RETRY_COUNT) — it is the universal convention across JavaScript, Python, Ruby, and shell scripts.
  • When creating CSS class names, always use kebab-case (not camelCase). CSS is case-insensitive for selectors, but kebab-case is the conventional style and what frameworks like Tailwind CSS expect.
  • For TypeScript interfaces and React component names, always use PascalCase. This distinguishes types/components from variables at a glance: UserProfile (type) vs userProfile (variable). Most ESLint rulesets enforce this.
  • When designing REST APIs, pick one JSON key convention and stick with it across every endpoint. camelCase is most common in the JavaScript ecosystem; snake_case is standard in Python/Ruby communities. Mixing conventions within an API is confusing for consumers and often flags in code review.

Limitations to Know

  • The converter works with standard ASCII alphanumeric characters. Non-ASCII Unicode characters (accented letters, CJK characters, emoji) are treated as word separators in some conversion modes but may produce unexpected results.
  • camelCase conversion from already-camelCase input strips the casing and starts fresh (e.g., "helloWorld" -> "hello_world" in snake_case) which loses the internal word boundary — this is a known limitation of plain-text case converters without semantic word boundary detection.
  • The Start Case conversion capitalizes the first letter after any non-alphanumeric character, which may not match strict Title Case rules that lowercase articles and prepositions.
  • For production code generation where preservation of original word boundaries matters, use AST-aware tools rather than string-based converters.
Was this calculator helpful?
Cite this calculator

TheCalcUniverse. "String Case Converter — Convert Between Text Case Formats." TheCalcUniverse, 2026, https://thecalcuniverse.com/devtools/string-case-converter/. Accessed July 24, 2026.

Embed this calculator on your site

Free to embed. Paste this into any HTML page — it stays up to date automatically.

Open embed ↗

You may also like

Guides that use this calculator